我有这样的剧本:
from scapy.all import *
def ip1(ip):
pkt = send(ARP(op=ARP.who_has, psrc="192.168.5.51", pdst=ip))
x = sniff(filter="arp", count=10)
print (x.summary())
print ("done")
ip1("192.168.5.46")现在,它卡在了发送线上:它写着:
. Sent 1 packets.但是没有继续脚本(而且它也没有真正发送数据包)。当我ctrl+c脚本时,它发送数据包并打印x.summary()并打印完成.我想知道为什么事先谢谢你。
编辑:答案是关于sr()、sr1()、srp()和srp1()函数吗?
发布于 2015-09-27 07:34:45
". Sent 1 packets.“输出实际上证明了脚本发送了数据包。但是,它被卡在sniff函数上,直到Ctrl-C被击中为止。此函数将触发无休止的嗅探操作,除非timeout参数另有规定。
's official API documentation读到:
timeout:在给定的时间后停止嗅探(默认值:None)。
https://stackoverflow.com/questions/32804657
复制相似问题