Scapy sniff() “an operation was performed on something that is not a socket”

笑着哭i 提交于 2019-12-25 04:08:16

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/28014568/scapy-sniff-an-operation-was-performed-on-something-that-is-not-a-socket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!