The Attachment Was Never Opened
The email arrived quietly.
The attachment passed initial checks. No major alert fired. The user said they never opened it.
But later that day, Microsoft Defender XDR showed file activity on the endpoint, PowerShell execution, outbound network traffic and identity behaviour that did not quite fit.
This Agent Foskett investigation follows the evidence from email delivery to attachment metadata, SHA256 pivots, endpoint execution and post-delivery investigation.
The dangerous part was not just the attachment.
It was what happened after the attachment landed.
Briefing summary
A Microsoft Defender XDR investigation into suspicious attachment delivery, EmailAttachmentInfo, DeviceFileEvents, DeviceProcessEvents and the endpoint activity that followed.
What happened
Why attachment investigations matter
First hunt: find delivered attachments
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
EmailAttachmentInfo | where Timestamp > ago(30d) | project Timestamp, NetworkMessageId, FileName, SHA256, FileType, FileSize, RecipientEmailAddress, SenderFromAddress | order by Timestamp desc
Second hunt: connect the attachment to the original email
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
let Attachments = EmailAttachmentInfo | where Timestamp > ago(30d) | project NetworkMessageId, FileName, SHA256, FileType; Attachments | join kind=inner ( EmailEvents | where Timestamp > ago(30d) | project Timestamp, NetworkMessageId, SenderFromAddress, RecipientEmailAddress, Subject, DeliveryAction, AuthenticationDetails ) on NetworkMessageId | order by Timestamp desc
Third hunt: pivot from SHA256 into endpoint file activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
DeviceFileEvents | where Timestamp > ago(30d) | where SHA256 == "PUT_SHA256_HERE" | project Timestamp, DeviceName, InitiatingProcessAccountName, FolderPath, FileName, SHA256, ActionType | order by Timestamp desc
Fourth hunt: look for suspicious process execution
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
DeviceProcessEvents | where Timestamp > ago(14d) | where FileName in~ ("powershell.exe", "pwsh.exe", "cmd.exe", "mshta.exe", "rundll32.exe", "wscript.exe") | where ProcessCommandLine has_any ( "-enc", "downloadstring", "invoke-webrequest", "frombase64string", "http", "temp", "appdata" ) | project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName | order by Timestamp desc
Fifth hunt: check outbound network activity
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
DeviceNetworkEvents | where Timestamp > ago(14d) | where InitiatingProcessFileName in~ ( "powershell.exe", "cmd.exe", "mshta.exe", "rundll32.exe", "wscript.exe" ) | project Timestamp, DeviceName, InitiatingProcessAccountName, InitiatingProcessFileName, RemoteUrl, RemoteIP, RemotePort | order by Timestamp desc
What this kind of activity can indicate
What dashboards miss
The real investigation flow
How GEMXIT approaches attachment investigations
Final thought
“Was the attachment opened?”
It is:
“What changed after it arrived?”
Continue the investigation with The PowerShell Never Triggered An Alert, The Dashboard Was Green, When Nothing Looks Wrong, The Missing Click and Microsoft Defender KQL Threat Hunting Complete Guide.
Develop IT. Protect IT. GEMXIT PTY LTD | GEMXIT UK LTD