Scapy sniff() “对不是套接字的东西执行了操作" [英] Scapy sniff() "an operation was performed on something that is not a socket"

查看:60
本文介绍了Scapy sniff() “对不是套接字的东西执行了操作"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了 scapy 并试图开始使用它,但在使用 sniff() 函数时遇到了问题.

我已经能够使用他们的文档中描述的步骤安装 Scapy.我正在运行 Windows 7 x64 并使用 Python 2.6.我可以很好地使用 send 函数系列(已通过 Wireshark 确认),但 sniff() 因以下堆栈跟踪失败:

回溯(最近一次调用最后一次):文件sniffingStuff.py",第 11 行,位于 <module>嗅探(过滤器=ip",prn=customAction)文件C:\Python26\lib\site-packages\scapy\sendrecv.py",第 575 行,在嗅探中sel = select([s],[],[],remain)select.error: (10038, '试图对不是套接字的东西进行操作')

我唯一认为可能是错误的事情是我已经安装了 PCAP,因为我安装了 Wireshark.我环顾四周,没有看到任何有用的答案.

由于我在原帖中没有明确说明这一点,因此无论参数、过滤器等如何,对 sniff 函数的任何调用都会失败.有关具体参考,请参见 此处.

谢谢

解决方案

我相信根据安装说明,scapy 需要特定版本的 WinPCAP.查看 Windows 安装指南此处了解支持的版本信息.>

I recently installed scapy and was trying to start using it and I'm having trouble using the sniff() function.

I've been able to install Scapy using the steps described in their docs. I'm running Windows 7 x64 and using Python 2.6. I'm able to use the send family of functions fine (confirmed with Wireshark) but sniff() is failing with the following stack trace:

Traceback (most recent call last):
  File "sniffingStuff.py", line 11, in <module>
    sniff(filter="ip",prn=customAction)
  File "C:\Python26\lib\site-packages\scapy\sendrecv.py", line 575, in sniff
    sel = select([s],[],[],remain)
select.error: (10038, 'An operation was attempted on something that is not a socket')

The only thing off the top of my head that I thought might be wrong is that I had PCAP installed already because I had Wireshark installed. I looked around and didn't see any useful answers.

Edit: Since I didn't make this clear in my original post, any calls to the sniff function fails, regardless of parameters, filters, etc. For a concrete reference see here.

Thanks

解决方案

I believe that scapy requires a specific version of WinPCAP as per the instructions for installation. Check the Windows installation guide here for supported version information.

这篇关于Scapy sniff() “对不是套接字的东西执行了操作"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆