Skip to content

Commit

Permalink
Merge pull request GhostPack#177 from GhostPack/fix-domain
Browse files Browse the repository at this point in the history
fix unicode domain encoding
  • Loading branch information
0xe7 authored Nov 28, 2023
2 parents 1353dff + 558c4ef commit 0e57072
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Rubeus/lib/S4U.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ private static void S4U2Proxy(KRB_CRED kirbi, string targetUser, string targetSP
AsnElt req_Body_ASNSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { req_Body_ASN });
req_Body_ASNSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 4, req_Body_ASNSeq);
byte[] req_Body_Bytes = req_Body_ASNSeq.CopyValue();
cksum_Bytes = Crypto.KerberosChecksum(clientKey, req_Body_Bytes, Interop.KERB_CHECKSUM_ALGORITHM.KERB_CHECKSUM_RSA_MD5);
cksum_Bytes = Crypto.KerberosChecksum(clientKey, req_Body_Bytes, Interop.KERB_CHECKSUM_ALGORITHM.KERB_CHECKSUM_RSA_MD5, Interop.KRB_KEY_USAGE_TGS_REQ_CHECKSUM);
}

// moved to end so we can have the checksum in the authenticator
Expand Down
2 changes: 1 addition & 1 deletion Rubeus/lib/krb_structures/Authenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public AsnElt Encode()


// crealm [1] Realm
AsnElt realmAsn = AsnElt.MakeString(AsnElt.IA5String, crealm);
AsnElt realmAsn = AsnElt.MakeString(AsnElt.UTF8String, crealm);
realmAsn = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.GeneralString, realmAsn);
AsnElt realmSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { realmAsn });
realmSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, realmSeq);
Expand Down
2 changes: 1 addition & 1 deletion Rubeus/lib/krb_structures/KDC_REQ_BODY.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public AsnElt Encode()
// realm [2] Realm
// --Server's realm
// -- Also client's in AS-REQ --
AsnElt realmAsn = AsnElt.MakeString(AsnElt.IA5String, realm);
AsnElt realmAsn = AsnElt.MakeString(AsnElt.UTF8String, realm);
realmAsn = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.GeneralString, realmAsn);
AsnElt realmSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { realmAsn });
realmSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 2, realmSeq);
Expand Down
2 changes: 1 addition & 1 deletion Rubeus/lib/krb_structures/PA_FOR_USER.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public AsnElt Encode()
allNodes.Add(userNameAsn);

// userRealm[1] Realm
AsnElt userRealmAsn = AsnElt.MakeString(AsnElt.IA5String, userRealm);
AsnElt userRealmAsn = AsnElt.MakeString(AsnElt.UTF8String, userRealm);
userRealmAsn = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.GeneralString, userRealmAsn);
AsnElt userRealmSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { userRealmAsn });
userRealmSeq = AsnElt.MakeImplicit(AsnElt.CONTEXT, 1, userRealmSeq);
Expand Down

0 comments on commit 0e57072

Please sign in to comment.