Back to all lessons
Awareness Lessons
13 minutes ago

Device Code Phishing Grants Persistent M365 Access via Rogue Entra ID Registrations

Written by AI from the linked story. Not reviewed by an editor. How this works

Threat actors exploited Microsoft's device code authentication flow to trick users into granting tokens, then registered their own Windows devices in the victim's Entra ID tenant using tools like ROADtools. By enrolling a rogue device, attackers gained persistent access that survived password resets and satisfied Conditional Access Policies — mechanisms designed to protect accounts but here weaponized to entrench unauthorized access. The campaign highlights how modern identity infrastructure can be abused when device registration is unrestricted and users are unaware of device code phishing lures. Organizations that rely solely on Conditional Access Policies without auditing registered devices face a significant blind spot, as a compliant-looking rogue device can masquerade as a trusted endpoint indefinitely.

Tactical Insight

Immediate actions

  • Restrict who can register devices in Entra ID by configuring the 'Users may join devices to Azure AD' setting to specific approved groups only.
  • Audit all currently registered Entra ID devices and revoke any unrecognized or anomalous registrations immediately.
  • Block or restrict the device code authentication flow (OAuth 2.0 device authorization grant) via Conditional Access Policies unless it is explicitly required for a business use case.

Long-term improvements

  • Enforce device compliance policies requiring Intune management and attestation before granting access to corporate resources.
  • Train users to recognize device code phishing lures — particularly unsolicited requests to visit `microsoft.com/devicelogin` and enter a code.
  • Implement a formal device lifecycle management process that ties device registration to approved provisioning workflows.

Detection measures

  • Alert on new device registrations in Entra ID, especially those occurring outside business hours or from unexpected geographic locations.
  • Monitor Entra ID sign-in and audit logs for use of the device code flow, correlating with new device join events.
  • Use Microsoft Sentinel or equivalent SIEM rules to flag access tokens issued via device code grants to previously unseen device IDs.

Back this up with a control

All controls and vendors

Training helps people spot this. These controls make the attack fail even on the day someone does not.