ESC1
Description
ESC1 is a privilege escalation vulnerability in certificate templates that allows any user with enrollment rights to supply a subjectAltName (SAN) for any other user or machine in Active Directory in the environment from the Certificate Authority (CA) , this allows the requesting user to receive a certificate for the targeted user and in turn, authenticate as them with the received certificate.
Requirements for attack path
ENROLLEE_SUPPLIES_SUBJECT flag in the certificate template
Enrollment rights granted to a user or group for which we have access to
Manager approval not enabled
Authorized signature are not required
Linux
Enumeration
certipy find -u 'Moe@Security.local' -p 'Password123' -dc-ip 10.10.10.100 -vulnerable -stdout
Performing the attack
Windows
Enumeration

Performing the attack
Reuqest a certificate for the template vulnerable to ESC1 and specify a SAN for the user we wish to compromise (/altname:).
For accuracy and to avoid certificate mismatch issues we should always aim to provide the /sid parameter which should be the value of the UPN we are targeting (administrator@security.local in the example below).
Take the private key and certificate output and place them into seperate files.
Then merge them together with certutil to create a .pfx file.
Use the converted certificate file with Rubeus to either request a NTLM hash or a Kerberos TGT.
Mitigations
Remove the ENROLLEE_SUPPLIES_SUBJECT flag from the certificate
Require manager aprovals on the certificate
Require authorized signatures
Remove weak enrollement permissions from the template
Last updated