1
arp = ARP(pdst=ip1,psrc=ip2,op="is-at")
packet = ethernet / arp
while True:
    sendp(packet, iface=iface)
    time.sleep(10)

And the Error is -

File "/home/darshan/.local/lib/python2.7/site-           packages/scapy/arch/linux.py", line 414, in __init__
self.ins = socket.socket(socket.AF_PACKET, socket.SOCK_RAW,   socket.htons(type))
File "/usr/lib/python2.7/socket.py", line 191, in __init__
_sock = _realsocket(family, type, proto)
error: [Errno 1] Operation not permitted

I am a newbie in networking so please help. I am unable to debug it.

Darshan
  • 181

1 Answers1

1

Only root is allowed to open raw sockets. Use sudo to run your Python program.