Detect Email Spoofing in Microsoft Defender
Most spoofed emails do not start with a dramatic alert. They often look ordinary, familiar and technically boring.
This guide shows how to detect email spoofing in Microsoft Defender XDR using EmailEvents, AuthenticationDetails, DMARC, SPF, DKIM, sender alignment, delivery actions and URL click pivots.
It is built for practical investigation: what was sent, who received it, whether it was delivered, whether anyone clicked, and what to check next.
Email spoofing investigation summary
A focused Microsoft Defender KQL resource for finding spoofed sender domains, failed authentication, suspicious delivery outcomes and click activity.
What this guide helps you detect
Start here: find authentication failures in EmailEvents
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
EmailEvents
| where Timestamp > ago(30d)
| where AuthenticationDetails has_any ("spf=fail", "dkim=fail", "dmarc=fail")
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
SenderMailFromAddress,
SenderMailFromDomain,
RecipientEmailAddress,
Subject,
AuthenticationDetails,
DeliveryAction,
ThreatTypes,
NetworkMessageId
| order by Timestamp desc
Agent Foskett mindset: do not just ask whether something failed
Find DMARC failures specifically
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
EmailEvents
| where Timestamp > ago(30d)
| where AuthenticationDetails has "dmarc=fail"
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
SenderMailFromAddress,
SenderMailFromDomain,
RecipientEmailAddress,
Subject,
AuthenticationDetails,
DeliveryAction,
ThreatTypes,
NetworkMessageId
| order by Timestamp desc
π Related deep dive β DMARC failures explained with KQL.
Find delivered spoofing risk
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
EmailEvents
| where Timestamp > ago(30d)
| where AuthenticationDetails has_any ("dmarc=fail", "spf=fail", "dkim=fail")
| where DeliveryAction !in~ ("Blocked", "Quarantined", "Junked")
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
SenderMailFromDomain,
RecipientEmailAddress,
Subject,
AuthenticationDetails,
DeliveryAction,
NetworkMessageId
| order by Timestamp desc
Compare visible sender and envelope sender
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
EmailEvents
| where Timestamp > ago(30d)
| where SenderFromDomain != SenderMailFromDomain
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
SenderMailFromAddress,
SenderMailFromDomain,
RecipientEmailAddress,
Subject,
AuthenticationDetails,
DeliveryAction,
NetworkMessageId
| order by Timestamp desc
Group suspicious messages into patterns
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
EmailEvents
| where Timestamp > ago(30d)
| where AuthenticationDetails has_any ("dmarc=fail", "spf=fail", "dkim=fail")
| summarize
MessageCount = count(),
RecipientCount = dcount(RecipientEmailAddress),
FirstSeen = min(Timestamp),
LastSeen = max(Timestamp)
by SenderFromDomain, SenderMailFromDomain, Subject, DeliveryAction
| order by MessageCount desc
Pivot spoofed emails to URL clicks
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
let SuspiciousEmails =
EmailEvents
| where Timestamp > ago(30d)
| where AuthenticationDetails has_any ("dmarc=fail", "spf=fail", "dkim=fail")
| project
NetworkMessageId,
EmailTime = Timestamp,
SenderFromAddress,
RecipientEmailAddress,
Subject,
DeliveryAction;
SuspiciousEmails
| join kind=inner (
UrlClickEvents
| where Timestamp > ago(30d)
| project
NetworkMessageId,
ClickTime = Timestamp,
AccountUpn,
Url,
ActionType
) on NetworkMessageId
| order by ClickTime desc
π If clicks are present, continue β check identity activity after interaction.
Check whether spoofing was already classified
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
EmailEvents
| where Timestamp > ago(30d)
| where ThreatTypes has_any ("Spoof", "Phish") or AuthenticationDetails has "dmarc=fail"
| project
Timestamp,
SenderFromAddress,
SenderFromDomain,
RecipientEmailAddress,
Subject,
ThreatTypes,
AuthenticationDetails,
DeliveryAction,
NetworkMessageId
| order by Timestamp desc
What to do after you find spoofing
Continue your investigation
Related case study β The email came from meβ¦ but I never sent it.
