Query Details
//When Defender for Cloud detects a possible DNS lookup to a phishing domain attempt to find if the URL was part of an email phishing attack
//Data connector required for this query - M365 Defender - Email* tables
//Data connector required for this query - Security Alert (free table that other Defender products send alert info to)
let suspiciousdomains=
SecurityAlert
| where AlertName startswith "Communication with possible phishing domain"
| mv-expand todynamic(Entities)
| extend DomainName = tostring(Entities.DomainName)
| where isnotempty(DomainName)
| distinct DomainName;
EmailEvents
| where EmailDirection == "Inbound"
| project
TimeGenerated,
SenderMailFromAddress,
RecipientEmailAddress,
EmailDirection,
NetworkMessageId
| join kind=inner (EmailUrlInfo) on NetworkMessageId
| project
TimeGenerated,
SenderMailFromAddress,
RecipientEmailAddress,
EmailDirection,
Url,
UrlDomain
| where UrlDomain in~ (suspiciousdomains)This query is looking for possible phishing domains by analyzing communication alerts. It retrieves suspicious domain names from the SecurityAlert table and then searches for emails with inbound direction. It joins the EmailUrlInfo table based on the NetworkMessageId and selects relevant columns such as time generated, sender email address, recipient email address, email direction, URL, and URL domain. Finally, it filters the results to include only URLs that match the suspicious domains.

Matt Zorich
Released: June 17, 2022
Tables
Keywords
Operators