From adfc39902a4bd26108b3454671562ce0a39ff9e6 Mon Sep 17 00:00:00 2001 From: EddieIvan01 <406917347@qq.com> Date: Sat, 21 Mar 2020 19:56:51 +0800 Subject: [PATCH] Fix 2 bugs: wrong way to parse socks5; headers type must be string --- reGeorgSocksProxy.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reGeorgSocksProxy.py b/reGeorgSocksProxy.py index 86647f9..7921063 100644 --- a/reGeorgSocksProxy.py +++ b/reGeorgSocksProxy.py @@ -136,7 +136,8 @@ def __init__(self, pSocket, connectString): def parseSocks5(self, sock): log.debug("SocksVersion5 detected") - nmethods, methods = (sock.recv(1), sock.recv(1)) + nmethods = sock.recv(1) + sock.recv(ord(nmethods)) sock.sendall(VER + METHOD) ver = sock.recv(1) if ver == "\x02": # this is a hack for proxychains @@ -218,7 +219,7 @@ def handleSocks(self, sock): return self.parseSocks4(sock) def setupRemoteSession(self, target, port): - headers = {"X-CMD": "CONNECT", "X-TARGET": target, "X-PORT": port} + headers = {"X-CMD": "CONNECT", "X-TARGET": target, "X-PORT": str(port)} self.target = target self.port = port cookie = None