A recent device code phishing campaign has infiltrated Microsoft Entra ID environments, registering over 400 rogue Windows devices across 305 organizations. This malicious operation, detected by Huntress researchers, began in November and targets data theft from resources such as OneDrive, SharePoint, and Exchange. The attackers trick victims into entering a device sign-in code on Microsoft's authentication page, allowing them to gain valid access and refresh tokens, which are then used to register rogue devices and obtain a Primary Refresh Token (PRT). This method provides persistent access to organizational resources via single sign-on, a common tactic among phishing-as-a-service operations.

The attackers employed a distinctive naming pattern for devices, using 'MH-' followed by 16 uppercase hexadecimal characters. During the campaign's peak in early November, 276 devices were registered at 168 organizations. Huntress also noted the use of the ROADtools open-source security toolkit to facilitate these unauthorized registrations, suggesting the tool's potential abuse in this context.

Huntress advises affected organizations to swiftly remove these rogue devices from their Entra ID environments, revoke user sessions, and reset credentials. Failure to remove the devices could allow attackers to maintain access even after password changes, due to the enduring PRT. Users are encouraged to input device codes only when they have initiated the sign-in process themselves. Additionally, Microsoft recommends disabling device-code authentication through Entra Conditional Access where it is unnecessary.