首先我尝试运行这个:
from scapy.all import *
while True:
send([ARP(op=ARP.who_has, psrc="192.168.1.60")])
我发送了 9 个数据包然后停止。我希望它一直运行到我按下 ctrl+c。
我有一个 ip 列表 ["192.168.1.7","192.168.1.12","192.168.1.32","192.168.1.223"]
我试过运行:
from scapy.all import *
while True:
for ip in mylist:
send([ARP(op=ARP.who_has, psrc="192.168.1.60")])
它仍然发送 9 个数据包并停止。我想知道在按下 ctrl+C 之前如何发送数据包。
最佳答案
你可以使用:
send(ARP(op=1,psrc='172.16.16.255'),loop=1)
它应该一直运行,直到您按下 Ctrl+C。
好的。我对其进行了编辑以遍历您的列表:
mylist = ('192.168.1.12','192.168.1.32','192.168.1.223')
while True:
for i in mylist:
send(ARP(op=1,psrc='192.168.1.60',pdst=i))
关于python - scapy 发送数据包直到 ctrl+c 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35974341/