Entra ID Device-Bound PRT from Unusual Device IP
Detects a first-party FOCI tooling client (Azure CLI, PowerShell, VS Code, Graph CLI, Azure AD PowerShell, or Visual Studio) redeeming a device-bound Primary Refresh Token (PRT) for Microsoft Graph,…
Description
Detects a first-party FOCI tooling client (Azure CLI, PowerShell, VS Code, Graph CLI, Azure AD PowerShell, or Visual Studio) redeeming a device-bound Primary Refresh Token (PRT) for Microsoft Graph, SharePoint/OneDrive, or Exchange Online from a source IP that has not been seen with that deviceid. Replay events are limited to compliant or Intune-managed devices. Adversaries who steal a WAM PRT SSO cookie replay it off-box; the token keeps the workstation deviceid, so this pair is new even when Windows Sign-In for that device is outside a correlation window.
Detection logic
Its licence does not clear it for publishing here
Sunturai publishes a detection's own text where the licence it arrived under has been reviewed and permits it, and Elastic License 2.0 has not. The query as its source wrote it, its canonical form and the hash that pins this revision are in the workspace record.
Detection requirements
- Platform
- ContainersESXiIaaSIdentity ProviderLinuxmacOSNetwork DevicesOffice SuiteSaaSWindows
The rule states no platform. This is derived from the 4 ATT&CK techniques it maps to.
- Log source category
- event_index
Known benign triggers
- A user who runs Azure CLI, Azure PowerShell, VS Code, Graph CLI, or Visual Studio from a new egress (VPN, hotel, Cloud Shell, jump host) while WAM still attaches a compliant or managed workstation deviceid will match on first sight of that IP. Exception: add known developer and Cloud Shell ranges after confirming the client ran there.
- Microsoft Teams, Office, OneDrive SyncEngine, Authentication Broker, Outlook Mobile, Bing, Azure Portal, and Office 365 Management are omitted because first sight of a mobile or M365 egress IP for those clients is routine.
- Split-tunnel or dual-homed devices can present a new Microsoft 365 egress for tooling clients. Confirm the IP belongs to the enrolled device before treating the event as cookie theft.
MITRE ATT&CK mappings
0 exclusive techniques.This is coverage no other published rule has; it is not this rule's total technique count.
References
| Reference | Cited by |
|---|---|
| github.com/Gerenios/AADInternals | 5from 2 sources |
| github.com/armadin-public/PRTremote | 2 |
| github.com/dmcxblue/ANIMO/blob/master/helpers/scripts/GrabTokenAzureAD/PrtExtractor.cs | 3 |
| github.com/rvrsh3ll/TokenTactics | 3from 2 sources |
| www.armadin.com/blog-posts/prtremote-extract-prt-cookies-remotely-with-interactivetoken-scheduled-task | 3 |
From the source
- At source
- Open at source
- Upstream identifier
- 9e8d9bb5-6d3a-4431-a0d0-8d0475e726a4
- Tagged by the source as
- Data Source: AzureData Source: Microsoft Entra IDData Source: Microsoft Entra ID Sign-in LogsDomain: CloudDomain: IdentityPlatform: Entra IDResources: Investigation GuideRule Type: New TermsTactic: Credential AccessTactic: Defense EvasionUse Case: Identity and Access AuditUse Case: Threat Detection
Licence
- Published under
- Elastic License 2.0Read the licence
- Attribution
- Required
Authorship
- Written by
- Published
- Sep 20, 2026
- Version
- 2