Security analysts at Sekoia have observed a marked escalation in device code phishing activity targeting Microsoft 365 environments. This increase is closely associated with the emergence of EvilTokens, a purpose-built phishing toolkit that is actively marketed as a service through Telegram channels.

Understanding Device Code Phishing

Device code phishing represents a manipulation of a legitimate authentication workflow in which attackers coerce users into completing a valid login sequence that ultimately grants adversaries control over access and refresh tokens.

The Legitimate Mechanism

The Device Code Authentication process was originally engineered by Microsoft to support devices with limited input capabilities, such as smart televisions, IoT hardware, and printers. In its intended use case, a user generates a short authentication code on the constrained device, then navigates to an official Microsoft login portal on another device to enter that code and authorize access.

The Phishing Exploitation

Adversaries subvert this legitimate mechanism by initiating a genuine device authorization request and relaying the resulting authentication code, along with a legitimate Microsoft login URL, to a target. The success of the attack hinges on social engineering, where the attacker crafts a convincing pretext—often delivered through links or QR codes—to persuade the user to complete the process. Once the victim enters the code, the attacker leverages Microsoft’s token endpoint to obtain valid authentication tokens, effectively hijacking the session. Because the interaction occurs entirely within a trusted Microsoft workflow, the attacker gains persistent access without requiring credentials or bypassing multi-factor authentication controls.

Advanced Post-Compromise Escalation

Following initial access, more sophisticated threat actors extend their foothold by leveraging stolen refresh tokens to register rogue devices within Entra ID. This device registration enables them to request a Primary Refresh Token, which significantly amplifies their control. With a PRT, attackers can silently authenticate across the entire Microsoft 365 ecosystem, avoid additional authentication challenges such as MFA prompts, and pivot laterally to access broader organizational resources. This progression transforms a single compromised session into a persistent and largely invisible enterprise-wide intrusion.

The EvilTokens Phishing-as-a-Service (PhaaS)

EvilTokens operates as a fully developed phishing-as-a-service platform designed to lower the technical barrier for executing advanced campaigns. The toolkit integrates multiple automated capabilities that streamline both the delivery and operational phases of an attack. It enables the creation of highly convincing lure pages that can be hosted either by the attacker or managed infrastructure, while backend API interactions with Microsoft services are handled programmatically. The platform further incorporates large language model functionality to generate persuasive phishing content and is configured to deliver messages from seemingly reputable sources to evade spam filtering mechanisms.

Phishing Templates and Targets

The platform provides an extensive library of prebuilt phishing scenarios that mimic common enterprise workflows. These include notifications related to email quarantine events, password expiration alerts, document-sharing requests through SharePoint or OneDrive, meeting invitations, eFax communications, and digital signature prompts from services such as DocuSign or Adobe Acrobat Sign. In addition, embedded analytical components—such as AI-driven mailbox inspection and keyword scanning—allow attackers to identify high-value targets by extracting financial data and sensitive communications. Current targeting trends indicate a focus on personnel within finance, human resources, and logistics functions, where access to critical operational or financial data is more likely.

From Niche Tactic to Growing Threat

Although device code phishing has existed for some time, it has historically been overshadowed by more prevalent techniques such as adversary-in-the-middle attacks. The introduction of EvilTokens represents a shift in accessibility and scalability, as it is one of the first widely available platforms to combine device code phishing with integrated post-compromise tooling. The increasing frequency of such campaigns suggests that business email compromise actors are rapidly adopting this approach due to its effectiveness against modern authentication safeguards and its ability to bypass traditional detection mechanisms.

Mitigation and Defense Strategies

Defending against this class of attack requires a layered security model that integrates policy enforcement, user awareness, continuous monitoring, and rapid incident response. Organizations should implement Conditional Access controls to restrict or disable device code authentication wherever feasible, thereby reducing exposure to abuse of this workflow. Equally important is user education, ensuring that employees understand the risks associated with unsolicited authentication prompts and can identify suspicious login requests.

From a detection standpoint, security teams should continuously monitor authentication telemetry for anomalous sign-in patterns, particularly those originating from infrastructure linked to phishing operations. In parallel, incident response procedures must prioritize the immediate revocation of refresh tokens when compromise is suspected, as this action effectively disrupts the attacker’s persistence mechanism. Together, these controls establish a defensive posture capable of mitigating both initial access attempts and post-compromise escalation.