Obtain devices list with Python and pcapy

Install pcapy

sudo apt-get install python-pcapy

Code

import pcapy
 
devs = pcapy.findalldevs();
 
for dev in devs:
    print dev

Run

sudo python mysniffer.py

Output

eth0
usbmon1
usbmon2
usbmon3
usbmon4
usbmon5
any
lo

Capture packets with Python and pcapy.

Categories: Python Tags: , , , , , ,
%d bloggers like this: