← Back to SOC feed Coverage →

Malicious emails detected per day

kql MEDIUM Azure-Sentinel
T1566
EmailEvents
huntingmicrosoftofficialphishing
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-05-10T23:00:00Z · Confidence: medium

Hunt Hypothesis

This query helps reviewing Malware, Phishing, Spam emails caught per day

KQL Query

EmailEvents
| where DetectionMethods != "" 
| extend detection= parse_json(DetectionMethods) 
| extend Spam = tostring(detection.Spam) 
| extend Phish = tostring(detection.Phish) 
| extend Malware = tostring(detection.Malware) 
| where Spam != '' or Phish != '' or Malware != '' 
| extend detection = case( 
    Malware != "", 'Malware', 
    Phish != "", 'Phish', 
    'Spam') 
| summarize total=count() by detection, bin(Timestamp, 1d) 
| order by Timestamp asc

Analytic Rule Definition

id: da932998-81dd-4be4-963c-f4890cb4192e
name: Malicious emails detected per day
description: |
  This query helps reviewing Malware, Phishing, Spam emails caught per day
description-detailed: |
  This query helps reviewing Malware, Phishing, Spam emails caught per day in Defender for Office 365
requiredDataConnectors:
  - connectorId: MicrosoftThreatProtection
    dataTypes:
      - EmailEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  EmailEvents
  | where DetectionMethods != "" 
  | extend detection= parse_json(DetectionMethods) 
  | extend Spam = tostring(detection.Spam) 
  | extend Phish = tostring(detection.Phish) 
  | extend Malware = tostring(detection.Malware) 
  | where Spam != '' or Phish != '' or Malware != '' 
  | extend detection = case( 
      Malware != "", 'Malware', 
      Phish != "", 'Phish', 
      'Spam') 
  | summarize total=count() by detection, bin(Timestamp, 1d) 
  | order by Timestamp asc
version: 1.0.0

Required Data Sources

Sentinel TableNotes
EmailEventsEnsure this data connector is enabled

False Positive Guidance

MITRE ATT&CK Context

References

Original source: https://github.com/Azure/Azure-Sentinel/blob/main/Hunting Queries/Microsoft 365 Defender/Email and Collaboration Queries/Mailflow/Malicious emails detected per day.yaml