Top outbound recipient domains sending inbound emails with threats
Description
This query helps hunting for top outbound recipient domains which are sending inbound emails with threats
Query · kql
EmailEvents | where EmailDirection == "Outbound" | project RecipientDomain = tostring(split(RecipientEmailAddress, "@")[1]) | summarize count() by RecipientDomain | project OutboundCount=count_, RecipientDomain, SenderFromDomain=RecipientDomain | join (EmailEvents | where EmailDirection == "Inbound" and isempty(ThreatTypes)==false) on SenderFromDomain | summarize max(OutboundCount),count() by SenderFromDomain | project SenderFromDomain, OutboundEmails=max_OutboundCount, IncomingEmailsWithThreats=count_ | sort by OutboundEmails