Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to fix Scapy "Warning pcapy API does not permit to get capure file descriptor"?

I am trying to capture outgoing packets (i.e., from my localhost) by using Scapy capturing function sniff, then parse them as they get captured but I keep getting the following warning:

WARNING: fileno: pcapy API does not permit to get capure file descriptor. Bugs ahead! Press  
Enter to trigger packet reading

Is there a fix for this issue? I need the process to be fully automatic without the user interaction.

Any help is greatly appreciated.

p.s. my system setup is:

OS: Mac OS X 10.7.5
python: 2.7.1
scapy: 2.2.0

Thanks

like image 788
OiaSam Avatar asked Jun 26 '13 07:06

OiaSam


1 Answers

Just in case somebody else ran into the same issue, I managed to solve it by installing pypcap module to replace pcapy. I referred to http://comments.gmane.org/gmane.comp.security.scapy.general/4026

you will need to have the following dependencies installed:

  • C compiler + make (Xcode will have these settled)
  • libpcap
  • pyrex ( can be installed by package manager e.g., pip ).

you might run into an issue when you install pypcap after the dependencies are installed, refer to this patch http://code.google.com/p/pypcap/issues/detail?id=13, it worked for me!

like image 50
OiaSam Avatar answered Sep 23 '22 08:09

OiaSam