from scapy.all import * show_interfaces() pkts = sniff(count=5,filter="arp") pkts.summary() arppkt = eval(pkts[0].command()) arppkt[ARP].hwsrc = "00:11:22:aa:bb:cc" arppkt[ARP].pdst = "127.0.0.1" arppkt[Ether].dst = "ff:ff:ff:ff:ff:ff" print arppkt sendp(arppkt)
Выводит:
IFACE IP MAC eth0 192.168.0.103 c0:18:85:f7:c6:57 Ether / ARP who has 192.168.0.1 says 192.168.0.103 Ether / ARP is at 64:66:b3:41:b8:9e says 192.168.0.1 Ether / ARP who has 192.168.0.1 says 192.168.0.103 Ether / ARP is at 64:66:b3:41:b8:9e says 192.168.0.1 Ether / ARP who has 192.168.0.1 says 192.168.0.103 ����������W . Sent 1 packets.