Detect DMARC Fail Emails in Microsoft Defender
The email looked normal.
The sender looked familiar.
But the authentication data told a different story: DMARC failed.
This Agent Foskett guide shows how to use Microsoft Defender KQL, EmailEvents and AuthenticationDetails to find DMARC failures, check whether the email was delivered, and decide where to pivot next.
Guide summary
This page focuses on one high-value email investigation signal: DMARC failures inside Microsoft Defender XDR.
Why DMARC fail matters
Start with DMARC failures in EmailEvents
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
EmailEvents | where Timestamp > ago(30d) | where AuthenticationDetails has "dmarc=fail" | project Timestamp, SenderFromAddress, SenderFromDomain, SenderMailFromDomain, RecipientEmailAddress, Subject, DeliveryAction, ThreatTypes, AuthenticationDetails | order by Timestamp desc
- AuthenticationDetails tells you the authentication result recorded by Defender.
- DeliveryAction tells you what happened to the message after evaluation.
- SenderFromDomain and SenderMailFromDomain help you compare what the user sees with the underlying sending path.
π If DMARC failed and the email was delivered, that is where the investigation should start.
Find DMARC fail emails that were delivered
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
EmailEvents | where Timestamp > ago(30d) | where AuthenticationDetails has "dmarc=fail" | where DeliveryAction has "Delivered" | project Timestamp, SenderFromAddress, RecipientEmailAddress, Subject, DeliveryAction, AuthenticationDetails, NetworkMessageId | order by Timestamp desc
Compare visible sender and mail-from domain
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
EmailEvents | where Timestamp > ago(30d) | where AuthenticationDetails has "dmarc=fail" | where SenderFromDomain != SenderMailFromDomain | project Timestamp, SenderFromAddress, SenderFromDomain, SenderMailFromDomain, RecipientEmailAddress, Subject, DeliveryAction, AuthenticationDetails | order by Timestamp desc
- SenderFromDomain is the domain the user is likely to notice.
- SenderMailFromDomain helps reveal the sending path behind the message.
- A mismatch is not always malicious, but it should make sense for that sender and message type.
π The key question is not just βare these different?β It is βdoes this difference make sense?β
Group DMARC failures into patterns
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
EmailEvents | where Timestamp > ago(30d) | where AuthenticationDetails has "dmarc=fail" | summarize MessageCount = count(), RecipientCount = dcount(RecipientEmailAddress), FirstSeen = min(Timestamp), LastSeen = max(Timestamp) by SenderFromAddress, SenderFromDomain, Subject, DeliveryAction | where MessageCount >= 3 | order by MessageCount desc
Pivot from DMARC fail to URL clicks
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
let DMARCFailMessages = EmailEvents | where Timestamp > ago(30d) | where AuthenticationDetails has "dmarc=fail" | project NetworkMessageId, EmailTime = Timestamp, SenderFromAddress, RecipientEmailAddress, Subject; DMARCFailMessages | join kind=inner ( UrlClickEvents | where Timestamp > ago(30d) | project NetworkMessageId, ClickTime = Timestamp, AccountUpn, Url, ActionType ) on NetworkMessageId | order by ClickTime desc
- NetworkMessageId connects the email event to click telemetry.
- ActionType helps show whether the click was allowed, blocked or scanned.
- The clicked URL, account and timestamp become the starting point for identity and endpoint pivots.
π A DMARC fail email becomes more urgent when a user clicked the link.
Agent Foskett investigation checklist
Continue hunting
If you want help improving Microsoft Defender hunting, alert investigation and security visibility, π review Microsoft Defender services
Develop IT. Protect IT. GEMXIT PTY LTD | GEMXIT UK LTD