While there isn’t anything necessarily inherently insecure about AD CS (except for ESC8 as detailed below), it is surprisingly easy to misconfigure its various elements, resulting in ways for unelevated users to escalate in the domain.
Personnally I have mainly encountered ESC1 and ESC4 abuses. I will try to update this articles as times passes or get time for Lab checks and evidence searching.
|name of Attack
|Domain escalation via No Issuance Requirements + Enrollable Client Authentication/Smart Card Logon OID templates + CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT
|Domain escalation via No Issuance Requirements + Enrollable Any Purpose EKU or no EKU
|Domain escalation via No Issuance Requirements + Certificate Request Agent EKU + no enrollment agent restrictions
|Domain escalation via misconfigured certificate template access control
|Domain escalation via vulnerable PKI AD Object Access Control
|Domain escalation via the EDITF_ATTRIBUTESUBJECTALTNAME2 setting on CAs + No Manager Approval + Enrollable Client Authentication/Smart Card Logon OID templates 6
|Vulnerable Certificate Authority Access Control ESC8 NTLM Relay to AD CS HTTP Endpoints
Links to resources of interest:
- SpecterOps Certified_Pre_Owned page which includes the list of conditions to be met for each attack
- SpecterOps Certified_Pre_Owned full paper
- PowerShell toolkit for auditing ADCS
List of tools used (non exaustive)
- Certify (C#)
- InvokeCertify (Powershell)
- CertiPy (Python)
- CME + Masky Module
Check in the PKI the certs delivered (you can find the Requester Name and the Certificate Template Name and it’s SN)
If no access to the ADCS interface to see the certs, you can copy the EDB file from C:\Windows\System32\CertLog\CA_NAME.edb
And use ESEDatabaseView from NirSoft to read it.
In the RequestAttributes you can easily find the compromises of SAN
ESC1 attack evidences
For ESC1 (most common abuse, as tools implement from user -> DA elevation)
Check the certificate SAN field
Then you can check 4624 Security Events with schannel as type.
And also 4768 Security Events (get Kerberos ticket from Cert Authentication)
Note : With PKINIT one can retrieve the NTLM Hash from the Cert Authentication
Detail how the vulnerability can be temporariliy mitigated during IR
Disable the vulnerable templates
Revoke all compromised/(all if uncertain) certs0