What happened: Researchers at Huntress tracked an active phishing campaign that compromised 305 organizations in November. Attackers used a technique called device code phishing to register fake Windows devices inside victims' Microsoft 365 environments — gaining persistent access to OneDrive, SharePoint, and email that survives password resets.
This one is worth understanding because the attack is straightforward, the damage is durable, and the fix requires a step most IT responders skip. Here's what happened and what to look for.
How It Works
Microsoft 365 supports a login method called device code flow — originally designed for devices that can't do browser-based sign-in, like printers or smart TVs. The flow works like this: a device requests a short alphanumeric code from Microsoft, displays it on screen, and asks the user to visit a URL and enter the code to authorize the device.
Attackers have weaponized this flow. The phishing message — arriving by email, Teams, or LinkedIn — asks the target to enter a code at what appears to be a standard Microsoft login page. The URL is genuine. The page is real. The employee completes their normal login and MFA, and thinks nothing happened.
What actually happened: the employee just authorized the attacker's session, not their own. The attacker now has valid Microsoft tokens, which they use to register a rogue Windows device inside the company's Microsoft Entra ID (formerly Azure Active Directory). Once that device is registered, they receive a Primary Refresh Token (PRT) — a long-lived credential that grants access to every Microsoft service the account can reach, including OneDrive, SharePoint, Exchange, and Teams.
Huntress found 468 rogue device registrations across 326 employee accounts at 305 organizations throughout November. The devices were visible in Entra ID device lists the entire time. All of them followed the same naming pattern: MH- followed by 16 uppercase letters and numbers.
Why a Password Reset Doesn't Help
This is the part that matters most. The natural incident response is: we detected unauthorized access, reset the password, done. With this attack, that's not done.
A Primary Refresh Token is tied to the registered device, not to the user's password. When you reset the password, the PRT remains valid. The rogue device is still registered. The attacker can continue requesting new access tokens and reading email, browsing SharePoint, and downloading from OneDrive — without knowing the new password.
The correct remediation order is:
- Find and delete the rogue device from Entra ID first. Look in Microsoft Entra admin center → Devices → All Devices. Filter by registration date and check for
MH-prefixed device names or any device the affected user doesn't own. - Revoke all active sessions for the affected account (in Entra ID, select the user → Revoke sessions).
- Reset the password after the device is removed and sessions are revoked.
Doing steps 2 and 3 without step 1 leaves the attacker's access intact.
How to Reduce the Risk
Device code flow is a legitimate feature but most business users never need it. It can be blocked without affecting normal work for the vast majority of employees:
- Conditional Access policy — Create a policy in Entra ID that blocks the device code authentication flow for all users, with exceptions only for specific devices or service accounts that genuinely need it. This is the most effective control.
- Audit device registrations — Review Entra ID devices periodically. Unknown devices registered to employee accounts are a flag worth investigating.
- Sign-in risk policies — Anomalous device registrations can trigger these if Entra ID P2 licensing is in place. They won't catch everything, but they add a layer.
MFA doesn't stop this attack. The employee completes MFA normally — they're authenticating against a real Microsoft page. The attack works because the authentication succeeds. The issue is what that authentication authorizes, not whether it happens.
What to Check Right Now
If your organization uses Microsoft 365, it's worth a quick look:
- Log into the Microsoft Entra admin center and check Devices → All Devices for anything unfamiliar, particularly recent registrations with
MH-names. - Check Microsoft 365 sign-in logs for any device code authentication events you don't recognize.
- Review whether your Conditional Access policies currently restrict device code flow.
Source: Huntress — Device Code Phishing Campaign, November 2026