[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"$fWdu_dC1Tg_Y-WO4JF8_W7qrH_43dQBuBeaiOIdtWJW8":3},{"lesson":4},{"id":5,"slug":6,"article_id":7,"title":8,"body":9,"prevention":10,"framework_refs":11,"framework_notes":17,"status":23,"created_at":24,"published_at":25,"article":26,"tags":30,"podcasts":43,"controls":44},"78d9579e-78fa-47f9-9f84-1eaeaf1efd05","device-code-phishing-grants-persistent-m365-access-via-rogue-entra-id-registrations","4c04ce0a-c529-499a-8043-6a189136d909","Device Code Phishing Grants Persistent M365 Access via Rogue Entra ID Registrations","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.","**Immediate actions:**\n- Restrict who can register devices in Entra ID by configuring the 'Users may join devices to Azure AD' setting to specific approved groups only.\n- Audit all currently registered Entra ID devices and revoke any unrecognized or anomalous registrations immediately.\n- 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.\n\n**Long-term improvements:**\n- Enforce device compliance policies requiring Intune management and attestation before granting access to corporate resources.\n- Train users to recognize device code phishing lures — particularly unsolicited requests to visit `microsoft.com\u002Fdevicelogin` and enter a code.\n- Implement a formal device lifecycle management process that ties device registration to approved provisioning workflows.\n\n**Detection measures:**\n- Alert on new device registrations in Entra ID, especially those occurring outside business hours or from unexpected geographic locations.\n- Monitor Entra ID sign-in and audit logs for use of the device code flow, correlating with new device join events.\n- Use Microsoft Sentinel or equivalent SIEM rules to flag access tokens issued via device code grants to previously unseen device IDs.",[12,13,14,15,16],"MITRE ATT&CK T1528: Steal Application Access Token","MITRE ATT&CK T1098.005: Account Manipulation: Device Registration","NIS2 Article 21(2)(j)","NIS2 Article 21(2)(i)","CIS Control 6: Access Control Management (v8)",{"NIS2 Article 21(2)(i)":18,"NIS2 Article 21(2)(j)":19,"CIS Control 6: Access Control Management (v8)":20,"MITRE ATT&CK T1528: Steal Application Access Token":21,"MITRE ATT&CK T1098.005: Account Manipulation: Device Registration":22},"This point covers access control and asset management; restricting device registration rights and maintaining an inventory of enrolled devices would have prevented and detected the rogue Entra ID registrations.","This point requires multi-factor authentication and secured communications; had device code flow been blocked and strong MFA enforced at the Conditional Access level, the rogue registration path would have been closed.","CIS Control 6 requires that access privileges and device-level permissions be tightly managed and regularly reviewed, which would have prevented unauthorized device enrollment in the tenant.","The device code phishing flow is used to steal OAuth tokens, which the attacker then uses to authenticate as the victim without needing credentials.","The threat actor explicitly registers rogue devices in Entra ID to maintain persistent access that survives credential resets — the exact technique this sub-technique describes.","published","2026-12-03T15:22:28.852552+00:00","2026-12-03T15:22:28.836+00:00",{"id":7,"url":27,"slug":28,"title":29},"https:\u002F\u002Fwww.huntress.com\u002Fblog\u002Fdevice-code-phishing-m365-registrations","m365-device-code-phishing-campaign-leads-to-hundreds-of-rogue-entra-id-registrat-74b1d8","M365 Device Code Phishing Campaign Leads to Hundreds of Rogue Entra ID Registrations",[31,37],{"id":32,"name":33,"slug":34,"description":35,"color":36},"1ec88fde-2d0f-4ed8-932a-33f5ccc0fdc7","Access Control","access-control","Excessive privileges, missing MFA, weak auth","#f97316",{"id":38,"name":39,"slug":40,"description":41,"color":42},"7261eb8f-acd4-4d93-a489-7fdd652ec0ea","Security Awareness","security-awareness","Phishing, social engineering, human error","#22c55e",[],[45,49,53],{"slug":46,"name":47,"problem":48},"phishing-resistant-mfa","Phishing-resistant MFA","A stolen password, or a user who taps Approve on a push prompt, is no longer enough to log in.",{"slug":50,"name":51,"problem":52},"identity-threat-detection","Identity threat detection and response (ITDR)","Attackers who log in with real, stolen credentials get noticed.",{"slug":54,"name":55,"problem":56},"endpoint-detection-response","Endpoint detection and response (EDR and XDR)","Malware and hands-on-keyboard attackers on laptops and servers get spotted and stopped."]