A novel exploit method leveraging Beacon Object Files (BOFs) has emerged, enabling attackers to extract Microsoft Entra (formerly Azure AD) tokens from compromised endpoints, even on non-domain-joined or BYOD devices.
This technique sidesteps traditional detection mechanisms and expands access to high-value targets, posing significant risks to enterprise cloud environments.
Attackers often rely on extracting Primary Refresh Tokens (PRTs) from domain-joined devices to maintain access to Entra tenants.
However, as detailed in Matthew Creel’s “Operator’s Guide to Device-Joined Hosts and the PRT Cookie,” PRT-based methods fail on non-domain-joined hosts.
In such cases, attackers faced a roadblock: how to obtain refresh tokens without triggering alerts or requiring privileged access.
TrustedSec’s recently released get_azure_token BOF (by Christopher Paschen) inspired a breakthrough.
The tool initiates an Entra authorization code flow via the victim’s browser, captures the authorization code via a local listener, and exchanges it for tokens.
However, its reliance on http://localhost as a redirect URI limited targets to three FOCI-enabled apps: Azure CLI, Azure PowerShell, and Visual Studio Legacy.
Researchers discovered that repurposing Microsoft’s native client redirect URI (https://login.microsoftonline.com/common/oauth2/nativeclient) bypasses the localhost restriction. This URI, designed for desktop/mobile apps, allows attackers to:
Technical Breakdown: How the Exploit Works
Example Command:
beacon> entra-authcode-flow 1fec8e78-bce4-4a03-aa91-5d88d2d7a83b “User.Read”
(Uses Microsoft Teams’ client ID for stealth) Mitigation Recommendations
This technique highlights the growing sophistication of adversary-in-the-middle (AiTM) attacks against cloud identities.
As JUMPSEC’s TokenSmith and TrustedSec’s tools gain traction, defenders must prioritize monitoring native OAuth flows and hardening Entra configurations.
The proof-of-concept BOF and analysis are available on GitHub, underscoring the urgency for proactive defense measures.
Setting Up SOC Team? – Download Free Ultimate SIEM Pricing Guide (PDF) For Your SOC Team -> Free Download
Attackers abused compromised ConnectWise Cloud Backup credentials to access Microsoft 365 customer environments, prompting ConnectWise…
Anthropic says an internal Claude research model reconstructed how the National Security Agency generated seeds…
Two WordPress Core vulnerabilities can be chained to execute remote code without authentication, according to…
A newly disclosed OpenBSD kernel exploitation chain combines a shared memory accounting flaw with a…
GhostAction attackers have expanded their GitHub credential theft campaign with a second stage that disguises…
Indian authorities have warned that SideCopy hackers are targeting Indian organizations, including academic institutions, with…