Scapy - sniffing 2 out of 3 interfaces
I am using Scapy 2.2.0 and Python 2.6 for sniffing on Windows 7. I know you can provide a iface
function parameter sniff
. eg:
sniff(count=5,iface = 'eth0', prn=lambda p:p.show())
If this parameter is not specified, it sniffs all interfaces. But is there a way to choose 2 out of 3 interfaces? something like this: (it doesn't work)
sniff(count=5, iface='eth0, eth14', prn=lambda p:p.show())
+3
source to share
3 answers
Since version 2.3.3 it is now possible to specify multiple interfaces using an array like this example from scapy / usage.rst :
sniff(iface=["eth1","eth2"], prn=lambda x: x.sniffed_on+": "+x.summary())
+2
source to share