# M365 Device Code Phishing Campaign Leads to Hundreds of Rogue Entra ID Registrations

Device code phishing lures gave attackers M365 tokens; they registered rogue Entra ID devices via ROADtools, obtaining PRTs that survived password resets across 326 identities.

- Payout: Real-world hack
- Severity: high
- Program: Microsoft
- Analysis by: Huntress
- Disclosed: 2026-12-03
- Write-up quality: 8/10
- Original: https://www.huntress.com/blog/device-code-phishing-m365-registrations
- Library page: https://bugbountylibrary.com/r/blog%3Ahuntress-com-blog-device-code-phishing-m365-registrations
- Tags: area:cloud domain:cloud impact:ato impact:data-leak kind:incident platform:threat-intel sev:high tech:azure tech:oauth technique:default-creds technique:recon vuln:account-takeover vuln:auth-bypass

**Target:** Entra ID device registration / Microsoft Authentication Broker
**Root cause:** Device code flow lets a victim approve an attacker's session, handing over access/refresh tokens; those tokens can register a new Entra ID device whose Primary Refresh Token persists after password reset because it wasn't obtained with the password.
**Steps:**
1. Lure victim through device code auth flow (fake Adobe-protected NDA) so they approve the attacker's code, yielding access and refresh tokens (CMSI interrupt AADSTS50199).
2. Redeem token via `python-requests/2.32.5` against the Device Registration Service from a datacenter IP.
3. Register a rogue device using ROADtools (build `10.0.19041.928`, no hardware identifiers), named `MH-<16 hex>` or default `DESKTOP-` plus eight characters.
4. Use the new device's Primary Refresh Token to sign into Azure AD, OneDrive, SharePoint, Exchange; PRT survives password reset.
**How found:** Huntress correlated Defender XDR device-code-phishing incidents with Entra audit logs showing new devices reporting ROADtools' hardcoded build 10.0.19041.928 with no hardware identifiers; pivoting on device name/build across tenants revealed the MH- pattern and shared infrastructure.
**Exploitation:** Victims phished via device code flow from residential proxies (DataImpulse, Oxylabs, etc.), each IP limited to two victims. Tokens redeemed from rotating datacenter IPs to register rogue devices; resulting PRTs gave SSO access to M365 apps and satisfied device-based Conditional Access, persisting after credential resets until the device is deleted.
**Escalation:** PRT persistence survives password reset and satisfies registered-device Conditional Access; reused device names across orgs and scripted sign-ins scaled to 468 registrations across 326 identities in 305 organizations.
**Insight:** Rogue device registrations are a durable persistence signal: hunt Entra audit logs for devices reporting stale hardcoded tool builds (e.g. ROADtools 10.0.19041.928) with no hardware identifiers, and pivot on device name across tenants — deleting the device, not resetting the password, is what revokes the PRT.

## Proof of concept (copied exactly from the original report)

**Regex hunt for MH- rogue device names**

```
^MH-[0-9A-F]{16}$
Device name pattern
```

**ROADtools default device name and build**

```
ROADtools registers devices with build 10.0.19041.928 and, unless told otherwise, names them DESKTOP- followed by eight characters. Both defaults appear across these registrations. The MH- operator keeps the ROADtools build but replaces the default name. GraphSpy-Device is the default device name in GraphSpy, another public Entra ID toolkit.
ROADtools' default random names use uppercase letters and digits, not hex, so the MH- prefix plus 16 hex characters is a deliberate change by the threat actor. ROADtools also registers devices with the user agent Dsreg/10.0 (Windows 10.0.19041.928).
```

**Hunt query for rogue device registrations**

```
Search the Entra audit logs for device registrations where the device name matches MH- plus 16 hex characters, or the build is 10.0.19041.928, 10.0.19045.2006, 10.0.19045.0 or 10.0.26100 with no hardware identifiers.
```

