AD CS (Active Directory Certificate Services)
Default Ports: 80/443, 135, 445, 389/636, 88
Active Directory Certificate Services (AD CS) issues certificates in Windows domains. In pentests, AD CS misconfigurations can allow certificate-based privilege escalation, account impersonation, NTLM relay, and long-lived domain persistence.
Connect
Using Certipy
Certipy is the main AD CS enumeration and abuse tool.
certipy find -u user@domain.local -p 'Password123' -dc-ip 10.0.0.10
certipy find -u user@domain.local -p 'Password123' -dc-ip 10.0.0.10 -text -json -csv -output adcs
certipy find -u user@domain.local -p 'Password123' -dc-ip 10.0.0.10 -vulnerable
Using LDAP
AD CS objects live in the Configuration naming context.
ldapsearch -x -H ldap://dc.domain.local -D 'DOMAIN\user' -w 'Password123' \
-b 'CN=Enrollment Services,CN=Public Key Services,CN=Services,CN=Configuration,DC=domain,DC=local' \
'(objectClass=pKIEnrollmentService)'
ldapsearch -x -H ldap://dc.domain.local -D 'DOMAIN\user' -w 'Password123' \
-b 'CN=Certificate Templates,CN=Public Key Services,CN=Services,CN=Configuration,DC=domain,DC=local' \
'(objectClass=pKICertificateTemplate)'
Using Windows Tools
Native tools validate CA and template visibility from a Windows host.
certutil -config - -ping
certutil -config "CAHOST\CA-NAME" -getconfig
certutil -template
certreq -submit -config "CAHOST\CA-NAME" request.inf
Web Enrollment
Web Enrollment is important for relay and legacy enrollment testing.
curl -I http://ca.domain.local/certsrv/
curl -I https://ca.domain.local/certsrv/
curl -I http://ca.domain.local/certsrv/certfnsh.asp
curl -I http://ca.domain.local/certsrv/mscep/mscep.dll
curl -I http://ca.domain.local/certsrv/mscep_admin/
Recon
Service Detection with Nmap
Scan CA hosts for web, RPC, LDAP, SMB, and Kerberos exposure.
nmap -p 80,443,88,135,139,389,445,464,593,636,3268,3269 -sV ca.domain.local
nmap -p 80,443 --script http-title,http-headers,http-auth ca.domain.local
nmap -p 135 --script msrpc-enum ca.domain.local
nmap -p 389 --script ldap-rootdse dc.domain.local
CA Discovery
The first goal is to identify Enterprise CAs trusted by the domain.
certipy find -u user@domain.local -p 'Password123' -dc-ip 10.0.0.10 -text -output adcs
grep -Ei 'CA Name|DNS Name|Certificate Subject|Web Enrollment|User Specified SAN' adcs.txt