Skip to content

Commit

Permalink
Update getST.py
Browse files Browse the repository at this point in the history
impacket #1650: Fixes encoding unicode errors while performing S4U
  • Loading branch information
alexisbalbachan committed Aug 22, 2024
1 parent b6713d2 commit 44ff3b2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/getST.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
import struct
import sys
from binascii import hexlify, unhexlify
from six import b
from six import ensure_binary

from pyasn1.codec.der import decoder, encoder
from pyasn1.type.univ import noValue
Expand Down Expand Up @@ -414,7 +414,7 @@ def doS4U(self, tgt, cipher, oldSessionKey, sessionKey, nthash, aesKey, kdcHost)
clientName = Principal(self.__options.impersonate, type=constants.PrincipalNameType.NT_PRINCIPAL.value)

S4UByteArray = struct.pack('<I', constants.PrincipalNameType.NT_PRINCIPAL.value)
S4UByteArray += b(self.__options.impersonate) + b(self.__domain) + b'Kerberos'
S4UByteArray += ensure_binary(self.__options.impersonate) + ensure_binary(self.__domain) + b'Kerberos'

if logging.getLogger().level == logging.DEBUG:
logging.debug('S4UByteArray')
Expand Down

0 comments on commit 44ff3b2

Please sign in to comment.