Back
Back

Evil Token: AI-Enabled Device Code Phishing Campaign

Evil Token: AI-Enabled Device Code Phishing Campaign

Snowbit by Coralogix – Threat Intelligence Advisory

1. Executive Summary

On April 6, 2026, Microsoft Defender Security Research published an advisory detailing a large-scale phishing campaign that leverages the OAuth Device Code Authentication flow to compromise Microsoft 365 accounts across organizations globally. This campaign represents a significant evolution from manual social engineering to fully automated, AI-driven attack infrastructure.

The campaign is powered by EvilToken, a Phishing-as-a-Service (PhaaS) toolkit that enables threat actors to generate live device codes on demand, bypassing the standard 15-minute code expiration window. Generative AI is used to craft hyper-personalized phishing lures aligned to each victim’s role, with themes including requests for proposals (RFPs), invoices, document sharing notifications, and manufacturing workflows. Since mid-March 2026, Microsoft has observed 10 to 15 distinct campaigns launching every 24 hours, with hundreds of organizations compromised daily.

The attack is particularly dangerous because it bypasses multi-factor authentication (MFA) entirely. When a user enters the device code on Microsoft’s legitimate login portal, they unknowingly authorise the threat actor’s session. 

The attacker then obtains OAuth access and refresh tokens, which are used for email exfiltration, lateral phishing, device registration for persistent access, and creation of malicious inbox rules.

2. What is EvilToken?

EvilTokens is a device code phishing kit sold as a service on Telegram. It’s been around since mid-February 2026 and has picked up traction fast, a separate private channel for paying users, and a whole bot ecosystem handling sales, support, and deployment. 

EvilTokens operates by tricking the victim into authenticating on Microsoft’s real login infrastructure. The victim completes their normal sign-in  including multi-factor authentication on a legitimate Microsoft page, while unknowingly authorising the attacker’s session

Key Features

  • Device code phishing pages impersonating DocuSign, SharePoint, Adobe Acrobat Sign, OneDrive, voicemail alerts, calendar invitations, and email quarantine notices -with live code generation that bypasses the 15-minute expiry window
  • Automated token harvesting – access tokens (60–90 minute validity) and refresh tokens (90-day rolling validity) captured the moment the victim completes authentication
  • Built-in mailbox access allowing attackers to read, search, and exfiltrate email content directly through stolen OAuth tokens
  • AI-powered mailbox analysis that automatically identifies high-value targets and flags financial conversation threads for BEC interception
  • Token persistence mechanisms including device registration for Primary Refresh Token (PRT) acquisition, enabling long-term SSO access that survives password resets

How the attack works

  • The victim receives a phishing email that could be a shared document, an invoice, a voicemail alert, a DocuSign request, whatever fits their role. These lures are often AI-generated and personalised to the target.
  • They click the link. It bounces through a chain of redirects  Cloudflare Workers, Vercel, AWS Lambda, compromised legitimate sites  to dodge URL scanners and sandboxes.
  • They land on a phishing page impersonating something like Adobe Acrobat Sign or SharePoint. The page shows a device code and says something like “verify your identity to access this document.”
  • Here’s the key part: that code is generated live. The moment the victim hits the page, the EvilTokens backend fires a request to Microsoft’s device authorisation endpoint (/oauth2/v2.0/devicecode) and gets back a fresh code with a 15-minute window. This is what solved the timing problem that made older device code phishing impractical.
  • The victim copies the code and clicks “Continue to Microsoft,” which opens the real microsoft.com/devicelogin page. They paste the code, log in with their credentials, complete MFA  all on legitimate Microsoft infrastructure.
  • Meanwhile, the EvilTokens backend is polling Microsoft’s token endpoint. The moment the victim completes auth, the backend grabs the access token (good for 60–90 minutes) and the refresh token (rolling 90-day validity, renews each time it’s used).
  • From there, the attacker has full access to email via Exchange Online, files from OneDrive and SharePoint, Teams conversations, contacts. In more advanced scenarios, they use the refresh token to register a new device in Entra ID and obtain a Primary Refresh Token (PRT), giving them persistent SSO across the victim’s entire M365 environment without ever needing to authenticate again.

2. Threat Overview

2.1 Device Code Authentication Abuse

Device Code Authentication is a legitimate OAuth 2.0 grant type designed for input-constrained devices such as smart TVs, IoT terminals, and CLI tools that cannot support interactive browser-based login. In this flow, a code is presented on one device, and the user authenticates by entering it into a browser on a separate device. Threat actors exploit this mechanism by initiating the device code flow themselves and socially engineering the victim into entering the code, thereby authorising the attacker’s session without any credential exposure.

2.2 Campaign Characteristics

This campaign distinguishes itself from prior device code phishing through several key innovations:

•   Dynamic Code Generation: Unlike static campaigns, codes are generated at the moment the victim interacts with the phishing link, ensuring the 15-minute validity window is never exceeded.

•   AI-Powered Lure Creation: Generative AI produces role-specific phishing emails that reference real business contexts such as invoices, RFPs, and voicemail notifications, significantly increasing engagement rates.

•   Multi-Stage Delivery Infrastructure: Phishing traffic is routed through compromised legitimate domains and high-reputation serverless platforms (Vercel, Cloudflare Workers, AWS Lambda, Railway.com) to evade domain blocklists and URL reputation checks.

•   Browser-in-the-Browser (BitB) Technique: Landing pages simulate legitimate browser windows within the web page, presenting convincing Microsoft login interfaces to the victim.

•   Automated Post-Compromise Operations: Stolen tokens are immediately used via Microsoft Graph API for email enumeration, data exfiltration, inbox rule creation, and lateral phishing – often within minutes of the initial compromise.

2.3 Post-Compromise Activity

Following account compromise, threat actors conducted the following operations:

•   Token Replay: OAuth tokens replayed from cloud hosting infrastructure (DigitalOcean, PacketHub) to access mailboxes without triggering credential-based alerts.

•   Device Registration: New devices registered within minutes to generate Primary Refresh Tokens (PRTs) for long-term persistence.

•   Microsoft Graph Reconnaissance: Automated enumeration of mailbox contents, contacts, and OneDrive files to identify high-value financial data.

•   Lateral Phishing: Compromised accounts used to send phishing emails to thousands of internal and external recipients, leveraging organisational trust.

•   Evidence Destruction: Rapid bulk deletion of emails (Move to Deleted Items, Soft Delete, Hard Delete) at rates far exceeding normal user behaviour, targeting sharing notifications and security alerts.

•   Inbox Rule Manipulation: Creation of forwarding and deletion rules to maintain persistent access and exfiltrate sensitive communications containing keywords such as “payroll” and “invoice.”

3. Attack Chain

The campaign follows a structured multi-phase attack chain:

Phase 1 – Reconnaissance : Threat actors query Microsoft’s GetCredentialType API endpoint to validate whether target email addresses exist and are active within the tenant. This enumeration is conducted well in advance of the phishing attempt.

Phase 2 – Lure Delivery: AI-generated phishing emails are sent to validated addresses. Emails contain either a malicious PDF attachment with embedded links or a direct URL. Lures are tailored to the victim’s role using data harvested from public profiles and corporate directories.

Phase 3 – Redirection Chain: The initial link redirects through multiple layers of serverless infrastructure (Vercel, Cloudflare Workers, Railway, AWS Lambda) before reaching the final phishing page, evading URL scanners and sandbox analysis.

Phase 4 – Device Code Capture: The landing page dynamically generates a live device code via a background script that interacts with the Microsoft identity platform. The code is displayed to the victim alongside a button redirecting to the legitimate Microsoft login portal.

Phase 5 – Token Acquisition: When the victim enters the code and completes authentication (including MFA), the threat actor’s polling script detects the successful authentication and captures the resulting access and refresh tokens.

Phase 6 – Post-Compromise Operations: Tokens are used for email exfiltration, lateral phishing, device registration, inbox rule creation, and evidence destruction.

 4. MITRE ATT&CK Mapping

The following MITRE ATT&CK techniques were observed or are associated with this campaign:

Technique IDTechnique NameTacticObserved Behaviour
T1566.002Phishing: Spearphishing LinkInitial AccessAI-generated phishing emails with role-specific lures directing users to device code authentication pages.
T1528Steal Application Access TokenCredential AccessDevice code flow abused to capture OAuth tokens, granting persistent access without credential exposure.
T1550.001Use Alternate Authentication Material: Application Access TokenDefense EvasionStolen tokens replayed from attacker infrastructure to bypass MFA and session controls.
T1114.002Email Collection: Remote Email CollectionCollectionMicrosoft Graph API used to exfiltrate mailbox contents and identify high-value financial data.
T1078.004Valid Accounts: Cloud AccountsPersistenceCompromised cloud identities leveraged for lateral phishing and sustained access.
T1098.005Account Manipulation: Device RegistrationPersistenceNew devices registered to generate Primary Refresh Tokens for long-term persistence.
T1204.002User Execution: Malicious FileExecutionPhishing PDFs with embedded links to credential harvesting portals.
T1059.006Command and ScriptingExecutionAutomated scripts (python-requests, kali365) used for Graph API interaction and email operations.

5. Indicators of Compromise (IOCs)

TypeIndicatorContext
IP Address167.99.0.116DigitalOcean (ASN 14061), US
IP Address104.248.200.231DigitalOcean (ASN 14061), US
IP Address157.230.53.233DigitalOcean (ASN 14061), US
IP Address159.203.163.96DigitalOcean (ASN 14061), US
IP Address162.243.166.119DigitalOcean (ASN 14061), US
IP Address185.81.126.157PacketHub S.A. (ASN 136787), US
IP Address151.241.19.10DigitalOcean, US
IP Address172.67.152.123Cloudflare, US
IP Address172.67.144.113Cloudflare, US
IP Address2606:4700:3037::6815:388bCloudflare (IPv6), US
User-Agentpython-requests/2.31.0Automated scripting agent
User-Agentkali365-live/1.0.0M365 exploitation toolkit
Domainms-teamsmeeting.topMicrosoft Teams impersonation
Domainmicrosoft365onlineoffice.comMicrosoft 365 impersonation
Domainmicrosoftonlineoffice365.comMicrosoft 365 impersonation
Domainmicrosoftofficeonline365.comMicrosoft 365 impersonation
Domainfilesharebysecureoffice365.comCredential harvesting
Domainoffice365documentbysecuredportal.comCredential harvesting
Domaindocumentsecuredbyoffice365.comMicrosoft impersonation
Domainsharepoint.serverportalreview.comSharePoint impersonation
Domainmscontactmembersheardliners.comMicrosoft impersonation
Domainverifyoff36s5hareddocauthby.bizCredential harvesting
Domainauthverfyupdatebydoc.bizCredential harvesting
Domainonlinedocumentreviewandsign.comFake document signing portal
Domaindocumentsalived.comFake document auth portal
Domainassetstrust.cfdCredential harvesting
Domaincoremessagesecure1x.comPhishing domain
Domainaccountmessage.comPhishing domain
Domainsecure-encryptions.ccPhishing domain
Domainwebviewdoc.comPhishing domain
Domainauth.apparelgate.co.ukAuth portal impersonation
Domainconfirm.ctcafinancial.comPhishing domain
Domaincelestineholdlings.comPhishing domain
Domainnikadent.icuPhishing domain
Domainviesonlinecheck1.comPhishing domain
Domainbookingservicestwo.sbsPhishing domain
Domainloginmicrosoftonline.democrakidsradio.orgMicrosoft login phishing
Domainloginonlinemicrosoftde.democrakidsradio.orgMicrosoft login phishing
Domaindemocrakidsradio.orgMicrosoft login phishing host
Domainedocument-docsign-auth.yakaclicker.comDocument signing impersonation
Domainadobeonlinedocauth.danaevasilis.grAdobe/Microsoft auth impersonation
Domainadobeonlinedocauth.galileu10.com.brAdobe auth impersonation
Domainonlinedocauth.galileu10.com.brAdobe auth impersonation
Domainsedoasiis.comPhishing domain
Domainnoboundseyetech.comPhishing domain
Domainnewmarys.comPhishing domain
Domainconcordisseniorliving.netPhishing domain
Domainmbreysinc.comPhishing domain
Domainpowwowavants.ccPhishing domain
Domainbluemangolove.comPhishing domain
Domainnatmanco.comPhishing domain
Domainschulzscpa.comPhishing host (Cloudflare-proxied)
Domainshares.genixnet.comPhishing domain
Domaindocupdf.kcurb.comPhishing domain
Domaindocument.fredericopovoa.com.brPhishing domain
Domainsentino.villagegreenretirement.comPhishing domain
Domainmarubeni.facilcomputer.comPhishing domain
Domainsupport.softvillasolutions.comPhishing domain
Domainfile.newmarys.comPhishing domain
Domaindouwetiwn.newmarys.comPhishing domain
Domainsecuredocs.newmarys.comPhishing domain
Domainmyoffc.noboundseyetech.comPhishing domain
Domaintues.concordisseniorliving.netPhishing domain
Domainnews.thesocialne.comPhishing domain
Domainanglet.industherm.infoPhishing domain
URLsypgiaacgfdzsxgfsuzr.supabase.co/functions/v1/redirect-handlerSupabase redirect handler used as lure
URLred-snow-4512.cheefu-foo.workers.devCloudflare Worker redirect lure
URLcatalog-assets-cdn.s3.ap-southeast-1.amazonaws.comAWS S3 redirect lure
URLpublic-assets-cdn-host.s3-accelerate.dualstack.amazonaws.comAWS S3 redirect lure
URLcosmosuites.ph/03-secure-file.htmlPhishing domain
URLameethya.com/z2documents/share/index.htmlPhishing domain
URLsafwansteel.com/index.htmlPhishing domain
URLpagosqa.defensadeudores.cl/index.htmlPhishing domain
URLmultiserviciosdelacosta.com/wp-admin/index.htmlCompromised WordPress site as lure
URLatout-precocite.fr/spip.phpCompromised SPIP site used as lure
URLantoniovigilanterepl.hibikeizoku.comRedirect source for credential phishing
URLhttps://sedoasiis.com/l/fRuXbEm89t8Redirects to 167.99.0.116
URLhttps://assetstrust.cfdPhishing domain

6. Detection Alerts Deployed

The following detection alerts have been created or enhanced in the Coralogix SIEM to provide coverage against this campaign and similar identity-based attacks targeting Microsoft 365 environments. These alerts leverage Entra ID (Azure AD) sign-in logs, Identity Protection risk events, and Microsoft 365 Unified Audit Log data.

Log SourceAlert NameDetection Rationale
Entra ID – Identity ProtectionImpossible Travel Detected (atypicalTravel)Flags geographically impossible sign-in patterns indicative of token replay from foreign infrastructure.
Entra ID – Identity ProtectionAnonymized IP Address Sign-inTriggers when sign-ins originate from anonymising proxies, VPNs, or cloud hosting providers commonly used by adversaries.
Entra ID – Identity ProtectionAnomalous Token DetectedDetects tokens with unusual claim structures or unexpected issuance patterns consistent with device code abuse.
Entra ID – Identity ProtectionUnfamiliar Sign-in PropertiesIdentifies sign-ins deviating from a user’s established behavioural baseline (device, location, user-agent).
Entra ID – Identity ProtectionSign-in from New CountryAlerts when authentication originates from a country not previously associated with the user account.
Entra ID – Identity ProtectionToken Issuer Anomaly DetectedFlags discrepancies in the token issuer chain that may indicate a forged or replayed token.
Entra ID – Identity ProtectionSuspicious Browser DetectedDetects sign-ins from automation user-agents (e.g., python-requests, kali365-live) rather than standard browsers.
Entra ID – Identity ProtectionMalicious IP Address Sign-inMatches sign-in source IPs against Microsoft Threat Intelligence feeds for known malicious infrastructure.
Entra ID – Identity ProtectionLeaked Credentials DetectedIdentifies credentials that have appeared in public breach repositories or dark web marketplaces.
Entra ID – Identity ProtectionUser Risk Level Elevated to HighConsolidation alert when multiple risk detections converge to raise a user’s aggregate risk to High.
Entra ID – Sign-in LogsHigh Risk Sign-in (Including Non-Interactive)Captures both interactive and non-interactive sign-ins flagged at medium or high risk by Identity Protection.
Entra ID – Sign-in LogsMultiple IPs on Same Session IDDetects session tokens being used from disparate IP addresses, a hallmark of AiTM token replay.
Entra ID – Sign-in LogsImpossible Travel – Non-Interactive (Multi-Country)Extends impossible travel detection to service-to-service and background token refresh activity.
Microsoft 365 – Unified AuditMass External Sharing in SharePoint / OneDriveTriggers when a user account shares documents or files with a large number of external recipients within a short timeframe.
Microsoft 365 – Unified AuditBulk File Deletion in SharePoint / OneDriveDetects rapid high-volume deletion of files or emails, consistent with anti-forensic evidence destruction.
Microsoft 365 – Unified AuditSuspicious Inbox Rules CreatedAlerts on creation of inbox rules that forward, redirect, or delete emails – a common persistence mechanism.
Microsoft 365 – Unified AuditMass Email Send via Graph APIDetects high-volume email dispatch patterns via Microsoft Graph, especially from non-standard user-agents.

7. Recommendations

The following hardening measures are prioritised based on the direct impact they would have had in preventing or containing this specific campaign. Organisations are advised to evaluate each recommendation against their environment and implement accordingly.

  • Block or Step-Up Authentication from Cloud Hosting Provider IPs : Attacker infrastructure in this campaign consistently leveraged commodity cloud hosting providers (DigitalOcean, PacketHub S.A.) for token replay and automated operations
  • Enable Token Protection and Continuous Access Evaluation (CAE) Enable Token Protection (currently in Preview) within Conditional Access session controls to cryptographically bind session tokens to the device and TLS session that generated them. This directly mitigates AiTM token replay, as stolen cookies containing MFA claims become unusable on attacker infrastructure.
  • Restrict Microsoft Graph API Permissions and Monitor for Abuse : Post-compromise activity relies heavily on Microsoft Graph API for email enumeration, bulk send, and data exfiltration. Implement App Consent Policies to limit which applications can request high-privilege scopes such as Mail.ReadWrite, Mail.Send, Files.ReadWrite.All, and Contacts.ReadWrite.
  • Reduce Token Lifetime and Disable Legacy MFA Bypass Settings: Reduce sign-in frequency to 1 hour for sensitive applications via Conditional Access session controls. Disable the legacy “Remember MFA on trusted devices” setting in Entra ID MFA configuration, as this extends the window for token abuse. Implement sign-in frequency policies that force re-authentication at regular intervals for high-risk applications.
  • Enforce Managed Device Compliance via Conditional Access: Create a Conditional Access policy requiring devices to be Compliant or Hybrid Entra ID Joined for all Microsoft 365 access. In observed incidents, every attacker session originated from unmanaged devices (isCompliant: false, isManaged: false). Since threat actors cannot enrol VPS or cloud infrastructure into an organisation’s Intune tenant, this single control would block the majority of malicious sessions

Note: Several of the controls recommended above such as Token Protection, CAE, advanced Conditional Access policies, and Intune device compliance  require Microsoft Entra ID P1/P2 licensing (included with Microsoft 365 E3/E5 or available as standalone add-ons). These controls are not enabled by default and require explicit configuration within the Entra ID and Intune admin portals.

7. Snowbit Response

The Snowbit security research team has taken the following proactive actions in response to this incident:

  • Immediate IOC enrichment: All network indicators from this advisory have been ingested into the Snowbit threat intelligence platform. Automated alerting is now active across all customer tenants.
  • Detection Alerts Deployed: All alerts has been deployed wherever the azure ad logs are available in customer logs and alerting has been enabled

8. References


On this page