← Back to SOC feed Coverage →

Hunting for sender patterns

kql MEDIUM Azure-Sentinel
T1566
EmailAttachmentInfoEmailEvents
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-17T11:00:00Z · Confidence: medium

Hunt Hypothesis

Emails sent from non-prevalent senders may indicate impersonation attempts by adversaries seeking to bypass user trust. SOC teams should proactively hunt for these patterns in Azure Sentinel to identify potential spear-phishing or account compromise activities early.

KQL Query

let PhishingSenderDisplayNames = ()
{
pack_array("IT", "support", "Payroll", "HR", "admin", "2FA", "notification", "sign", "reminder", "consent", "workplace",
"administrator", "administration", "benefits", "employee", "update", "on behalf");
};
let suspiciousEmails = EmailEvents
| where Timestamp > ago(1d)
| where isnotempty(RecipientObjectId)
| where isnotempty(SenderFromAddress)
| where EmailDirection == "Inbound"
| where DeliveryAction == "Delivered"
| join kind=inner (EmailAttachmentInfo
| where Timestamp > ago(1d)
| where isempty(SenderObjectId)
| where FileType has_any ("png", "jpg", "jpeg", "bmp", "gif")
 ) on NetworkMessageId
| where SenderDisplayName has_any (PhishingSenderDisplayNames())
| project Timestamp, Subject, FileName, SenderFromDomain, RecipientObjectId, NetworkMessageId;
let suspiciousSenders = suspiciousEmails | distinct SenderFromDomain;
let prevalentSenders = materialize(EmailEvents
| where Timestamp between (ago(7d) .. ago(1d))
| where isnotempty(RecipientObjectId)
| where isnotempty(SenderFromAddress)
| where SenderFromDomain in (suspiciousSenders)
| where EmailDirection == "Inbound"
| where DeliveryAction == "Delivered"
| distinct SenderFromDomain);
suspiciousEmails
| where SenderFromDomain !in (prevalentSenders)
| project Timestamp, Subject, FileName, SenderFromDomain, RecipientObjectId, NetworkMessageId

Analytic Rule Definition

id: 68aa199c-259b-4bb0-8e7a-8ed6f96c5525
name: Hunting for sender patterns
description: |
  In this detection approach, we correlate email from non-prevalent senders in the organization with impersonation intents
description-detailed: |
  In this detection approach, we correlate email from non-prevalent senders in the organization with impersonation intents using Defender for Office 365 data.
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - EmailEvents
  - EmailAttachmentInfo
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  let PhishingSenderDisplayNames = ()
  {
  pack_array("IT", "support", "Payroll", "HR", "admin", "2FA", "notification", "sign", "reminder", "consent", "workplace",
  "administrator", "administration", "benefits", "employee", "update", "on behalf");
  };
  let suspiciousEmails = EmailEvents
  | where Timestamp > ago(1d)
  | where isnotempty(RecipientObjectId)
  | where isnotempty(SenderFromAddress)
  | where EmailDirection == "Inbound"
  | where DeliveryAction == "Delivered"
  | join kind=inner (EmailAttachmentInfo
  | where Timestamp > ago(1d)
  | where isempty(SenderObjectId)
  | where FileType has_any ("png", "jpg", "jpeg", "bmp", "gif")
   ) on NetworkMessageId
  | where SenderDisplayName has_any (PhishingSenderDisplayNames())
  | project Timestamp, Subject, FileName, SenderFromDomain, RecipientObjectId, NetworkMessageId;
  let suspiciousSenders = suspiciousEmails | distinct SenderFromDomain;
  let prevalentSenders = materialize(EmailEvents
  | where Timestamp between (ago(7d) .. ago(1d))
  | where isnotempty(RecipientObjectId)
  | where isnotempty(SenderFromAddress)
  | where SenderFromDomain in (suspiciousSenders)
  | where EmailDirection == "Inbound"
  | where DeliveryAction == "Delivered"
  | distinct SenderFromDomain);
  suspiciousEmails
  | where SenderFromDomain !in (prevalentSenders)
  | project Timestamp, Subject, FileName, SenderFromDomain, RecipientObjectId, NetworkMessageId
version: 1.0.0 

Required Data Sources

Sentinel TableNotes
EmailAttachmentInfoEnsure this data connector is enabled
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/QR code/Hunting for sender patterns.yaml