使用 Scapy 时出错

发布于 2024-12-28 07:19:23 字数 762 浏览 1 评论 0原文

我正在使用 Python2.5 和 Scapy2.2.0 。当我执行以下代码时:

from scapy.all import *

a = IP(dst='10.100.95.184')
a.src = "10.100.95.22"
ab = a/ICMP()
sendp(ab)

我收到以下错误:

WARNING: No route found for IPv6 destination :: (no default route?)

Traceback (most recent call last):
  File "C:\Python25\att.py", line 6, in <module>
    sendp(ab)
  File "C:\Python25\Lib\site-packages\scapy\sendrecv.py", line 259, in sendp
    __gen_send(conf.L2socket(iface=iface, *args, **kargs), x, inter=inter, loop=loop, count=count, verbose=verbose, realtime=realtime)
  File "C:\Python25\Lib\site-packages\scapy\sendrecv.py", line 237, in __gen_send
    os.write(1,".")
OSError: [Errno 9] Bad file descriptor

知道如何纠正此问题吗?

I am using Python2.5 and Scapy2.2.0 . When I execute the following code:

from scapy.all import *

a = IP(dst='10.100.95.184')
a.src = "10.100.95.22"
ab = a/ICMP()
sendp(ab)

I get the following error:

WARNING: No route found for IPv6 destination :: (no default route?)

Traceback (most recent call last):
  File "C:\Python25\att.py", line 6, in <module>
    sendp(ab)
  File "C:\Python25\Lib\site-packages\scapy\sendrecv.py", line 259, in sendp
    __gen_send(conf.L2socket(iface=iface, *args, **kargs), x, inter=inter, loop=loop, count=count, verbose=verbose, realtime=realtime)
  File "C:\Python25\Lib\site-packages\scapy\sendrecv.py", line 237, in __gen_send
    os.write(1,".")
OSError: [Errno 9] Bad file descriptor

Any idea how I can correct this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

昇り龍 2025-01-04 07:19:23

我有一个类似的问题(不完全是错误消息),它看起来不是您的代码中的问题。我修复了重新安装 scapy 软件包的场景。你尝试过吗?也尝试将您的 Python 版本升级到下一版本。

祝你好运 !

i had a similar problem (not this exactly error message) and it looks like not a problem in your code. I fixed my scenario reinstalling the scapy package. Have you tried it? Try to upgrade your Python version to the next one too.

Good luck !

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文