Skip to main content

Active Directory Certificate Services (ADCS)

Status: Scaffold — content in progress

Active Directory Certificate Services (ADCS) is Microsoft's PKI implementation for enterprises. It issues certificates used for authentication (Kerberos PKINIT), code signing, email encryption, and TLS. ADCS misconfiguration is a major privilege escalation surface, documented by SpecterOps in the "Certified Pre-Owned" research (2021).

Architecture

Root CA (offline recommended)
└── Issuing CA (enterprise CA, domain-joined)
└── Certificate Templates (define what can be issued and to whom)
└── Issued Certificates

Enterprise CA is domain-integrated: publishes templates to AD, issues certs that AD trusts for authentication.

Certificate Templates

A template defines:

  • Who can enroll: security group permissions (Certificate-Enrollment right)
  • What they get: subject alternative names (SANs), key usage, EKU
  • Authentication: does the certificate support client auth? Smart card logon?

ESC Vulnerability Classes (SpecterOps)

ESCVulnerabilityRequirementImpact
ESC1Template allows low-priv user enrollment + SAN in request + Client Auth EKUEnroll permissionRequest cert for any user (Domain Admin)
ESC2Template allows Any Purpose or no EKUEnroll permissionAbuse certificate for auth
ESC3Enrollment Agent template misconfigurationEnroll as enrollment agentEnroll on behalf of any user
ESC4Vulnerable template ACL (WriteDACL/Owner)Write access to templateModify template to ESC1
ESC6EDITF_ATTRIBUTESUBJECTALTNAME2 CA flagEnroll permissionSAN override on any template
ESC7CA ACL — ManageCA/ManageCertificatesCA admin roleApprove requests, modify flags
ESC8AD CS HTTP enrollment (NTLM relay to /certsrv/)Network positionRelay NTLM auth to get certificate

Certificate-Based Authentication

Once an attacker has a valid certificate for a privileged account:

  1. Request a Kerberos TGT using PKINIT (Rubeus asktgt /certificate:...)
  2. The TGT includes the account's NTLM hash (via PKCA — Pass the Certificate)
  3. Use the TGT for Pass-the-Ticket or extract the hash

This provides persistent authentication that survives password resets (the certificate remains valid until expiry).

Telemetry

Event IDLocationDescription
4886CACertificate requested
4887CACertificate issued
4888CACertificate denied
4768DCKerberos TGT request via PKINIT (shows certificate auth)
TopicLink
PKI Overviewpki-overview
ESC1 Template Abuseesc1-template-abuse
Certificate Theftcertificate-theft
ADCS Detectiondetect-certificate-attacks