1
如何嗅探數據包只是出站數據包? 我試圖只嗅探目標端口,但它根本沒有成功Python(scapy):如何嗅探只有outboun數據包的數據包
如何嗅探數據包只是出站數據包? 我試圖只嗅探目標端口,但它根本沒有成功Python(scapy):如何嗅探只有outboun數據包的數據包
也許你可以得到你的設備的MAC地址,並過濾任何包含該地址作爲源地址的數據包。
很容易的確:
sniff(lfilter=lambda pkt:pkt.haslayer(Ether) and pkt[Ether].src.lower()==get_if_hwaddr(conf.iface).lower())
如果你想打印出來:
sniff(lfilter=lambda pkt:pkt.haslayer(Ether) and pkt[Ether].src.lower()==get_if_hwaddr(conf.iface).lower(), prn=lambda x:x.summary())
您可以使用其他接口比conf.iface