ESC1
For this technique to work we need a certificate template with the following requirements:
ENROLLEE_SUPPLIES_SUBJECT
attribute enabled: this allows the user that initialized the CSR (certificate request) to specify any SAN (subjectAltName) allowing us to request a certificate as any user in the domainat least one of the following EUK OIDs: Smart Card Logon / PKINIT Authentication / Client Authentication
a user that with enrollment rights
no authorized signatures required
This attack vector can be found with Certipy or Certify
Another useful way to enumerate for it is using Powershell queries, this can prove useful if we don't manage to run Certify because of AVs or EDRs running on the host.
To abuse it we need to request a certificate using the user with enrollment rights over the template and add a SAN with the upn
or altname
flags
The command will get us a administrator.pfx
certificate that we can use to get the admin's NTLM hash. If we're using Certify we will need to convert the given certificate to a usable format by using the openssl
command displayed in the output.
When working in an environment in which the CBA (Certificate-based Authentication) patch is set to Full Enforcement, whenever a user requests a certificate for an alternate user, the SID of the requesting user is checked against the SID present in the one present in the szOID_NTDS_CA_SECURITY_EXT extension: if there is no match this technique cannot be performed. So in fully patched environment, the normal
would not work.
To work around this policy we can use Certipy's built-in sidextension
argument (present in Certipy as well under extensionsid
)
You can see more about how the extension works and its uses here.
Last updated