简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM