pythonscapysniffer

Python - Scapy Choosing an interface to sniff


Im building a sniffer with Scapy, python 2.6.6 and windows 7 and I want to know if I can choose the interface to sniff before sniffing, kind of like Wireshark.


Solution

  • You can use the iface parameter.

    sniff(iface="wlan0", prn=exampleFunction) 
    

    But if no interface is given, sniffing will happen on every interfaces.

    You can look in the Sniffing section in the Scapy webpage