← Back to SOC feed Coverage →

Top Attacked Users by Malware Threat Classification

kql MEDIUM Azure-Sentinel
T1566
EmailEvents
huntingmicrosoftofficial
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Azure-Sentinel →
Retrieved: 2026-09-03T11:00:00Z · Confidence: medium

Hunt Hypothesis

This hypothesis targets adversaries leveraging phishing (T1566) to deliver malware by identifying high-value recipients who are disproportionately targeted across specific malware classifications. Proactively hunting for these patterns allows the SOC to prioritize defensive measures for users who are likely being used as initial access vectors or are experiencing targeted spear-phishing campaigns before they lead to broader compromise.

KQL Query

EmailEvents
| where Timestamp > ago(30d)
| where OrgLevelPolicy != "Phishing simulation" and OrgLevelPolicy != "SecOps Mailbox"
| extend Key = strcat(NetworkMessageId, "-", RecipientEmailAddress)
| summarize arg_max(Timestamp, *) by Key
| where ThreatTypes has "Malware" and EmailDirection == "Inbound" and ThreatClassification has_any("Adware","Downloader","HackTool","Ransomware","Remote access trojan","Spyware")
| summarize EmailCount = count() by ThreatClassification, RecipientEmailAddress
| summarize Count = arg_max(EmailCount, RecipientEmailAddress) by ThreatClassification
| sort by Count desc
| project ['Threat Classification'] = ThreatClassification, ['Top Recipient'] = RecipientEmailAddress, ['Emails'] = Count

Analytic Rule Definition

id: 177b756b-03f1-4107-a547-92872ba32c47
name: Top Attacked Users by Malware Threat Classification
description: |
  This query surfaces, for each malware threat classification, the recipient most frequently targeted by inbound malware email.
description-detailed: |
  This query surfaces, for each malware threat classification (for example Adware, Downloader, HackTool, Ransomware, Remote access trojan, Spyware), the recipient most frequently targeted by inbound malware email in Microsoft Defender for Office 365.
  Messages are de-duplicated to the latest record per NetworkMessageId and recipient, and deliveries to the SecOps mailbox and by the phishing simulation system are excluded.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - EmailEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  EmailEvents
  | where Timestamp > ago(30d)
  | where OrgLevelPolicy != "Phishing simulation" and OrgLevelPolicy != "SecOps Mailbox"
  | extend Key = strcat(NetworkMessageId, "-", RecipientEmailAddress)
  | summarize arg_max(Timestamp, *) by Key
  | where ThreatTypes has "Malware" and EmailDirection == "Inbound" and ThreatClassification has_any("Adware","Downloader","HackTool","Ransomware","Remote access trojan","Spyware")
  | summarize EmailCount = count() by ThreatClassification, RecipientEmailAddress
  | summarize Count = arg_max(EmailCount, RecipientEmailAddress) by ThreatClassification
  | sort by Count desc
  | project ['Threat Classification'] = ThreatClassification, ['Top Recipient'] = RecipientEmailAddress, ['Emails'] = Count
version: 1.0.0

Required Data Sources

Sentinel TableNotes
EmailEventsEnsure this data connector is enabled

MITRE ATT&CK Context

References

False Positive Guidance

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Email and Collaboration Queries/Malware/Top Attacked Users by Malware Threat Classification.yaml