Investigating DeviceNetworkEvents in Microsoft Defender XDR
DeviceNetworkEvents records network connections made by devices protected by Microsoft Defender for Endpoint.
This table helps defenders investigate remote IPs, domains, ports, protocols and suspicious outbound activity.
In this lesson, you will learn how to use DeviceNetworkEvents to follow network evidence, identify unusual connections and support Microsoft Defender XDR investigations.
Lesson overview
Learn how DeviceNetworkEvents helps defenders investigate outbound connections, remote IPs, domains and ports.
Why DeviceNetworkEvents matters
A device may connect to a suspicious IP, contact an unusual domain, communicate over an unexpected port or repeatedly reach out after a malicious process runs.
DeviceNetworkEvents helps defenders investigate those connections and connect network activity back to devices, users and processes.
Investigation scenario
The process activity is important, but the next question is simple: what did the device connect to?
By querying DeviceNetworkEvents, the analyst can review outbound connections, remote destinations and the process context around the network activity.
Step 1 — Review recent network connections
- 1
- 2
- 3
- 4
- 5
- 6
DeviceNetworkEvents | where Timestamp > ago(24h) | project Timestamp, DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName, RemoteIP, RemoteUrl, RemotePort, ActionType | order by Timestamp desc
Step 2 — Find connections from suspicious processes
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceNetworkEvents | where Timestamp > ago(7d) | where InitiatingProcessFileName in~ ("powershell.exe", "pwsh.exe", "cmd.exe", "wscript.exe", "mshta.exe") | project Timestamp, DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName, RemoteIP, RemoteUrl, RemotePort, ActionType | order by Timestamp desc
Step 3 — Summarise remote destinations
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceNetworkEvents | where Timestamp > ago(7d) | summarize ConnectionCount = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp) by RemoteIP, RemoteUrl, RemotePort | order by ConnectionCount desc
How DeviceNetworkEvents supports investigations
It can show the device, user context, initiating process, remote destination and action taken by Defender.
Step 4 — Focus on unusual remote ports
- 1
- 2
- 3
- 4
- 5
- 6
- 7
DeviceNetworkEvents | where Timestamp > ago(7d) | where RemotePort !in (80, 443, 53) | summarize ConnectionCount = count() by DeviceName, RemoteIP, RemoteUrl, RemotePort, InitiatingProcessFileName | order by ConnectionCount desc
Step 5 — Correlate with suspicious process 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, ProcessTimestamp = Timestamp, 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