From 1ef6ade5dae29576bf23c1fc754448526baaacdd Mon Sep 17 00:00:00 2001 From: gjhami Date: Thu, 31 Oct 2024 12:57:22 -0400 Subject: [PATCH] Update socksserver.py Fix hostname parsing --- impacket/examples/ntlmrelayx/servers/socksserver.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/impacket/examples/ntlmrelayx/servers/socksserver.py b/impacket/examples/ntlmrelayx/servers/socksserver.py index 5f7e82f45..1c7bb1d4e 100644 --- a/impacket/examples/ntlmrelayx/servers/socksserver.py +++ b/impacket/examples/ntlmrelayx/servers/socksserver.py @@ -326,7 +326,7 @@ def handle(self): self.targetPort = unpack('>H',request['PAYLOAD'][4:])[0] elif request['ATYP'] == ATYP.DOMAINNAME.value: hostLength = unpack('!B',request['PAYLOAD'][:1])[0] - self.targetHost = request['PAYLOAD'][1:hostLength+1] + self.targetHost = request['PAYLOAD'][1:hostLength+1].decode(encoding='utf-8') self.targetPort = unpack('>H',request['PAYLOAD'][hostLength+1:])[0] else: LOG.error('No support for IPv6 yet!')