diff --git a/impacket/examples/ntlmrelayx/servers/socksserver.py b/impacket/examples/ntlmrelayx/servers/socksserver.py index 22a59204c5..5f7e82f45f 100644 --- a/impacket/examples/ntlmrelayx/servers/socksserver.py +++ b/impacket/examples/ntlmrelayx/servers/socksserver.py @@ -325,7 +325,7 @@ def handle(self): self.targetHost = socket.inet_ntoa(request['PAYLOAD'][:4]) self.targetPort = unpack('>H',request['PAYLOAD'][4:])[0] elif request['ATYP'] == ATYP.DOMAINNAME.value: - hostLength = unpack('!B',request['PAYLOAD'][0])[0] + hostLength = unpack('!B',request['PAYLOAD'][:1])[0] self.targetHost = request['PAYLOAD'][1:hostLength+1] self.targetPort = unpack('>H',request['PAYLOAD'][hostLength+1:])[0] else: