Skip to content

Commit

Permalink
Update socksserver.py
Browse files Browse the repository at this point in the history
Fixes fortra#1575 by parsing the target hostname correctly from commands run through ntlmrelayx's socks5 proxy.
  • Loading branch information
gjhami authored Oct 31, 2024
1 parent 835e175 commit de9d893
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion impacket/examples/ntlmrelayx/servers/socksserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit de9d893

Please sign in to comment.