Suspicious M365 Device Code Authentication Flow via m365

PremiumReviewedSigma · Medium · v1
Product
m365
Service
signinlogs
Author
HuntRule
Published
2026-09-28
Updated
2026-09-28

ATT&CK techniques

Initial Access → Cred Access
  1. Recon

  2. Resource Dev

  3. Execution

  4. Persistence

  5. Priv Esc

  6. Defense Evasion

  7. Discovery

  8. Lateral Movement

  9. Collection

  10. C2

  11. Exfiltration

  12. Impact

What it detects

This rule detects Microsoft 365 sign-ins that use the device code authentication flow. The Railway PaaS campaign relied on device code phishing to trick users into authorizing attacker-controlled sessions, so device code grants outside of known kiosk or IoT enrollment scenarios indicate probable phishing-driven token theft.

Related detections9 linkedT1528 — drag to rearrange
Suspicious Microsoft Entra Device Code Authentication Flow
Suspicious OAuth Application Consent Grant via Azure Audit Logs
Suspicious Entra Device Code Authentication with Office Client and Automated User Agent
Suspicious OAuth Application Consent or Permission Grant (via auditlogs)
Malicious Context.ai OAuth Application Authorization by Client ID (via google_workspace)
Suspicious Entra ID ROPC Authentication Bypassing MFA
Suspicious Consent to Application Grant in Entra ID
Malicious Azure AD Application Consent Granted with Mail Permissions
Suspicious Device Code Authentication via Microsoft Authentication Broker
Suspicious M365 Device Code Authentication Flow via m365
Pivot detection · T1528 · 9 related

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.