当使用IP广播(dst)时,如何告诉scapy将响应数据包与发送数据包相关联?我看到带有嗅探的正确响应数据包,我只是无法获得srp / srp1来获取它们。
p = Ether(dst='ff:ff:ff:ff:ff:ff')/IP(src='1.1.1.1', dst='255.255.255.255')/UDP(sport=53222, dport=2010)/Raw(load=b'{"stuff"}')
ans = srp1(p,iface='Bond1')
Packet sent:
###[ Ethernet ]### dst= ff:ff:ff:ff:ff:ff src= 11:11:11:11:11:11 type= 0x800
###[ IP ]### version= 4 ihl= 5 tos= 0x0 len= 76 id= 1 flags= frag= 0 ttl= 64 proto= udp chksum= 0xd81e src= 1.1.1.1 dst= 255.255.255.255 \options
###[ UDP ]### sport= 53222 dport= 2010 len= 56 chksum= 0x8e04
###[ Raw ]### load= '{"stuff"}'
Packet response:
###[ Ethernet ]### dst= 11:11:11:11:11:11 src= 22:22:22:22:22:22 type= 0x800
###[ IP ]### version= 4 ihl= 5 tos= 0x0 len= 207 id= 0 flags= DF frag= 0 ttl= 64 proto= udp chksum= 0xf507 src= 2.2.2.2 dst= 1.1.1.1 \options
###[ UDP ]### sport= 2010 dport= 53222 len= 187 chksum= 0xc61e
###[ Raw ]### load= '{"stuff response"}'
如果目标IP地址用于响应数据包,Scapy将仅捕获响应,但在我的情况下,我需要广播以查找目标。
谢谢!