Scapy - 嗅探三个接口中的两个

ori*_*ori 5 python scapy network-interface

我正在使用 Scapy 2.2.0 和 Python 2.6 在 Windows 7 上进行嗅探。我知道您可以iface向该sniff函数提供参数。例如:

sniff(count=5,iface = 'eth0', prn=lambda p:p.show())
Run Code Online (Sandbox Code Playgroud)

如果您不提供此参数,它将在所有接口中进行嗅探。但有没有办法从 3 个接口中选择 2 个呢?像这样的东西:(它不起作用)

sniff(count=5, iface='eth0, eth14', prn=lambda p:p.show())
Run Code Online (Sandbox Code Playgroud)

小智 5

从版本 2.3.3 开始,现在可以使用数组指定多个接口,如scapy/usage.rst中的示例:

   sniff(iface=["eth1","eth2"], prn=lambda x: x.sniffed_on+": "+x.summary())
Run Code Online (Sandbox Code Playgroud)


Fit*_*lry 0

您可以在 python 中使用线程并嗅探不同线程中的每个接口:

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