2

我正在尝试从 scapy 模块创建一个嗅探器。我在 macOS Catalina 上运行 Python 3.7。假设它与 macOS Catalina 公共测试版有关。如果是这样,我只想知道是什么导致了问题。我正在努力理解为什么 scapy 会抛出索引越界跟踪:

主文件

import scapy.all as scapy

p = scapy.sniff()

p.summary()

结果:

Traceback (most recent call last):
  File "/Users/tom/PycharmProjects/sniffer/main.py", line 2, in <module>
    import scapy.all as scapy
  File "/Users/tom/PycharmProjects/sniffer/venv/lib/python3.7/site-packages/scapy/sendrecv.py", line 33, in <module>
    import scapy.route  # noqa: F401
  File "/Users/tom/PycharmProjects/sniffer/venv/lib/python3.7/site-packages/scapy/route.py", line 194, in <module>
    conf.route = Route()
  File "/Users/tom/PycharmProjects/sniffer/venv/lib/python3.7/site-packages/scapy/route.py", line 27, in __init__
    self.resync()
  File "/Users/tom/PycharmProjects/sniffer/venv/lib/python3.7/site-packages/scapy/route.py", line 35, in resync
    self.routes = read_routes()
  File "/Users/tom/PycharmProjects/sniffer/venv/lib/python3.7/site-packages/scapy/arch/unix.py", line 82, in read_routes
    netif = rt[4 + mtu_present + prio_present + refs_present + locked]
IndexError: list index out of range
4

1 回答 1

1

这似乎是一个错误。请检查https://github.com/secdev/scapy/issues/2139现在应该修复它:-)

于 2019-07-15T09:50:56.677 回答