GhostPack / Rubeus

Trying to tame the three-headed dog.
Other
4.11k stars 778 forks source link

Can't request TGT for username containing unicode characters #114

Closed VbScrub closed 2 years ago

VbScrub commented 2 years ago

If you request a TGT for a username with anything other than ASCII characters in it (like the french character é in my example below) then Rubeus crashes with this error:

Rubeus.exe asktgt /domain:kerb.local /user:éé /password:passw0rd
...

[*] Building AS-REQ (w/ preauth) for: 'kerb.local\éé'

[!] Unhandled Rubeus exception:

Asn1.AsnException: unexpected character U+00E9 in string of type 22
   at Asn1.AsnElt.VerifyChars(Char[] tc, Int32 type)
   at Asn1.AsnElt.MakeString(Int32 type, String str)
   at Rubeus.PrincipalName.Encode()
   at Rubeus.KDCReqBody.Encode()
   at Rubeus.AS_REQ.Encode()
   at Rubeus.Ask.InnerTGT(AS_REQ asReq, KERB_ETYPE etype, ...

I've made a simple fix for this for my GUI fork so will create a PR here for it shortly