From DA to EA with ESC5
A Domain Admin in a child domain can abuse full control of the Public Key Services container in the domain-local Configuration naming context to add a malicious certificate template and publish it to a CA, then use ESC1 to obtain a certificate for an Enterprise Admin and escalate to forest root. The attack relies on changes to the child domain's copy of the forest Configuration naming context replicating up to the forest root.
Published on posts.specterops.io
You’ve heard of ESC1 and ESC8. But what about ESC5?
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the Configuration naming context allows writable copies in child domains that replicate up to the forest root, and the SYSTEM account on child domain controllers has full control over PKI objects, enabling privilege escalation.
Impact
An attacker with Domain Admin in a child domain could escalate to Enterprise Admin at the forest root, gaining full control of the forest.
What the attacker needed
Domain Admin in a child domain; SYSTEM access on a child domain controller; ADCS deployed with a CA trusted for authentication
How it was found
- Use PsExec to launch MMC as SYSTEM on the child domain controller.
- Connect to the domain-local Configuration naming context and navigate to the Public Key Services container.
- Add an ACE giving a controlled user full control of the Public Key Services container.
- Use certsrv.msc as SYSTEM to duplicate an existing certificate template and configure it for ESC1.
- Publish the new template to the CA by adding it to the certificateTemplates property of the pKIEnrollmentService object.
- Use Certify to request a certificate for the Enterprise Admin using the malicious template, then convert to PFX and use Rubeus to get a TGT.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
In Active Directory, a child domain trusts its parent forest root. The Configuration naming context holds forest-wide settings, and each domain has a writable copy that replicates upward. If an attacker controls a container in the child's copy, they can add a fake certificate template that the parent CA trusts, then request a certificate as a high-privilege user.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.