Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1a24e0c
commit 8549a3b
Showing
6 changed files
with
69 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using Asn1; | ||
|
||
namespace Rubeus | ||
{ | ||
/* PA-PAC-OPTIONS ::= SEQUENCE { | ||
KerberosFlags | ||
-- Claims(0) | ||
-- Branch Aware(1) | ||
-- Forward to Full DC(2) | ||
-- Resource-based Constrained Delegation (3) | ||
} | ||
*/ | ||
|
||
public class PA_PAC_OPTIONS | ||
{ | ||
public byte[] kerberosFlags { get; set; } | ||
public PA_PAC_OPTIONS(bool claims, bool branch, bool fullDC, bool rbcd) | ||
{ | ||
kerberosFlags = new byte[4] { 0, 0, 0, 0 }; | ||
if (claims) kerberosFlags[0] = (byte)(kerberosFlags[0] | 8); | ||
if (branch) kerberosFlags[0] = (byte)(kerberosFlags[0] | 4); | ||
if (fullDC) kerberosFlags[0] = (byte)(kerberosFlags[0] | 2); | ||
if (rbcd) kerberosFlags[0] = (byte)(kerberosFlags[0] | 1); | ||
kerberosFlags[0] = (byte)(kerberosFlags[0] * 0x10); | ||
} | ||
|
||
public AsnElt Encode() | ||
{ | ||
List<AsnElt> allNodes = new List<AsnElt>(); | ||
AsnElt kerberosFlagsAsn = AsnElt.MakeBitString(kerberosFlags); | ||
kerberosFlagsAsn = AsnElt.MakeImplicit(AsnElt.UNIVERSAL, AsnElt.BIT_STRING, kerberosFlagsAsn); | ||
AsnElt parent = AsnElt.MakeExplicit(0, kerberosFlagsAsn); | ||
allNodes.Add(parent); | ||
AsnElt seq = AsnElt.Make(AsnElt.SEQUENCE, allNodes.ToArray()); | ||
return seq; | ||
} | ||
} | ||
} |