AD CS: weaponizing the ESC7 attack
A certificate authority (CA) in Active Directory Certificate Services granted the ManageCA and ManageCertificates rights to all authenticated users, allowing any domain user to enable the SAN extension for all templates and approve their own pending certificate requests. An attacker could then request a certificate impersonating a Domain Admin, though in the tested environment the resulting certificate could not be used to obtain a Kerberos ticket because the domain controllers lacked valid certificates.
blackarrow.net
Published on blackarrow.net
Last year, SpecterOps published an in-depth research about the security state in Active Directory Certificate Services (AD CS) that is still a common topic of debate around the community. The technical paper, layouts different attacks around misconfigurationsin these services that can lead to privilege escalation or…
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
The CA's access control list granted the ManageCA and ManageCertificates rights to the Authenticated Users group, letting any domain user change CA settings and approve certificate requests.
Impact
The attacker could obtain a valid certificate linked to a Domain Admin, but in the tested environment the certificate could not be used to request a Kerberos ticket because the domain controllers lacked valid certificates for authentication.
What the attacker needed
Any domain account (Authenticated Users); ManageCA and ManageCertificates rights on the CA; A template allowing user authentication and enrollment by…
The fix
The CA's ACL should be changed so that only appropriate administrative accounts have ManageCA and ManageCertificates rights, and the CA should not force approval for all templates unless intended.
How it was found
- Detect CAs that allow low privileged users the ManageCA permission.
- Change the CA settings to enable the SAN extension for all templates under the vulnerable CA.
- Request a certificate with the desired SAN.
- If the certificate requires approval, approve it yourself with the ManageCertificates permission and download it.
- As an alternative, disable the approval requirement for all the CA's templates beforehand and request a new certificate.
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.
Active Directory Certificate Services (AD CS) is a system that issues digital certificates, which can be used to prove identity. If ordinary users can change the CA's settings, they can make it issue a certificate for any user, including an administrator, and then log in as that administrator. This report shows how that misconfiguration was exploited in a real engagement.
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.