From ef892e91da4ffca85f2f8e7fe65d116601d06b13 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Sat, 23 Mar 2019 03:34:27 +0100 Subject: [PATCH] Add random padding to handshake --- src/Connection/Connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Connection/Connection.py b/src/Connection/Connection.py index b5f7ae70..4edd33a2 100644 --- a/src/Connection/Connection.py +++ b/src/Connection/Connection.py @@ -1,5 +1,6 @@ import socket import time +import random import gevent import msgpack @@ -172,7 +173,7 @@ class Connection(object): self.sock.connect(sock_address) # Detect protocol - self.send({"cmd": "handshake", "req_id": 0, "params": self.getHandshakeInfo()}) + self.send({"cmd": "handshake", "req_id": 0, "params": self.getHandshakeInfo(), "random": "A" * random.randint(0, 1024)}) event_connected = self.event_connected gevent.spawn(self.messageLoop) connect_res = event_connected.get() # Wait for handshake