EDITF_ATTRIBUTESUBJECTALTNAME2 flag allowing enrollees to specify a Subject Alternate Name (SAN) identifying another principal during certificate enrollment of any published certificate template. Also, the CA has the SID security extension disabled. This setup allows an attacker to obtain a malicious certificate as any AD forest user or computer and use it for authentication and impersonation without knowing their credentials.
Abuse Info
An attacker may perform this attack in the following steps:Windows
1
Request enrollment in the affected template
Use Certify (2.0) to request enrollment in the affected template, specifying the affected enterprise CA and target principal to impersonate:If the enrollment fails with an error message stating that the Email or DNS name is unavailable and cannot be added to the Subject or Subject Alternate name, then it is because the enrollee principal does not have their
mail or dNSHostName attribute set, which is required by the certificate template. The mail attribute can be set on both user and computer objects but the dNSHostName attribute can only be set on computer objects. Computers have validated write permission to their own dNSHostName attribute by default, but neither users nor computers can write to their own mail attribute by default.2
Request a ticket granting ticket
Use Rubeus to request a ticket granting ticket (TGT) from the domain, specifying the target identity to impersonate and the certificate obtained in Step 1:
3
Verify the TGT (optional)
Optionally verify the TGT by listing it with the
klist command:Linux
1
Request enrollment in the affected template
Use Certipy to request enrollment in the affected template, specifying the affected enterprise CA and target principal to impersonate:If the enrollment fails with an error message stating that the Email or DNS name is unavailable and cannot be added to the Subject or Subject Alternate name, then it is because the enrollee principal does not have their
mail or dNSHostName attribute set, which is required by the certificate template. The mail attribute can be set on both user and computer objects but the dNSHostName attribute can only be set on computer objects. Computers have validated write permission to their own dNSHostName attribute by default, but neither users nor computers can write to their own mail attribute by default.2
Request a ticket granting ticket
Request a ticket granting ticket (TGT) from the domain, specifying the certificate created in Step 1 and the IP of a domain controller:If the DC enforces strong certificate mapping, include the target principal’s SID using the
-sid parameter shown above. Use Certipy 5 or later for SAN URL SID mapping support.Opsec Considerations
When the affected certificate authority issues the certificate to the attacker, it will retain a local copy of that certificate in its issued certificates store. Defenders may analyze those issued certificates to identify illegitimately issued certificates and identify the principal that requested the certificate, as well as the target identity the attacker is attempting to impersonate.Edge Schema
Source: User, Group, ComputerDestination: Domain
Traversable: ✅