Entra ID Device-Bound PRT Replay via First-Party App from Unusual 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 an IP that is not among that user and device's Windows Sign-In or WAM addresses. Replay events are limited to compliant or Intune-managed devices: the stolen cookie keeps the workstation deviceid, so compliant-device Conditional Access can succeed off-box.
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.
Known benign triggers
- A user running Azure CLI, Azure PowerShell, VS Code, Graph CLI, or Visual Studio on a jump host, Cloud Shell, or VPN egress that differs from the workstation's Windows Sign-In IP can match if that activity still presents a compliant or managed workstation deviceid. Validate whether the Graph client ran on the enrolled device before treating the event as cookie theft.
- Microsoft Teams, Microsoft Office, OneDrive SyncEngine, Microsoft Authentication Broker, Outlook Mobile, Bing, Azure Portal, ADIbizaUX, and Office 365 Management are omitted. The rest of the Secureworks known-foci-clients.csv family (Edge, OneDrive, Intune Company Portal, Windows Search, Authenticator, SharePoint, Planner, Power BI, and similar) is omitted for the same reason: routine workstation or mobile Graph whose Microsoft 365 egress often differs from the Windows Sign-In IP without cookie theft. Hunt those app_ids separately if harvest is already confirmed.
- Split-tunnel or dual-homed devices may present different egress IPs for WAM versus Azure CLI. Confirm both IPs belong to the same physical device before raising severity.
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
- 6a9fdaab-b50f-408d-b4da-54719f256d41
- 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: ES|QLTactic: Credential AccessTactic: Defense EvasionTactic: Initial AccessUse 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