3

i find this link

Capturing Scapy function output in Python

but this help not for me..

show_interfaces() is good working in cmd.

but it is not working in console..

i want to get output string show_interfaces():

from scapy.arch.windows import show_interfaces
show_interfaces()

2 Answers 2

4

You can look in the source code of Scapy, and you will find the show_interfaces function.

def show_interfaces(resolve_mac=True):
    """Print list of available network interfaces"""
    return IFACES.show(resolve_mac)

To get a python dict with the information about the interfaces. I used

IFACES.data

From here you can convert it to string if you want to.

Sign up to request clarification or add additional context in comments.

Comments

0

Here is the source update from scapy/interfaces.py

def show_interfaces(resolve_mac=True):
    # type: (bool) -> None
    """Print list of available network interfaces"""
    return conf.ifaces.show(resolve_mac)  # type: ignore

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.