← Back to SOC feed Coverage →

Malicious mails by sender IPs

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-05-19T11:00:00Z · Confidence: medium

Hunt Hypothesis

Adversaries may use compromised sender IPs to distribute malware or phishing emails, leveraging trusted infrastructure to evade detection. SOC teams should proactively hunt for this behavior in Azure Sentinel to identify and mitigate potential email-based attacks before they cause widespread damage.

KQL Query

EmailEvents 
| where Timestamp > ago(30d) 
| where ThreatTypes has "Phish" or ThreatTypes has "Malware"
| summarize count() by SenderIPv4 //SenderIPv6
| sort by count_

Analytic Rule Definition

id: a8ccbf35-4c6d-4a8f-8c42-04fd9b000a27
name: Malicious mails by sender IPs
description: |
  This query helps reviewing sender IPs sending malicious email of type Malware or Phish
description-detailed: |
  This query helps reviewing sender IPs sending malicious email of type Malware or Phish using Defender for Office 365 data.
requiredDataConnectors:
  - connectorId: MicrosoftThreatProtection
    dataTypes:
      - EmailEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  EmailEvents 
  | where Timestamp > ago(30d) 
  | where ThreatTypes has "Phish" or ThreatTypes has "Malware"
  | summarize count() by SenderIPv4 //SenderIPv6
  | sort by 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/Top Attacks/Malicious mails by sender IPs.yaml