0

I am attempting to use PyPy and Scapy to sniff on a wireless adapter. I'm on Ubuntu Linux, so I put my card into monitor mode using airmon-ng, open up a REPL, and type the following (after importing scapy):

sniff(prn=lambda pkt: pkt.summary(), iface='mon0')

This works fine in the CPython REPL. However, in the PyPy REPL, I get the following error:

Traceback (most recent call last):
    File "<console>", line 1, in <module>
    File "scapy/sendrecv.py", line 550, in sniff
        s = L2socket(type=ETH_P_ALL, *arg, **karg)
    File "scapy/arch/linux.py", line 452, in __init__
        self.ins.bind((iface, type))
    File "<string>", line 1, in bind
error: unknown address family

This also occurs if I turn off monitor mode and attempt to sniff the standard adapter (wlan0). However, it does appear to work with a non-wireless interface (eth1).

The PyPy Compatibility index list Scapy as working with PyPy. After some googling, I came across this post which looks like it could be an answer, but both links are no longer working. Any input on the subject would be much appreciated.

Thank you in advance,

Ryan

2 Answers2

0

I think some packet types support is not working on all architectures. You need to say what are you trying to use it on (OS X, Linux, Windows) and the version of PyPy at the very minimum. Also, bugs.pypy.org is the right place, not here.

fijal
  • 3,190
  • 18
  • 21
0

I got this error once when scapy was not run with enough privileges. Try running it as a system administrator.

d33tah
  • 10,999
  • 13
  • 68
  • 158