from scapy.all import *
import time
iface="eth0"
if len(sys.argv)>=2:
iface=sys.argv[1]
while(1):
eth = Ether(src=RandMAC("*:*:*:*:*:*"),dst=RandMAC("*:*:*:*:*:*"))
arp = IP(src=RandIP("*.*.*.*"),dst=RandIP("*.*.*.*"))
print eth.dst
packet = eth/arp/ICMP()
time.sleep(0.5)
sendp(packet,iface=iface,loop=0)
原文地址:http://blog.51cto.com/13447608/2089164