M365 Identity OAuth Flow by First-Party Microsoft App from Multiple IPs
Identifies sign-ins on behalf of a principal user to the Microsoft Graph or legacy Azure AD API from multiple IPs using first-party Microsoft applications from the FOCI (Family of Client IDs) group. Developer tools…
Description
Identifies sign-ins on behalf of a principal user to the Microsoft Graph or legacy Azure AD API from multiple IPs using first-party Microsoft applications from the FOCI (Family of Client IDs) group. Developer tools like Azure CLI, VSCode, and Azure PowerShell accessing these resources from multiple IPs are flagged, along with any FOCI application accessing the deprecated Windows Azure Active Directory from multiple IPs. This behavior may indicate an adversary using a phished OAuth authorization code or refresh token, as seen in attacks like ConsentFix where attackers steal localhost OAuth codes and replay them from attacker infrastructure.
Detection logic
Its licence does not clear it for publishing here
Sunturai publishes a detection's own text where the licence it arrived under has been reviewed and permits it, and Elastic License 2.0 has not. The query as its source wrote it, its canonical form and the hash that pins this revision are in the workspace record.
Detection requirements
- Platform
- ContainersESXiIaaSIdentity ProviderLinuxmacOSNetwork DevicesOffice SuiteSaaSWindows
The rule states no platform. This is derived from the 4 ATT&CK techniques it maps to.
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| dirkjanm.io/phishing-for-microsoft-entra-primary-refresh-tokens/ | 10 |
| github.com/dirkjanm/ROADtools | 16from 2 sources |
| github.com/secureworks/family-of-client-ids-research | 5 |
| pushsecurity.com/blog/consentfix | 8 |
| www.volexity.com/blog/2025/04/22/phishing-for-codes-russian-threat-actors-target-microsoft-365-oauth-workflows/ | 19 |
From the source
- At source
- Open at source
- Upstream identifier
- 36188365-f88f-4f70-8c1d-0b9554186b9c
- Tagged by the source as
- Data Source: Microsoft 365Data Source: Microsoft 365 Audit LogsDomain: CloudDomain: EmailDomain: IdentityDomain: SaaSNoise: LowPerformance: NormalPlatform: Microsoft 365Resources: Investigation GuideRule Type: ES|QLTactic: Defense EvasionUse Case: Identity and Access AuditUse Case: Threat Detection
Licence
- Published under
- Elastic License 2.0Read the licence
- Attribution
- Required
Authorship
- Written by
- Published
- Sep 20, 2026
- Version
- 3