Windows: Detect Computer Account Rename to Non-Standard Name Missing Trailing '$'
Alerts on Windows 4781 computer account renames where the new name lacks the '$' suffix.
- Product
- windows
- Service
- security
- Author
- Florian Roth (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2021-12-22
- Updated
- 2026-07-31
ATT&CK techniques
Persistence → Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags Security event 4781 where an existing computer account is renamed such that the new account name does not contain a '$' character. Attackers may abuse computer account name spoofing to support stealthy persistence and privilege escalation behaviors associated with SAM account naming misuse. It relies on Windows Security auditing for account rename events and the old/new target account name fields captured in the event telemetry.
Reporting behind it
- medium.comhttps://medium.com/@mvelazco/hunting-for-samaccountname-spoofing-cve-2021-42287-and-domain-controller-impersonation-f704513c8a45
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules-emerging-threats/2021/Exploits/CVE-2021-42287/win_security_samaccountname_spoofing_cve_2021_42287.yml
Changelog
v5- v5Candidate ingested via manual entry.2026-07-31
- v4Candidate ingested via manual entry.2026-07-31
- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Windows: Detect Computer Account Rename to Non-Standard Name Missing Trailing '$'"
id: 3ea34a32-4f6a-47bc-93a8-ba5266ec2f3c
status: test
description: This rule flags Security event 4781 where an existing computer account is renamed such that the new account name does not contain a '$' character. Attackers may abuse computer account name spoofing to support stealthy persistence and privilege escalation behaviors associated with SAM account naming misuse. It relies on Windows Security auditing for account rename events and the old/new target account name fields captured in the event telemetry.
references:
- https://medium.com/@mvelazco/hunting-for-samaccountname-spoofing-cve-2021-42287-and-domain-controller-impersonation-f704513c8a45
- https://github.com/SigmaHQ/sigma/blob/master/rules-emerging-threats/2021/Exploits/CVE-2021-42287/win_security_samaccountname_spoofing_cve_2021_42287.yml
author: Florian Roth (Nextron Systems), Huntrule Team
date: 2021-12-22
modified: 2022-12-25
tags:
- attack.privilege-escalation
- attack.persistence
- attack.stealth
- attack.t1036
- attack.t1098
- cve.2021-42287
- detection.emerging-threats
logsource:
product: windows
service: security
detection:
selection:
EventID: 4781
OldTargetUserName|contains: $
filter:
NewTargetUserName|contains: $
condition: selection and not filter
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: 45eb2ae2-9aa2-4c3a-99a5-6e5077655466
type: derived