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


You can use threads in python and sniff each interface on a different thread:



https://docs.python.org/2/library/threading.html

0


source


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


The short answer is there is no way to do it.

0


source







All Articles