I hit the below error when trying to send packet using:
>>> send(IP(dst="192.168.1.1")/ICMP())
---------------------------------------------------------------------------
OSError Traceback (most recent call last)
<ipython-input-2-8333be02b5c1> in <module>
----> 1 send(IP(dst="192.168.1.1")/ICMP())
~/scapy/lib/python3.6/site-packages/scapy/sendrecv.py in send(x, inter, loop, count, verbose, realtime, return_packets, socket, *args, **kargs)
298 [socket=None]) -> None"""
299 if socket is None
--> 300 socket = conf.L3socket(*args, **kargs)
301 return __gen_send(socket, x, inter=inter, loop=loop, count=count, verbose=verbose,
302 realtime=realtime, return_packets=return_packets)
~/scapy/lib/python3.6/site-packages/scapy/arch/linux.py in __init__(self, iface, type, promisc, filter, nofilter, monitor)
405 def __init__(self, type = ETH_P_ALL, filter=None, promisc=None, iface=None, nofilter=0):
406 self.type = type
--> 407 self.ins = socket.socket(socket.AF_PACKET, socket.SOCK_RAW, socket.htons(type))
408 self.ins.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 0)
409 if iface:
/usr/lib/python3.6/socket.py in __init__(self, family, type, proto, fileno)
142 # constructor of _socket.socket converts the given argument to an
143 # integer automatically.
--> 144 _socket.socket.__init__(self, family, type, proto, fileno)
145 self._io_refs = 0
146 self._closed = False
OSError: [Errno 97] Address family not supported by protocol
Is there anything that might cause this on a fresh install of Scapy?
That probably would happen if you use VM or Windows Subsystem for Linux. Try standard installation, that solved the same problem for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With