Skip to content
← RegistryDossier · 6 steps · 5 edges

OAuth device-code phishing → M365 access without a fake page

Initiate a device-code flow against login.microsoftonline.com; send the code + url to the victim via email or chat. Once they enter it, attacker gets access + refresh tokens.

Filed by AD Knowledge Base
§ Kill-chainDrag · zoom · scroll

§ Context

Assumed environment: target tenant allows the device-code flow (default for many client apps). Victim is willing to enter a short code on a legitimate Microsoft URL.

§ Steps

  1. 01
    Send code + URL to victimInitial Access
    T1566Phishing
  2. 02
    Victim enters code on microsoft.com/deviceloginExecution
    T1204User Execution
  3. 03
    Refresh-token rotation for long-term accessCredential Access
    M365-TOKEN-EXFILAAD Token Cache Exfil
  4. 04
    Receive access + refresh tokensCredential Access
    M365-TOKEN-EXFILAAD Token Cache Exfil
  5. 05
    Query Graph for mail / drive / usersCollection
    M365-EWS-EXFILExchange Web Services (EWS) Exfil
  6. 06
    POST to /devicecode endpointInitial Access
    PH-OAUTH-DEVCODEOAuth Device-Code Phishing

§ References

§ Frequently asked

What is the "OAuth device-code phishing → M365 access without a fake page" attack path?
Initiate a device-code flow against login.microsoftonline.com; send the code + url to the victim via email or chat. Once they enter it, attacker gets access + refresh tokens. It chains 6 steps drawn from real-world offensive-security techniques.
What starting position does this attack require?
The first step is Send code + URL to victim (T1566) — a initial access primitive. Assumed environment: target tenant allows the device-code flow (default for many client apps).
What is the final impact of this kill-chain?
The final step lands on POST to /devicecode endpoint (PH-OAUTH-DEVCODE), which falls under Initial Access. From here, an operator typically pivots into post-exploitation or maintains persistence.
How can defenders detect or prevent this attack?
Detection and prevention vary per step. Refer to each linked MITRE ATT&CK entry under "References" — every technique on that page lists defensive controls, detection telemetry, and known threat-actor usage.

§ Related dossiers