Microsoft Entra ID Compromised: A New Wave of Device Code Phishing
A sophisticated phishing campaign has successfully infiltrated Microsoft Entra ID tenants across 305 organizations, with attackers planting 468 rogue devices. This alarming breach, detailed by Huntress, exploits a legitimate Microsoft sign-in method to gain persistent access to sensitive corporate data. The campaign, active in November, registered devices tied to 326 user identities, each bearing a distinctive “MH-” prefix followed by 16 hexadecimal characters.
Table of Contents
This attack vector, known as device code phishing, targets devices not easily capable of handling traditional password prompts, such as smart TVs or printers. Victims are lured to enter a code on a seemingly legitimate Microsoft page. Unbeknownst to them, the attacker, who generated this code, receives authentication tokens that grant access to the victim’s account, bypassing standard security protocols.
Exploiting Trust: The Device Code Phishing Mechanism
The attackers employed a lure disguised as an Adobe-protected Non-Disclosure Agreement (NDA). Upon user approval of the displayed code, the threat actor received both access and refresh tokens. These tokens were then redeemed via an automated Python script from a different IP address.
This process enabled the registration of a new, attacker-controlled device within the organization’s Microsoft Entra ID. This registration grants the attacker a Primary Refresh Token (PRT), a critical credential for single sign-on (SSO) to Microsoft services. Crucially, a PRT obtained through phishing remains valid even after the user changes their password, and it can satisfy Conditional Access policies that require registered devices.
Persistent Access and Data Exfiltration Channels
With the PRT in hand, attackers gained access to vital Microsoft services including Office, OneDrive, SharePoint, and Exchange. The researchers emphasized that a simple password reset is insufficient to revoke this access; the rogue device must be explicitly deleted from the Entra ID tenant. This highlights a significant blind spot in incident response for many organizations.
The malicious sign-ins were routed through residential proxy networks, predominantly using US and UK broadband connections. This tactic ensured that no single IP address was associated with more than two victims, making detection and attribution exceedingly difficult. The use of such distributed infrastructure complicates efforts to block malicious activity based on IP reputation alone.
Technical Underpinnings: ROADtools and Default Builds
A key indicator of the attack’s methodology was the consistent use of Windows build 10.0.19041.928 across all rogue devices. This specific build is the default hardcoded version within ROADtools, an open-source toolkit designed for both offensive and defensive security operations within Microsoft Entra ID environments.
The threat actor appears to have leveraged the ROADtools public toolkit to automate the device registration process. This reliance on a known, publicly available tool suggests a degree of technical proficiency but also provides a traceable element for security analysts. The specific Windows build is from a release that Microsoft officially stopped supporting in 2021, adding another layer of potential detection.
Identifying Rogue Devices: Hardware Identifiers and Naming Conventions
The rogue devices lacked any hardware identifiers, a detail that Huntress recommends administrators scrutinize in their audit logs. Furthermore, 46 of the “MH-” named devices were found in multiple organizations, with one appearing in 24 different organizations over a mere 10-day period. The method behind the generation and reuse of these names remains unclear, posing a challenge for proactive threat hunting.
In parallel, the attacker also utilized datacenter IP addresses for scripted sign-ins, rotating to a new IP every few days. Five such addresses targeted 361 accounts across 337 organizations, resulting in 1,186 failed and 197 successful sign-ins. This dual approach, combining residential proxies for initial compromise and datacenter IPs for sustained activity, demonstrates a well-orchestrated campaign.
Microsoft Defender XDR Visibility and Operational Groupings
Visibility into this attack varied significantly based on an organization’s licensing and security configurations. Microsoft Defender XDR, while a powerful tool, only provides insights into the services a tenant licenses and connects. Of the organizations with an “MH-” device, only 36 had Defender connected to Huntress’s telemetry.
Within those 36 organizations, 47 victims were identified, and Defender XDR successfully raised an incident for 25 of them. This disparity underscores the importance of comprehensive security monitoring and integration with threat intelligence platforms. Huntress has grouped the observed activity into three distinct operations, each employing different device naming patterns and tools, with one bearing resemblance to GraphSpy, an open-source tool for Microsoft 365 account testing.
Attribution Challenges and Similar Threat Actor Activity
Currently, no definitive link has been established between these operations and a known threat actor. However, Microsoft itself documented a similar attack chain in February 2025, attributing it to a group it tracks as Storm-2372. This connection suggests a persistent and evolving threat landscape targeting cloud identity services.
The increasing sophistication of attacks against cloud identity platforms like Microsoft Entra ID mirrors broader trends in the cybersecurity landscape. As organizations rely more heavily on cloud services, the security of their identity and access management becomes paramount. This incident serves as a stark reminder of the need for continuous vigilance and adaptation of security strategies.
Mitigation Strategies and Administrative Best Practices
For organizations discovering rogue devices within their Microsoft Entra ID, Huntress strongly advises immediate action. This includes deleting the unauthorized device, revoking all associated user sessions, and resetting the compromised account’s credentials. Prompt remediation is critical to containing the breach and preventing further unauthorized access.
Proactive measures are equally vital. Limiting the number of devices a user can register or join, and enforcing Multi-Factor Authentication (MFA) specifically for device registration, can significantly deter such attacks. These controls add crucial layers of security to the device onboarding process.
Leveraging Conditional Access and Advanced Security Features
Organizations with Entra ID P1 licensing or higher possess the capability to block device code authentication entirely through Conditional Access policies. This is a powerful preventative measure that can nullify the effectiveness of this specific phishing technique. Implementing such policies requires careful planning to avoid disrupting legitimate device registrations.
The ongoing evolution of cyber threats necessitates a robust and adaptive security posture. As seen with this Microsoft Entra ID attack, attackers are constantly finding new ways to exploit legitimate functionalities. Staying informed about emerging attack vectors and implementing layered security defenses is crucial for protecting organizational assets in the cloud.
The Evolving Threat Landscape and AI Security
The complexity of this attack underscores the growing need for advanced security solutions. The surge in demand for frontier intelligence, which unlocks AI growth, also highlights the increasing importance of securing AI systems themselves. As AI agents become more autonomous, the ability to detect and manage risks in real-time becomes critical, as explored in our coverage of AI agent detection. Protecting cloud infrastructure, especially identity management systems like Microsoft Entra ID, is a foundational element of overall cybersecurity resilience.
The continuous arms race between attackers and defenders requires organizations to stay ahead of the curve. Regular security audits, employee training on phishing awareness, and the adoption of advanced security technologies are no longer optional but essential components of a comprehensive security strategy. The compromise of Microsoft Entra ID serves as a potent reminder of these ongoing challenges.
Field Readiness and Verdict: A Call for Enhanced Entra ID Security
The successful infiltration of 305 organizations via rogue devices in Microsoft Entra ID demonstrates a significant capability gap in current cloud identity defenses. The attackers’ methodical approach, leveraging readily available tools and sophisticated evasion techniques, highlights the persistent threat posed by advanced phishing campaigns.
The PRT’s ability to persist post-password reset and bypass Conditional Access policies presents a critical vulnerability. Organizations must move beyond traditional password-centric security models and embrace a zero-trust architecture, where every access request is verified, regardless of origin or device registration status.
Recommendations for Administrators and Security Teams
Huntress’s recommendations—deleting rogue devices, revoking sessions, and resetting credentials—are essential immediate responses. However, long-term prevention requires a strategic shift. Implementing stricter device registration policies, enforcing MFA for all authentication factors, and leveraging advanced threat detection capabilities are paramount.
The reliance on outdated Windows builds and the use of default ROADtools configurations offer clear indicators for detection. Security teams should actively hunt for these anomalies within their Entra ID logs. Proactive monitoring and rapid response are key to mitigating the impact of such sophisticated attacks.
The Verdict: A Critical Vulnerability Requiring Urgent Attention
This incident serves as a critical wake-up call for organizations relying on Microsoft Entra ID. The ease with which attackers can plant rogue devices and gain persistent access is deeply concerning. While Microsoft provides robust security features, their effective implementation and continuous monitoring are the responsibility of the end-user organizations.
The ongoing evolution of cyber threats, including those targeting cloud infrastructure and AI systems, demands a proactive and layered security approach. The compromise of Microsoft Entra ID underscores the need for organizations to invest in comprehensive security solutions and maintain a state of constant readiness against emerging threats.
Source: Help Net Security
Source URL: https://www.helpnetsecurity.com/2026/12/04/microsoft-entra-id-device-code-phishing/


