from scapy.all import *
#创建数据流
f = PcapWriter("2.cap",append=True)
print(conf.ifaces) #查看本机所有网卡
print(conf.route) #查看本机所有路由
def callback(pkt):
print(pkt.summary())
f.write(pkt)
# sniff(filter="icmp and host 127.0.0.1",iface="Software Loopback Interface 1",prn=callback,count=int(16))
sniff(filter="dst host 127.0.0.1",iface="Software Loopback Interface 1",prn=callback,count=int(1))
print("=======")
sinff()捕获数据包
最新推荐文章于 2025-07-24 09:01:21 发布
1万+

被折叠的 条评论
为什么被折叠?



