← Back to SOC feed Coverage →

SAM-Name-Changes-CVE-2021-42278

kql MEDIUM Azure-Sentinel
IdentityDirectoryEvents
exploithuntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-05-24T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may change device names in the network to mask their presence and evade detection, leveraging CVE-2021-42278 to manipulate network visibility. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify potential lateral movement or persistence tactics early.

KQL Query

IdentityDirectoryEvents
| where Timestamp > ago(1d)
| where ActionType == "SAM Account Name changed"
| extend FROMSAM = parse_json(AdditionalFields)['FROM SAM Account Name']
| extend TOSAM = parse_json(AdditionalFields)['TO SAM Account Name']
| where (FROMSAM has "$" and TOSAM !has "$") 
        or TOSAM in ("DC1", "DC2", "DC3", "DC4") // DC Names in the org
| project Timestamp, Application, ActionType, TargetDeviceName, FROMSAM, TOSAM, ReportId, AdditionalFields

Analytic Rule Definition

id: 89ce68d5-dd48-4f3f-b102-336fc4ebdda9
name: SAM-Name-Changes-CVE-2021-42278
description: |
  The following query detects possible CVE-2021-42278 exploitation by finding changes of device names in the network using Microsoft Defender for Identity
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - IdentityDirectoryEvents
tactics:
- Privilege escalation
- Vulnerability
query: |
  IdentityDirectoryEvents
  | where Timestamp > ago(1d)
  | where ActionType == "SAM Account Name changed"
  | extend FROMSAM = parse_json(AdditionalFields)['FROM SAM Account Name']
  | extend TOSAM = parse_json(AdditionalFields)['TO SAM Account Name']
  | where (FROMSAM has "$" and TOSAM !has "$") 
          or TOSAM in ("DC1", "DC2", "DC3", "DC4") // DC Names in the org
  | project Timestamp, Application, ActionType, TargetDeviceName, FROMSAM, TOSAM, ReportId, AdditionalFields

Required Data Sources

Sentinel TableNotes
IdentityDirectoryEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Privilege escalation/SAM-Name-Changes-CVE-2021-42278.yaml