Hackers Plant Rogue Devices in Microsoft Entra ID via Device Code Phishing
A sophisticated phishing campaign has successfully registered hundreds of attacker-controlled devices in the Microsoft Entra ID tenants of over 300 organizations.

A widespread device code phishing campaign has resulted in the registration of 468 attacker-controlled Windows devices within the Microsoft Entra ID tenants of 305 organizations. The campaign, identified by security researchers at Huntress, primarily occurred in November and leveraged a legitimate Microsoft sign-in method to compromise user accounts.
The technique abuses Microsoft's device code authentication flow, a feature designed for devices that cannot easily accept password prompts, such as smart TVs or printers. Attackers trick victims into entering a code on a legitimate Microsoft page, which then grants the attacker access tokens. These tokens are subsequently used to register a new, malicious device within the victim's Entra ID environment.
Once a rogue device is registered, attackers obtain a Primary Refresh Token (PRT). This credential is crucial as it enables single sign-on to Microsoft services and, critically, persists even after the victim changes their password. The PRT can also bypass Conditional Access policies that rely on device registration for access, allowing attackers to gain entry to services like Office, OneDrive, SharePoint, and Exchange.
Researchers noted that the rogue devices consistently reported a specific Windows build (10.0.19041.928), which is the default for the open-source toolkit ROADtools. This suggests the threat actor is likely utilizing this toolkit, which is designed for both offensive and defensive security operations, to automate the device registration process. The use of this default build, along with the absence of hardware identifiers on the devices, are key indicators for administrators to look for in audit logs.
The malicious activity was routed through residential proxy networks, primarily from US and UK broadband connections, with no single IP address being used against more than two victims. This distributed approach makes attribution and blocking more challenging. In parallel, the attacker also employed datacenter IP addresses for scripted sign-ins, rotating through new addresses every few days.
Microsoft Defender XDR's visibility into these attacks was limited, as only a fraction of the affected organizations had Defender connected to Huntress's monitoring. Of the organizations with an "MH-" prefixed device, only 36 had Defender connected, and it successfully raised an incident in 25 of those cases.
Huntress has grouped the observed activity into three distinct operations, each employing different device naming conventions and tools, with one operation showing similarities to GraphSpy, another tool capable of capturing tokens from device code sign-ins. While no specific threat actor has been definitively linked, Microsoft has previously documented similar attack chains associated with a group it tracks as Storm-2372.
To mitigate this threat, organizations are advised to delete any rogue devices found in Entra ID, revoke associated user sessions, and reset credentials. Proactive measures include limiting device registration permissions, enforcing multi-factor authentication for device registration, and utilizing Conditional Access policies to block device code authentication for tenants with Entra ID P1 licensing or higher.
The new reporting indicates that attackers are leveraging the publicly available ROADtools toolkit to register their own Windows devices within victim Entra ID tenants, thereby maintaining persistent access even after password resets. This method exploits Microsoft's Primary Refresh Token (PRT) mechanism. Additionally, the attackers exhibit a pattern of working primarily during weekdays and often use device names prefixed with 'MH-' followed by hexadecimal characters, providing potential indicators for detection.