EDITF_ATTRIBUTESUBJECTALTNAME2 setting has been enabled on a CA, any certificate request will allow the requester to submit an arbitrary Subject Alternative Name (SAN) request attribute.
Essentially, this enables the
Enrollee Supplies Subject setting from ESC1 on every certificate template published by the CA.Strong Certificate Mapping Considerations
However, with the introduction of Strong Certificate Mapping, ESC6 is no longer enough to perform privilege escalation in a patched environment. This is because:Strong Certificate Mapping Limitations
Strong Certificate Mapping Limitations
- The CA embeds a SID security extension matching the SID of the requesting user
- The SAN specified with this vulnerability involves a special request attribute rather than allowing the requesting user to specify the subject details directly
- Since the requesting user has no control over the rest of the subject details, it is unable to supply an arbitrary SID security extension
Detection
We can search for certificate authorities with these vulnerabilities using theenum-cas --filter-vulnerable command from Certify. For more information about the command and its parameters, please refer to the Command Overview page.
Exploitation
If we can also identify a certificate template that is vulnerable to ESC9 or identify ESC16 on the same certificate authority, we can request any certificate from the CA and include a Subject Alternative Name (SAN) for a target user that we want to impersonate (e.g.Administrator).
This can be done using the request command from Certify. The SAN can be in either of the formats:
UserPrincipalName(--upn)DnsName(--dns)Rfc822Name(--email)
The security identifier (SID) of the target user must also be supplied with the
--sid-url parameter, which is automatically turned into a URL-based SAN string as previously described.asktgt command by setting the /certificate: parameter to the output certificate.
/ptt parameter was supplied to Rubeus when requesting the TGT, the ticket has been injected into the Kerberos ticket list, and we should be able to authenticate as the target user and access systems that the target user has access to.