Query Details
//This query identify domains that have been detected by Microsoft Defender XDR sending malware by email
//but it filter the cases where these domains, has been able to deliver emails into Inbox Folders without being detected
let th_SenderIP =
EmailEvents
// decide type of Threat to review
| where ThreatTypes contains "Malware"
// add your trusted Public IP in the following list
| where SenderIPv4 !in ("93.93.93.93", "45.45.45.45")
| summarize total = count() by ThreatTypes,SenderIPv4
// decides the minimum threats that a SenderIP has sent to be on the list
| where total > 1
| distinct SenderIPv4;
EmailEvents
| where SenderIPv4 in (th_SenderIP)
| extend DomainExtension = split(SenderFromAddress, ".")[-1]
| where DeliveryLocation contains "Inbox"
| where isempty(ThreatTypes)
| extend countryip = geo_info_from_ip_address(SenderIPv4)
| extend countryip = parse_json(countryip).country
| where isnotempty(SenderIPv4)
| project Timestamp, DomainExtension, countryip ,SenderIPv4, SenderFromDomain, ThreatTypes, RecipientEmailAddress, Subject, DeliveryLocation This query is designed to identify suspicious domains that have successfully sent malware via email, specifically when these emails have bypassed detection and ended up in inbox folders. Here's a simplified breakdown of what the query does:
Identify Malicious Senders:
Filter Successful Deliveries:
Output Relevant Information:
In essence, this query helps in identifying domains that have managed to send malware-laden emails into inboxes without being flagged, providing insights into potentially dangerous senders and their geographical origins.

Sergio Albea
Released: November 10, 2024
Tables
Keywords
Operators