How the attack works
A machine certificate issued by Active Directory Certificate Services identifies the computer by the DNS name stored in the dNSHostName attribute of its account. That attribute is not fixed. An account that controls a computer object, for example the account that created it, has been able to change the value. Before the May 10, 2022 updates, a domain controller matched a certificate to an account by the name the certificate carried. A computer account whose dNSHostName had been set to the name of a domain controller could therefore obtain a certificate that signed in as that domain controller. Microsoft fixed this as CVE-2022-26923.
Since those updates, Microsoft enterprise CAs write the SID of the requesting account into the certificate and domain controllers check it, so the borrowed name alone is no longer enough (see Certificate Authentication With a Weak or Mismatched Mapping). The change of the attribute remains worth watching. It is the first step of the attack, it still works against a CA or domain controller that is missing the updates, and nobody has a routine reason to give one computer the DNS name of another.
The domain controller logs the change as event 4742 (a computer account was changed). The DNS Host Name field holds the new value, or - when the attribute was not touched, and the Subject fields name who made the change. Computers update their own account, so a subject that is itself a computer account is normal. A change made by a user account is the one to review.
What an attacker needs
- Control of a computer account. By default any domain user can create one through the machine account quota; write access to an existing computer object also works.
- A certificate template that computers can enroll in and that allows sign-in.
- A certification authority or domain controller without the May 10, 2022 updates, or another sign-in path that still maps certificates by name.
Impact
A certificate that authenticates as a domain controller. With a domain controller's identity the attacker can request directory replication and take every password hash in the domain. On fully updated systems the certificate carries the real account's SID and the sign-in as the domain controller is refused.
Detection rules
Computer DNS Host Name Changed by an Account That Is Not a Computer
Detects a computer account change (4742) in which the DNS Host Name field holds a new value and the account that made the change is not a computer account. The field is "-" when the dNSHostName attribute was not changed. Computers maintain their own DNS host name, so a change by a user account is either a join or rename done with that account, or someone giving a computer account the DNS name of another machine, which is the first step of CVE-2022-26923. The event does not say whether the new name belongs to another computer; compare the new value with TargetUserName. Requires Audit Computer Account Management.
title: Computer DNS Host Name Changed by an Account That Is Not a Computer
id: bbb39086-0cc3-47a6-9a97-34adfb414430
status: experimental
description: >-
Detects a computer account change (4742) in which the DNS Host Name field
holds a new value and the account that made the change is not a computer
account. The field is "-" when the dNSHostName attribute was not changed.
Computers maintain their own DNS host name, so a change by a user account is
either a join or rename done with that account, or someone giving a computer
account the DNS name of another machine, which is the first step of
CVE-2022-26923. The event does not say whether the new name belongs to
another computer; compare the new value with TargetUserName. Requires Audit
Computer Account Management.
references:
- https://attack.mitre.org/techniques/T1068/
- https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4742
- https://learn.microsoft.com/en-us/defender-for-identity/alerts-mdi-classic
author: Forestall
date: 2026-11-14
tags:
- attack.privilege-escalation
- attack.t1068
logsource:
product: windows
service: security
detection:
selection:
EventID: 4742
filter_not_changed:
DnsHostName: '-'
filter_changed_by_computer:
SubjectUserName|endswith: '$'
condition: selection and not 1 of filter_*
falsepositives:
- Domain joins, renames and re-imaging done with a user, helpdesk or deployment account, which set the DNS host name of the computer they join. The new value then matches the computer's own name. Exclude the provisioning accounts by SubjectUserName.
level: medium
False positives
- Domain joins, renames and re-imaging done with a user, helpdesk or deployment account, which set the DNS host name of the computer they join. The new value then matches the computer's own name. Exclude the provisioning accounts by SubjectUserName.
Triage
- Compare the new DNS Host Name value with TargetUserName. The host part should be the computer's own name. A value that names another computer, above all a domain controller, is the attack.
- Identify SubjectUserName. A provisioning or helpdesk account that joins and renames computers explains the event; an ordinary user who created the computer account shortly before (event 4741) does not.
- Look on the CA for certificate requests by that computer account after the change (events 4886 and 4887), and on domain controllers for ticket requests with a certificate (event 4768 with the certificate fields filled) for a domain controller account from an unusual address.
- If the change is not explained, restore the attribute, disable the computer account, revoke any certificate it obtained and investigate the account that made the change.
Response
Once the attack is confirmed:
- Disable the computer account and the user account that changed it, together with any other computer accounts the same user created (event 4741).
- Check the certificate the computer account obtained. If the CA and the domain controllers had the May 10, 2022 updates, it carries the SID of the real account and the sign-in as a domain controller was refused. If either was missing the updates, assume that the sign-in worked.
- Where a sign-in as a domain controller succeeded, respond as for DCSync. The identity of a domain controller allows replication of every password hash in the domain.
- Install the missing updates on the certification authority or domain controller that made the attack possible, and confirm that domain controllers enforce strong certificate mapping.
- Verify that no computer account other than a domain controller carries the name of a domain controller in
dNSHostName.
Mitigation
- Keep certification authorities and domain controllers on current updates, with domain controllers enforcing strong certificate mapping (KB5014754).
- Set
ms-DS-MachineAccountQuotato 0 and delegate computer creation to a provisioning group, so that ordinary users do not own computer accounts. - Review who has write access to computer objects and remove what is not needed.
- Do not turn off the SID extension on certificate templates that computers use to sign in.
Frequently asked questions
Does the attack still work on fully updated domain controllers and CAs?
The attribute can still be changed, but the sign-in fails. Since the May 10, 2022 updates, Microsoft enterprise CAs write the SID of the requesting account into the certificate and domain controllers check it. The change still matters as the first step of the attack, and it works against a CA or domain controller that is missing the updates or where certificates are still mapped by name.
Does the event show that the new name belongs to a domain controller?
No. Event 4742 only gives the new DNS Host Name value. The rule fires on any change made by an account that is not a computer, including ordinary joins and renames. Compare the host part of the new value with TargetUserName and with the names of your domain controllers to see whether the account borrowed the name of another machine.
Why does the rule ignore changes made by computer accounts?
Computers maintain the DNS host name of their own account, so a subject that is a computer account is normal and is filtered out. The cost is a blind spot. A change made while signed in with a computer account, including the account that is being changed, is not detected by this rule.
References
- MITRE ATT&CK T1068: Exploitation for Privilege Escalation
- Event 4742: A computer account was changed
- KB5014754: Certificate-based authentication changes on Windows domain controllers
- Defender for Identity classic alerts: Suspicious modification of a dNSHostName attribute (CVE-2022-26923)
- Microsoft Security Response Center: CVE-2022-26923