Abusing Active Directory Certificate Services with Certipy: From Initial Access to Beyond Root
Introduction
When password attacks fail or are noisy, Active Directory Certificate Services (AD CS) often provides a quieter and more elegant road to domain compromise.
Certificates are trusted implicitly. That trust is exactly what makes AD CS such a powerful and frequently overlooked attack surface.
Using the same vulnerable lab and baseline exploitation notes provided earlier :contentReference[oaicite:0]{index=0}, this post focuses on:
- Enumerating AD CS safely
- Exploiting misconfigured certificate templates with Certipy
- Escalating to Domain Admin without cracking passwords
- Performing post–Domain Admin recon (Beyond Root)
This is the attack path defenders almost never monitor.
Understanding the AD CS Attack Surface
If AD CS is installed, the domain now trusts:
- Certificate templates
- Enrollment permissions
- Subject name controls
- Authentication EKUs
Any misconfiguration here can bypass password controls entirely.
Before attacking, we enumerate.
Additional Reconnaissance: AD CS Discovery
Detecting Certificate Services
From a compromised domain user context:
|
|
This identifies:
- Enterprise Certificate Authorities
- Enabled certificate templates
- Enrollment permissions
- Dangerous flags (ESC1–ESC8 conditions)
Key indicators to watch for:
ENROLLEE_SUPPLIES_SUBJECTClient Authentication- Low-privileged enrollment rights
- No manager approval required
If you see these together, the domain is already bleeding.
Deep Enumeration with Certipy
Enumerate all vulnerable templates explicitly:
|
|
Example vulnerable template characteristics:
- Authenticated Users can enroll
- Client Authentication enabled
- Subject Alternative Name allowed
- No approval or signature required
This is a textbook ESC1 scenario.
Exploitation: Requesting a Malicious Certificate
If the template allows subject override, we request a certificate as another user.
Target: Administrator
|
|
Output:
- A valid
.pfxcertificate - Issued by the trusted domain CA
- Fully accepted by Kerberos
No password guessing. No alerts.
Certificate-Based Domain Admin Access
Authenticate using the certificate:
|
|
Result:
- Kerberos TGT for
Administrator - NT hash retrieved
- Full Domain Admin identity assumed
At this point, passwords are irrelevant.
Domain Takeover via Certificates
With Domain Admin access established:
|
|
This dumps:
- NTDS hashes
- Kerberos keys
- Service account secrets
This attack path bypasses every password control in the domain.
Additional Enumeration After Compromise
Once Domain Admin is achieved, attackers shift from access to control.
AD CS Persistence
Enumerate CA configuration:
|
|
Attackers may:
- Backdoor certificate templates
- Grant hidden enrollment rights
- Create long-lived persistence certificates
Beyond Root: Post-Domain-Compromise Recon
“Root” is not the end in enterprise environments. It is the beginning.
Trust and Forest Recon
|
|
Look for:
- One-way trusts
- External forests
- Legacy domains
Certificates often work across trusts.
Kerberos Persistence (Golden Certificates)
Dump CA private keys:
|
|
With CA keys:
- Certificates can be forged indefinitely
- Domain rebuilds may still be bypassed
- Trust is permanently broken
This is worse than Golden Tickets.
Privileged Access Path Mapping
Enumerate dangerous groups:
|
|
These groups control forest-wide security.
Delegation and Lateral Expansion
|
|
Unconstrained delegation combined with certificate auth enables silent lateral movement.
Why AD CS Attacks Are So Effective
- Certificates are trusted by design
- Logging is minimal and fragmented
- MFA rarely protects certificate auth
- Many blue teams do not monitor templates
Attackers do not break crypto. They abuse trust.
Defensive Takeaways
- Audit AD CS templates aggressively
- Remove subject name override unless absolutely required
- Restrict enrollment to minimal roles
- Monitor certificate issuance logs
- Treat CA private keys as Tier 0 assets
- Assume certificate persistence is possible after compromise
Conclusion
AD CS turns identity into infrastructure. Infrastructure, once compromised, does not heal easily.
If passwords are doors, certificates are master keys — and too many domains leave them hanging on the wall.
This lab proves a simple truth: If you defend Active Directory but ignore certificates, you are defending half a system.