Detection rules › Splunk
Suspicious Computer Account Name Change
The following analytic detects a suspicious computer account name change in Active Directory. It leverages Event ID 4781, which logs account name changes, to identify instances where a computer account name is changed to one that does not end with a $. This behavior is significant as it may indicate an attempt to exploit CVE-2021-42278 and CVE-2021-42287, which can lead to domain controller impersonation and privilege escalation. If confirmed malicious, this activity could allow an attacker to gain elevated privileges and potentially control the domain.
Known false positives
- Renaming a computer account name to a name that not end with '$' is highly unsual and may not have any legitimate scenarios.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Initial Access | |
| Persistence | |
| Privilege Escalation | |
| Stealth |
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Security-Auditing | Event ID 4781: The name of an account was changed. |
Rule body
name: Suspicious Computer Account Name Change
id: 35a61ed8-61c4-11ec-bc1e-acde48001122
version: 14
creation_date: '2021-12-20'
modification_date: '2026-05-13'
author: Mauricio Velazco, Splunk
status: production
type: TTP
description: The following analytic detects a suspicious computer account name change in Active Directory. It leverages Event ID 4781, which logs account name changes, to identify instances where a computer account name is changed to one that does not end with a `$`. This behavior is significant as it may indicate an attempt to exploit CVE-2021-42278 and CVE-2021-42287, which can lead to domain controller impersonation and privilege escalation. If confirmed malicious, this activity could allow an attacker to gain elevated privileges and potentially control the domain.
data_source:
- Windows Event Log Security 4781
search: |-
`wineventlog_security` EventCode=4781 OldTargetUserName="*$" NewTargetUserName!="*$"
| table _time, Computer, Caller_User_Name, OldTargetUserName, NewTargetUserName
| rename Computer as dest
| `suspicious_computer_account_name_change_filter`
how_to_implement: To successfully implement this search, you need to be ingesting Windows event logs from your hosts. In addition, the Splunk Windows TA is needed.
known_false_positives: Renaming a computer account name to a name that not end with '$' is highly unsual and may not have any legitimate scenarios.
references:
- https://exploit.ph/cve-2021-42287-cve-2021-42278-weaponisation.html
- https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-42278
- https://msrc.microsoft.com/update-guide/vulnerability/CVE-2021-42287
finding:
title: A computer account $OldTargetUserName$ was renamed with a suspicious computer name on $dest$
entity:
field: OldTargetUserName
type: user
score: 50
intermediate_findings:
entities:
- field: dest
type: system
score: 50
message: A computer account $OldTargetUserName$ was renamed with a suspicious computer name on $dest$
analytic_story:
- Active Directory Privilege Escalation
- Compromised Windows Host
- sAMAccountName Spoofing and Domain Controller Impersonation
- Scattered Lapsus$ Hunters
asset_type: Endpoint
cve:
- CVE-2021-42287
- CVE-2021-42278
mitre_attack_id:
- T1078.002
product:
- Splunk Enterprise
- Splunk Enterprise Security
- Splunk Cloud
category: endpoint
security_domain: endpoint
Stages and Predicates
Stage 1: search
`wineventlog_security` EventCode=4781 OldTargetUserName="*$" NewTargetUserName!="*$"
Stage 2: table
| table _time, Computer, Caller_User_Name, OldTargetUserName, NewTargetUserName
Stage 3: rename
| rename Computer as dest
Stage 4: search
| `suspicious_computer_account_name_change_filter`
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"4781" |
NewTargetUserName | ne |
| field:"NewTargetUserName" kind:ne |
OldTargetUserName | eq |
| field:"OldTargetUserName" kind:eq |