permalink: spells/enumerate-ad-cs-templates-with-certutil
tags:
- HowTo
- Application/CertUtil
- OS/Windows/ActiveDirectory
- AttackCycle/Reconnaissance
- Protocol/Kerberos
- Application/RubeusAD CS is AD's PKI, and is used on the back end for everything from provisioning disk encryption keys to user authentication. Certificate templates are a way to automate the certificate request process: Rather than an admin approving all CSRs manually, AD CS checks to see if a relevant "template" (which is really a template + associated settings + an access policy) exists that matches the supplied CSR and is configured to allow the requesting user to generate a certificate.
Enumerate all certificate templates from a domain-joined computer and domain-authenticated user:
certutil -v -template
Allow Enroll or Allow Full Control permission that has been assigned to a group or user you have access to.CT_FLAG_ENROLLEE_SUPPLIES_SUBJECT) being set to 1.(There are actually some other requirements - like fully automated certificate provisioning - but by default these are all satisfied.)
If a certificate has the above properties, then we can use it to create a certificate in the name of another user and then forge Kerberos tickets for that user with a tool like Rubeus.