The Device Was Talking To Something It Shouldn't
The email arrived on Monday.
No alert.
No incident.
No reason to investigate.
It sat quietly in the inbox for three days.
Then somebody clicked the link.
The delivery was not the problem. The click was.
This Agent Foskett investigation explores how defenders can use Microsoft Defender XDR, EmailEvents, UrlClickEvents, NetworkMessageId and KQL to investigate suspicious links long after the original email was delivered.

Briefing summary
A healthy-looking endpoint can still be reaching out to suspicious infrastructure. DeviceNetworkEvents helps defenders see where a device connected, which process made the connection and when it happened.
Why outbound network traffic matters
First hunt: find unusual outbound connections
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
DeviceNetworkEvents | where Timestamp > ago(7d) | project Timestamp, DeviceName, InitiatingProcessFileName, RemoteIP, RemotePort, Protocol, ActionType | order by Timestamp desc
Second hunt: identify the process behind the connection
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
DeviceNetworkEvents | where Timestamp > ago(7d) | project Timestamp, DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine, InitiatingProcessParentFileName, RemoteIP, RemotePort, Protocol, ActionType | order by Timestamp desc
When outbound traffic deserves deeper investigation
Third hunt: find devices communicating with the same IP address
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
DeviceNetworkEvents | where Timestamp > ago(30d) | summarize Connections = count(), Devices = dcount(DeviceName), Processes = make_set(InitiatingProcessFileName, 10) by RemoteIP, RemotePort | where Devices > 1 or Connections > 20 | order by Connections desc
Fourth hunt: connect network activity to process execution
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
let SuspiciousConnections = DeviceNetworkEvents | where Timestamp > ago(7d) | where InitiatingProcessFileName in~ ("powershell.exe", "cmd.exe", "rundll32.exe", "mshta.exe", "wscript.exe") | project ConnectionTime = Timestamp, DeviceName, InitiatingProcessFileName, RemoteIP, RemotePort; SuspiciousConnections | join kind=leftouter ( DeviceProcessEvents | where Timestamp > ago(7d) | project ProcessTime = Timestamp, DeviceName, FileName, ProcessCommandLine, InitiatingProcessFileName ) on DeviceName | where ProcessTime between ((ConnectionTime - 10m) .. (ConnectionTime + 10m)) | order by ConnectionTime desc
What DeviceNetworkEvents telemetry can prove
The Agent Foskett investigator mindset
How GEMXIT approaches DeviceNetworkEvents investigations
Final thought
The antivirus never complained.
The dashboard stayed green.
But the device kept talking.
Every connection left a trail.
Every process left evidence.
The device was talking to something it shouldn't.
It is: “What did the device connect to, and which process made it happen?”
Continue the investigation with The Process Tree Told The Real Story, Rundll32 Looked Legitimate, The Process Was Signed By Microsoft, The PowerShell Never Triggered An Alert, KQL Threat Hunting, Microsoft Defender KQL Threat Hunting Complete Guide, Microsoft Defender and the GEMXIT Security Review.
Develop IT. Protect IT.GEMXIT PTY LTD | GEMXIT UK LTD
