Python-2.7 Scapy -- 同时发送多个arp请求

Python-2.7 Scapy -- send multiple arp requests simultaniously

我如何创建一个脚本来获取两个变量并将它们用作 ip_src 和另一个 ip_dest?在脚本中传递它们,它会循环发送 arp 请求

dict1 = {"192.168.1.4":"192.168.1.6","192.168.1.4":"192.168.1.3","192.168.1.4":"192.168.1.1"}
#the first item in the dict is the ip_scr and the second is the ip_dest
for *couple*?? in dict1:
    send([ARP(op=ARP.who_has, psrc=ip_src, pdst=ip_dest)], loop = 1)

第二个问题是,由于脚本不会停止,所以不会执行第二对和第三对等...

Scapy's official API documentation中所述,send()函数的第一个参数可能是数据包列表:

pkts can be a packet, an implicit packet or a list of them.

因此,下面应该在无限循环中发送所有需要的数据包:

send([ARP(op=ARP.who_has, psrc=ip_src, pdst=ip_dst) for ip_src, ip_dst in dict1.viewitems()], loop=1)