oridamari
oridamari

Reputation: 601

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.

Upvotes: 2

Views: 25538

Answers (2)

user2976957
user2976957

Reputation:

I realize this is a dated post. One of the solutions mentions:

But if no interface is given, sniffing will happen on every interfaces. You can look in the Sniffing section in the Scapy webpage

Unfortunately the documentation is wrong. When no interface is given then the scapy sniffs on conf.iface

Please see the conversation on their github repo:

https://github.com/secdev/scapy/issues/1356

Upvotes: 9

sinkmanu
sinkmanu

Reputation: 1112

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

Upvotes: 6

Related Questions