Investigating DeviceProcessEvents in Microsoft Defender XDR
DeviceProcessEvents records process creation and execution activity from devices protected by Microsoft Defender for Endpoint.
This table helps defenders investigate executables, command lines, parent-child process relationships, user context and suspicious activity on endpoints.
In this lesson, you will learn how to use DeviceProcessEvents to follow execution evidence, review command lines and support Microsoft Defender XDR investigations.
Lesson overview
Learn how DeviceProcessEvents helps defenders investigate process execution, command lines and parent-child process relationships.
Why DeviceProcessEvents matters
Attackers may use PowerShell, CMD, Rundll32, MSHTA, WScript, Office processes or custom malware to execute commands and move through the environment.
DeviceProcessEvents helps defenders investigate execution activity and connect suspicious behaviour back to the device, user, command line and parent process.
Investigation scenario
DeviceNetworkEvents showed where the device talked to, but the next question is more important: what process caused the connection?
By querying DeviceProcessEvents, the analyst can review the process name, command line, account context and parent process that led to the activity.
Step 1 — Review recent process activity
- 1
- 2
- 3
- 4
- 5
- 6
DeviceProcessEvents | where Timestamp > ago(24h) | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine | order by Timestamp desc
Step 2 — Find PowerShell activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceProcessEvents | where Timestamp > ago(7d) | where FileName in~ ("powershell.exe", "pwsh.exe") | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine | order by Timestamp desc
Step 3 — Review parent-child relationships
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceProcessEvents | where Timestamp > ago(7d) | project Timestamp, DeviceName, FileName, InitiatingProcessFileName, ProcessCommandLine | order by Timestamp desc
Examples of process chains to review
Step 4 — Look for encoded commands
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceProcessEvents | where Timestamp > ago(7d) | where ProcessCommandLine contains "-enc" or ProcessCommandLine contains "-encodedcommand" | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine | order by Timestamp desc
How DeviceProcessEvents supports investigations
It can show the account, command line, parent process, device and time of execution.
Step 5 — Summarise process activity
- 1
- 2
- 3
- 4
- 5
- 6
DeviceProcessEvents | where Timestamp > ago(7d) | summarize ProcessCount = count() by FileName | order by ProcessCount desc
Step 6 — Correlate with network activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
let SuspiciousProcesses = DeviceProcessEvents | where Timestamp > ago(7d) | where FileName in~ ("powershell.exe", "pwsh.exe", "mshta.exe") | project DeviceName, FileName, ProcessCommandLine; DeviceNetworkEvents | where Timestamp > ago(7d) | join kind=inner SuspiciousProcesses on DeviceName | project Timestamp, DeviceName, FileName, ProcessCommandLine, RemoteIP, RemoteUrl, RemotePort | order by Timestamp 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