AD CS
Last updated
Last updated
Or run PingCastle or Certify
Escalation | Definition |
---|---|
Enrolee can request cert for ANY user | |
ESC2 | Any purpose or no EKU (potentially dangerous) |
Request an enrollement agent certificate and use it to request cert on behalf of ANY user | |
ESC4 | Overly permissive ACLs on templates |
ESC5 | Poor access control on CA server, CA server computer object, etc. |
EDITF_ATTRIBUTESUBJECTNAME2 setting on CA - Request certs for ANY user | |
ESC7 | Poor access control on roles on CA authority like "CA Administrator" and "Certificate Manager" |
NTLM relay to HTTP enrollement endpoints |
If you have admin privilege, the module will impersonate all users connected -> ask a certificate (ADCS) -> retrieve the NT hash using PKINIT
Source: https://x.com/mpgn_x64/status/1584863925744521216
AD CS in the target forest
Templates
Vulnerabel templates
"VulnTemplate" has ENROLLEE_SUPPLIES_SUBJECT value for msPKI-Certificates-Name-Flag
"VulnTemplate" allows enrollment to RDPUsers group.
Request a certificate for DA (or EA) as a user1 (member of RDP group)
Convert cert.pem to pfx and use it to request a TGT for DA (or EA)
Request an enrollement agent certificate and use it to request cert on behalf of ANY user
"VulnTemplateEnrollement-Agent" allows Domain users to enroll and has 'Certificate Request Agent' EKU
"VulnTemplateEnrollement-Users" has an Application Policy Issuance Requirement of Certificate Request Agent and has an EKU that allows for domain authentication
child.parent.local
: child domain
parent.local
: parent domain
Request a certif for Certificate Request Agent from "VulnTemplateEnrollement-Agent" template
Convert cert.pem to pfx and use it to request a cert on behalf on DA using "VulnTemplateEnrollement-Users"
Convert from cert.pem to pfx, request DA TGT and inject it
Request a certif for Certificate Request Agent from "VulnTemplateEnrollement-Agent" template - see Escalation to DA
Convert cert.pem to pfx and use it to request a cert on behalf on EA using "VulnTemplateEnrollement-Users
Request EA TGT and inject it
EDITF_ATTRIBUTESUBJECTNAME2
setting on CA - Request certs for ANY user from a template that allow enrollment to low-priv user
"Vuln-Integration" grants enrollment to RDPUsers group.
Request a certificate for DA (or EA) as a user1 (member of RDP group)
Convert cert.pem to pfx and use it to request a TGT for DA (or EA)
NTLM relay to HTTP enrollement endpoints
Detection: Bloodhound query
Credit: @SpecterOps