← Back to SOC feed Coverage →

Potential OAuth phishing email delivered into Inbox

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

Hunt Hypothesis

Adversaries may use OAuth phishing emails to deliver malicious URLs that could compromise user credentials and gain unauthorized access to Azure resources. SOC teams should proactively hunt for this behavior to identify and mitigate potential credential theft and lateral movement attempts in their environment.

KQL Query

let ConsentUrls = pack_array("://login.microsoftonline.com/common/oauth2", "://login.microsoftonline.com/consumers/oauth2", "://login.microsoftonline.com/organizations/oauth2", "://login.microsoftonline.us/common/oauth2", "://login.microsoftonline.us/consumers/oauth2", "://login.microsoftonline.us/organizations/oauth2");
EmailUrlInfo
| where Url has_any (ConsentUrls)
| join EmailEvents on NetworkMessageId
| where EmailDirection == "Inbound" and LatestDeliveryAction == "Delivered"

Analytic Rule Definition

id: 7dca78d0-5354-4e20-80c0-4f770450feb6
name: Potential OAuth phishing email delivered into Inbox
description: |
  This query can be used as a Custom Detection Rule (CDR) to trigger when a potentially malicious OAuth app URL has been delivered into an Inbox.
description-detailed: |
  This query can be used as a Custom Detection Rule (CDR) to trigger when a potentially malicious OAuth app URL has been delivered into an Inbox. The URLs contained are not directly malicious but could be an attempt to delegate permissions to an attacker-controlled App. https://learn.microsoft.com/en-us/defender-xdr/custom-detection-rules
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
  dataTypes:
  - EmailEvents
tactics:
  - InitialAccess
relevantTechniques:
  - T1566
query: |
  let ConsentUrls = pack_array("://login.microsoftonline.com/common/oauth2", "://login.microsoftonline.com/consumers/oauth2", "://login.microsoftonline.com/organizations/oauth2", "://login.microsoftonline.us/common/oauth2", "://login.microsoftonline.us/consumers/oauth2", "://login.microsoftonline.us/organizations/oauth2");
  EmailUrlInfo
  | where Url has_any (ConsentUrls)
  | join EmailEvents on NetworkMessageId
  | where EmailDirection == "Inbound" and LatestDeliveryAction == "Delivered"
version: 1.0.0

Required Data Sources

Sentinel TableNotes
EmailEventsEnsure this data connector is enabled
EmailUrlInfoEnsure 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/Custom Detections/Potential OAuth phishing email delivered into Inbox.yaml