Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Capturing Scapy function show_interfaces() output in Python

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()
like image 228
Somputer Avatar asked Sep 20 '26 02:09

Somputer


1 Answers

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.

like image 151
Avishay116 Avatar answered Sep 21 '26 16:09

Avishay116