【问题标题】:Scapy speed up sniff performanceScapy 加快嗅探性能
【发布时间】:2020-08-17 09:02:21
【问题描述】:

我有一个使用 scapy 2.4.3 sniff() 函数的 python 脚本,在线程中运行:

sniff(iface=self.iface, store=0, filter="(ip and not src net %s) and (udp dst port %s)" % (self.ip_src, str(self.dport)), prn=self.handle_someip_packet)

我注意到这个嗅探线程的执行花费了太多时间。

我想设置 conf.layers.filter([UDP]),但我得到了错误: AttributeError: 'LayersList' 对象没有属性 'filter'

我做错了什么?

还有其他加快 scapy 嗅探速度的想法吗?

提前致谢,

【问题讨论】:

    标签: python multithreading performance filter scapy


    【解决方案1】:

    您可能在不知不觉中使用了旧版本的 scapy。尝试使用 2.4.4rc2 (pip3 install scapy --pre)

    您可以使用scapy.__version__查看版本

    【讨论】:

      猜你喜欢
      • 2015-04-09
      • 2015-12-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-05
      • 2016-09-24
      相关资源
      最近更新 更多