gpt4 book ai didi

python - Scapy模块: netif = rt[4 + mtu_present + prio_present + refs_present + locked] IndexError: list index out of range

转载 作者:行者123 更新时间:2023-12-01 07:37:10 27 4
gpt4 key购买 nike

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

main.py

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

最佳答案

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

关于python - Scapy模块: netif = rt[4 + mtu_present + prio_present + refs_present + locked] IndexError: list index out of range,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56936549/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com