Investigating DeviceRegistryEvents in Microsoft Defender XDR
DeviceRegistryEvents records Windows registry activity from devices protected by Microsoft Defender for Endpoint.
This table helps defenders investigate registry keys, value names, value data, persistence attempts, startup locations and suspicious endpoint configuration changes.
In this lesson, you will learn how to use DeviceRegistryEvents to follow registry evidence, review value changes and support Microsoft Defender XDR investigations.
Lesson overview
Learn how DeviceRegistryEvents helps defenders investigate registry keys, value changes and persistence activity.
Why DeviceRegistryEvents matters
Attackers may modify registry keys to establish persistence, weaken protections, change startup behaviour or hide activity inside normal Windows configuration areas.
DeviceRegistryEvents helps defenders investigate registry activity and connect suspicious changes back to the device, user, process and timeline.
Investigation scenario
DeviceRegistryEvents showed what ran, but the next question is just as important: did the process change the registry?
By querying DeviceRegistryEvents, the analyst can review registry keys, value names, value data, action types and the initiating process behind the change.
Step 1 — Review recent registry activity
- 1
- 2
- 3
- 4
- 5
- 6
DeviceRegistryEvents | where Timestamp > ago(24h) | project Timestamp, DeviceName, ActionType, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName | order by Timestamp desc
Step 2 — Review common persistence locations
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceRegistryEvents | where Timestamp > ago(7d) | where RegistryKey has_any ("\\Run", "\\RunOnce", "CurrentVersion\\Run") | project Timestamp, DeviceName, ActionType, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName | order by Timestamp desc
Step 3 — Review the initiating process
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceRegistryEvents | where Timestamp > ago(7d) | project Timestamp, DeviceName, ActionType, RegistryKey, RegistryValueName, InitiatingProcessFileName, InitiatingProcessCommandLine | order by Timestamp desc
Examples of registry changes to review
Step 4 — Look for suspicious value data
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceRegistryEvents | where Timestamp > ago(7d) | where RegistryValueData has_any ("powershell", "cmd.exe", "wscript", "mshta", "AppData") | project Timestamp, DeviceName, ActionType, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName | order by Timestamp desc
How DeviceRegistryEvents supports investigations
It can show the key, value name, value data, action type, device, user and initiating process behind the change.
Step 5 — Summarise registry activity
- 1
- 2
- 3
- 4
- 5
- 6
DeviceRegistryEvents | where Timestamp > ago(7d) | summarize ChangeCount = count() by DeviceName, RegistryKey | order by ChangeCount desc
Step 6 — Correlate with process activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
let RegistryChanges = DeviceRegistryEvents | where Timestamp > ago(7d) | where RegistryKey has_any ("\\Run", "\\RunOnce") | project DeviceName, RegistryTimestamp = Timestamp, RegistryKey, RegistryValueName, RegistryValueData, InitiatingProcessFileName; DeviceProcessEvents | where Timestamp > ago(7d) | join kind=inner RegistryChanges on DeviceName | project RegistryTimestamp, Timestamp, DeviceName, FileName, ProcessCommandLine, RegistryKey, RegistryValueName, RegistryValueData | order by RegistryTimestamp desc
Common investigation uses
Common mistakes
What you learned
Related Agent Foskett Academy lessons
Continue learning with Building Investigation Timelines, KQL Threat Hunting Guide and Microsoft Security.
Develop IT. Protect IT. GEMXIT PTY LTD | GEMXIT UK LTD