-
Notifications
You must be signed in to change notification settings - Fork 797
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Delegated Managed Service Account Kerberos Processes (#194)
* Initial Implementation of DMSA Support. This includes KERB-DMSA-KEY-PACKAGE and KERB-SUPERSEDED-BY-USER structures and returning data. * Remove a console output * Help doc updates * Ticket Display Updates so if previous keys are needed they can be added at a later date easily. * Clean up, comments and support child domain fqdns * Update versions * Change output for DMSA Request to include DMSA User and the requesting user (Computer)
- Loading branch information
Showing
15 changed files
with
206 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Asn1; | ||
|
||
namespace Rubeus | ||
{ | ||
public class PA_DMSA_KEY_PACKAGE | ||
{ | ||
// KERB-DMSA-KEY-PACKAGE::= SEQUENCE { | ||
// current-keys[0] SEQUENCE OF EncryptionKey, | ||
// previous-keys[1] SEQUENCE OF EncryptionKey OPTIONAL, | ||
// expiration-interval[2] KerberosTime, | ||
// fetch-interval[4] KerberosTime, | ||
// } | ||
|
||
|
||
public PA_DMSA_KEY_PACKAGE() | ||
{ | ||
currentKeys = new PA_KEY_LIST_REP(); | ||
previousKeys = new PA_KEY_LIST_REP(); | ||
expirationInterval = DateTime.UtcNow; | ||
fetchInterval = DateTime.UtcNow; | ||
} | ||
|
||
public PA_DMSA_KEY_PACKAGE(AsnElt body) | ||
{ | ||
currentKeys = new PA_KEY_LIST_REP(body.Sub[0].Sub[0]); | ||
previousKeys = new PA_KEY_LIST_REP(body.Sub[1].Sub[0]); | ||
expirationInterval = body.Sub[2].Sub[0].GetTime(); | ||
fetchInterval = body.Sub[3].Sub[0].GetTime(); | ||
} | ||
|
||
public AsnElt Encode() | ||
{ | ||
|
||
AsnElt currentKeysAsn = currentKeys.Encode(); | ||
AsnElt currentKeysSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { currentKeysAsn }); | ||
|
||
AsnElt previousKeysAsn = previousKeys.Encode(); | ||
AsnElt previousKeysSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { previousKeysAsn }); | ||
|
||
AsnElt expirationIntervalAsn = AsnElt.MakeTime(AsnElt.GeneralizedTime, expirationInterval); | ||
AsnElt fetchIntervalAsn = AsnElt.MakeTime(AsnElt.GeneralizedTime, fetchInterval); | ||
|
||
|
||
AsnElt dmsaKeyPackageSeq = AsnElt.Make(AsnElt.SEQUENCE, new[] { currentKeysSeq, previousKeysSeq, expirationIntervalAsn, fetchIntervalAsn }); | ||
return dmsaKeyPackageSeq; | ||
} | ||
|
||
public PA_KEY_LIST_REP currentKeys { get; set; } | ||
public PA_KEY_LIST_REP previousKeys { get; set; } | ||
public DateTime expirationInterval { get; set; } | ||
public DateTime fetchInterval { get; set; } | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.