-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from BloodHoundAD/adcs
ADCS initial MR
- Loading branch information
Showing
48 changed files
with
2,079 additions
and
148 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace SharpHoundCommonLib.Enums | ||
{ | ||
// From https://learn.microsoft.com/en-us/windows/win32/seccertenroll/supported-extensions | ||
public static class CAExtensionTypes | ||
{ | ||
public const string AuthorityInformationAccess = "1.3.6.1.5.5.7.1.1"; | ||
public const string AuthorityKeyIdentifier = "2.5.29.35"; | ||
public const string BasicConstraints = "2.5.29.19"; | ||
public const string NameConstraints = "2.5.29.30"; | ||
public const string EnhancedKeyUsage = "2.5.29.37"; | ||
public const string KeyUsage = "2.5.29.15"; | ||
public const string SubjectAlternativeNames = "2.5.29.17"; | ||
public const string SubjectKeyIdentifier = "2.5.29.14"; | ||
} | ||
} |
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,15 @@ | ||
using System; | ||
|
||
namespace SharpHoundCommonLib.Enums | ||
{ | ||
[Flags] | ||
public enum CertificationAuthorityRights | ||
{ | ||
ManageCA = 1, // Administrator | ||
ManageCertificates = 2, // Officer | ||
Auditor = 4, | ||
Operator = 8, | ||
Read = 256, | ||
Enroll = 512 | ||
} | ||
} |
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,13 @@ | ||
namespace SharpHoundCommonLib.Enums | ||
{ | ||
// More can be found here: https://www.pkisolutions.com/object-identifiers-oid-in-pki/ | ||
public static class CommonOids | ||
{ | ||
public static string AnyPurpose = "2.5.29.37.0"; | ||
public static string ClientAuthentication = "1.3.6.1.5.5.7.3.2"; | ||
public static string PKINITClientAuthentication = "1.3.6.1.5.2.3.4"; | ||
public static string SmartcardLogon = "1.3.6.1.4.1.311.20.2.2"; | ||
public static string CertificateRequestAgent = "1.3.6.1.4.1.311.20.2.1"; | ||
public static string CertificateRequestAgentPolicy = "1.3.6.1.4.1.311.20.2.1"; | ||
} | ||
} |
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,13 @@ | ||
namespace SharpHoundCommonLib.Enums | ||
{ | ||
public class DirectoryPaths | ||
{ | ||
public const string EnterpriseCALocation = "CN=Enrollment Services,CN=Public Key Services,CN=Services,CN=Configuration"; | ||
public const string RootCALocation = "CN=Certification Authorities,CN=Public Key Services,CN=Services,CN=Configuration"; | ||
public const string AIACALocation = "CN=AIA,CN=Public Key Services,CN=Services,CN=Configuration"; | ||
public const string CertTemplateLocation = "CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration"; | ||
public const string NTAuthStoreLocation = "CN=NTAuthCertificates,CN=Public Key Services,CN=Services,CN=Configuration"; | ||
public const string PKILocation = "CN=Public Key Services,CN=Services,CN=Configuration"; | ||
public const string ConfigLocation = "CN=Configuration"; | ||
} | ||
} |
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,13 @@ | ||
using System; | ||
|
||
namespace SharpHoundCommonLib.Enums | ||
{ | ||
[Flags] | ||
public enum PKICertificateAuthorityFlags | ||
{ | ||
NO_TEMPLATE_SUPPORT = 0x00000001, | ||
SUPPORTS_NT_AUTHENTICATION = 0x00000002, | ||
CA_SUPPORTS_MANUAL_AUTHENTICATION = 0x00000004, | ||
CA_SERVERTYPE_ADVANCED = 0x00000008 | ||
} | ||
} |
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,25 @@ | ||
using System; | ||
|
||
namespace SharpHoundCommonLib.Enums | ||
{ | ||
[Flags] | ||
public enum PKICertificateNameFlag : uint | ||
{ | ||
ENROLLEE_SUPPLIES_SUBJECT = 0x00000001, | ||
ADD_EMAIL = 0x00000002, | ||
ADD_OBJ_GUID = 0x00000004, | ||
OLD_CERT_SUPPLIES_SUBJECT_AND_ALT_NAME = 0x00000008, | ||
ADD_DIRECTORY_PATH = 0x00000100, | ||
ENROLLEE_SUPPLIES_SUBJECT_ALT_NAME = 0x00010000, | ||
SUBJECT_ALT_REQUIRE_DOMAIN_DNS = 0x00400000, | ||
SUBJECT_ALT_REQUIRE_SPN = 0x00800000, | ||
SUBJECT_ALT_REQUIRE_DIRECTORY_GUID = 0x01000000, | ||
SUBJECT_ALT_REQUIRE_UPN = 0x02000000, | ||
SUBJECT_ALT_REQUIRE_EMAIL = 0x04000000, | ||
SUBJECT_ALT_REQUIRE_DNS = 0x08000000, | ||
SUBJECT_REQUIRE_DNS_AS_CN = 0x10000000, | ||
SUBJECT_REQUIRE_EMAIL = 0x20000000, | ||
SUBJECT_REQUIRE_COMMON_NAME = 0x40000000, | ||
SUBJECT_REQUIRE_DIRECTORY_PATH = 0x80000000 | ||
} | ||
} |
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,32 @@ | ||
using System; | ||
|
||
namespace SharpHoundCommonLib.Enums | ||
{ | ||
// from https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-crtd/ec71fd43-61c2-407b-83c9-b52272dec8a1 | ||
// and from certutil.exe -v -dstemplate | ||
[Flags] | ||
public enum PKIEnrollmentFlag : uint | ||
{ | ||
NONE = 0x00000000, | ||
INCLUDE_SYMMETRIC_ALGORITHMS = 0x00000001, | ||
PEND_ALL_REQUESTS = 0x00000002, | ||
PUBLISH_TO_KRA_CONTAINER = 0x00000004, | ||
PUBLISH_TO_DS = 0x00000008, | ||
AUTO_ENROLLMENT_CHECK_USER_DS_CERTIFICATE = 0x00000010, | ||
AUTO_ENROLLMENT = 0x00000020, | ||
CT_FLAG_DOMAIN_AUTHENTICATION_NOT_REQUIRED = 0x80, | ||
PREVIOUS_APPROVAL_VALIDATE_REENROLLMENT = 0x00000040, | ||
USER_INTERACTION_REQUIRED = 0x00000100, | ||
ADD_TEMPLATE_NAME = 0x200, | ||
REMOVE_INVALID_CERTIFICATE_FROM_PERSONAL_STORE = 0x00000400, | ||
ALLOW_ENROLL_ON_BEHALF_OF = 0x00000800, | ||
ADD_OCSP_NOCHECK = 0x00001000, | ||
ENABLE_KEY_REUSE_ON_NT_TOKEN_KEYSET_STORAGE_FULL = 0x00002000, | ||
NOREVOCATIONINFOINISSUEDCERTS = 0x00004000, | ||
INCLUDE_BASIC_CONSTRAINTS_FOR_EE_CERTS = 0x00008000, | ||
ALLOW_PREVIOUS_APPROVAL_KEYBASEDRENEWAL_VALIDATE_REENROLLMENT = 0x00010000, | ||
ISSUANCE_POLICIES_FROM_REQUEST = 0x00020000, | ||
SKIP_AUTO_RENEWAL = 0x00040000, | ||
NO_SECURITY_EXTENSION = 0x00080000 | ||
} | ||
} |
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.