Certificate Request Agent (1.3.6.1.4.1.311.20.2.1) EKU, the certificate can be used to sign certificate requests “on-behalf-of” other users.
The abuse scenario is a two-step process:
- Request and obtain a
Certificate Request Agent(Enrollment Agent) certificate. - Use the
Enrollment Agentcertificate to request certificates on behalf of other users.
The ‘Enrollment Agent’ Certificate
The following criteria comprise an ESC3 vulnerability:ESC3 Vulnerability Criteria
ESC3 Vulnerability Criteria
- The enterprise CA grants enrollment rights to the attacker-controlled user.
- Otherwise, the user would be unable to request any certificates from the CA.
- The certificate template grants enrollment rights to the attacker-controlled user.
- Otherwise, the user would be unable to request certificates based on the specific template.
- The “manager approval” feature is disabled for the certificate template.
- Otherwise, a “CA Manager” would have to manually review and approve the certificate request.
- The “authorized signature” feature is disabled for the certificate template.
- Otherwise, an enrollment agent would need to sign the certificate request on behalf of the requester.
- The certificate template defines the
Certificate Request Agent(1.3.6.1.4.1.311.20.2.1) Extended Key Usage (EKU).
enum-templates --filter-vulnerable command from Certify. For more information about the command and its parameters, please refer to the Command Overview page.
request command from Certify.
When the certificate has been issued, it is printed to the console in a base64-encoded format. This will be used in the next step.
The ‘On-Behalf-Of’ Certificate
The following criteria comprise an “on-behalf-of” enrollable template:On-Behalf-Of Template Criteria
On-Behalf-Of Template Criteria
- The enterprise CA does not implement enrollment agent restrictions.
- Otherwise, the attacker-controlled user most likely cannot act as an enrollment agent.
- The enterprise CA grants enrollment rights to the attacker-controlled user.
- Otherwise, the user would be unable to request any certificates from the CA.
- The certificate template grants enrollment rights to the attacker-controlled user.
- Otherwise, the user would be unable to request certificates based on the specific template.
- The “manager approval” feature is disabled for the certificate template.
- Otherwise, a “CA Manager” would have to manually review and approve the certificate request.
- The certificate template adheres to one of the following conditions depending on its schema version.
- It has schema version 1 (which has no concept of issuance requirements / authorized signatures).
- It has schema version 2 (or above) and a
Required Application Policymatching the EKU of the enrollment agent.
- The certificate template defines an Extended Key Usage (EKU) that enables client authentication.
Client Authentication(1.3.6.1.5.5.7.3.2)PKINIT Client Authentication(1.3.6.1.5.2.3.4)Smart Card Logon(1.3.6.1.4.1.311.20.2.2)Any Purpose(2.5.29.37.0)Subordinate CA(No EKUs)
enum-templates --filter-request-agent command from Certify. For more information about the command and its parameters, please refer to the Command Overview page.
Administrator). This can be done using the request-agent command from Certify.
asktgt](/GhostPack/Rubeus-mdx/commands/ticket-requests/asktgt#authentication-methods) 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.