DPERSIST1 is a technique used to extend one-time privileged access to a CA server into unrestricted privileged access across the entire environment. Specifically, once privileged access has been obtained on a CA server, it is possible to extract the CA signing certificate and associated private key, and use these to sign self-made certificates for arbitrary identities and purposes in the environment, thereby making these self-made certificates trusted for authentication in the Active Directory domain. Effectively, this technique can be used for unrestricted persistence in the domain, as it allows the adversary to forge certificates for arbitrary users and purposes. However, if the CA server is not being treated as a Tier 0 asset, and server admins equivalent to Tier 1 has administrative privileges on the server, this technique can be used for privilege escalation.Documentation Index
Fetch the complete documentation index at: https://docs.specterops.io/llms.txt
Use this file to discover all available pages before exploring further.
Obtaining the CA Signing Certificate
In order to execute DPERSIST1, we must first obtain the CA signing certificate. This can be done in a plethora of ways:CA Backup Feature
CA Backup Feature
- Open
certsrv.msc - Right click the CA ->
All Tasks->Back up CA... - Follow the wizard but make sure to check
Private key and CA certificate - The certificate should now exist at the chosen location (
CA-NAME.p12)
CA Server's Machine Certificate Store
CA Server's Machine Certificate Store
- Open
certlm.msc - Go to
Personal->Certificates - Right click the CA signing certificate ->
All Tasks->Export... - Follow the wizard but make sure to choose
Yes, export the private key - The certificate should not exist at the chosen location (
CA-NAME.pfx)
Windows Certificate Services certutil.exe
Windows Certificate Services certutil.exe
This feature has been implemented in Certify with the
manage-self --dump-certs command.Dumping Certificates with Certify
Forging Certificates
Once the CA signing certificate has been obtained, we can start forging our own certificates for arbitrary users. This can be done using theforge --ca-cert <pfx-path/base64-pfx> command from Certify.
Using the Forged Certificate
When the certificate has been forged, it can be used to persistently authenticate as the target account using theasktgt command from Rubeus.