A new Phishing-as-a-Service (PhaaS) platform, dubbed EvilTokens, has emerged, specializing in attacks against Microsoft 365 accounts. The service automates a technique known as device code phishing, which abuses the legitimate OAuth 2.0 device authorization grant flow. This method allows attackers to trick users into authorizing a malicious application, which then grants the attacker powerful access and refresh tokens. Crucially, this attack vector can bypass non-phishing-resistant Multi-Factor Authentication (MFA), such as SMS and push notifications. The EvilTokens platform provides cybercriminals with a complete toolkit, including phishing pages, token harvesting automation, and a post-compromise dashboard, making it easier than ever to gain persistent, password-less access to corporate cloud environments.
The attack exploits the way the device code flow is designed for input-constrained devices. The process is as follows:
user_code.microsoft.com/devicelogin.user_code provided by the attacker and approves the sign-in request, often including an MFA prompt.The attacker now has persistent access to the victim's account via the refresh token, even if the victim's password is changed.
The EvilTokens platform operationalizes this attack.
T1566 - Phishing.T1528 - Steal Application Access Token.T1550.004 - Use Alternate Authentication Material: Web Session Cookie (though in this case, it's a token, the principle is the same).T1114.002 - Email Collection: Remote Email Collection) and launching further attacks.The impact of a successful EvilTokens attack is severe.
No specific IOCs were provided, as the infrastructure is dynamic. The primary indicators are behavioral and related to the use of the device code flow.
Detection:
Authentication App is Microsoft Authentication Broker and the Sign-in event type is device code. Look for successful authentications where the geographic location of the request initiation (the attacker) is different from the location of the authentication completion (the victim). This 'impossible travel' scenario is a high-fidelity indicator of this attack.D3-UGLPA: User Geolocation Logon Pattern Analysis to automatically detect the impossible travel scenarios inherent in this attack.Response:
Tactical (Immediate):
M1042 - Disable or Remove Feature or Program.microsoft.com/devicelogin page, especially if they did not initiate the process themselves. This falls under M1017 - User Training.Strategic (Long-Term):
M1032 - Multi-factor Authentication.Disable the OAuth device code flow via Conditional Access policies if it is not required for business operations.
Migrate to phishing-resistant MFA methods like FIDO2 security keys that are not vulnerable to this type of token theft attack.
Educate users on the specifics of device code phishing and to be suspicious of any unsolicited requests to enter a code.
The most direct and effective countermeasure to the EvilTokens threat is to harden the configuration of Azure AD. If your organization has no legitimate business need for the OAuth device code flow (which is common for most businesses that don't deploy applications on input-constrained devices like smart TVs), it should be disabled entirely. This can be accomplished by creating a Conditional Access policy that targets 'All cloud apps', sets a condition for 'All device platforms', and applies a 'Block' access control. This single configuration change completely removes the attack surface that EvilTokens relies on. This is a prime example of the D3FEND 'Harden' tactic: reducing the attack surface by disabling unnecessary features.
For organizations that cannot disable the device code flow, User Geolocation Logon Pattern Analysis is the key detection strategy. The device code attack creates a distinct 'impossible travel' signature: the device code is requested from one location (the attacker) but authorized in another (the victim). Security teams must configure their SIEM or use Azure AD Identity Protection to specifically alert on this scenario for device code flows. The logic should be: IF (SignInEventType == 'DeviceCode' AND RequestLocation != AuthenticationLocation) THEN trigger HighSeverityAlert. This provides a very high-fidelity detection of an active attack, allowing the incident response team to immediately revoke the stolen tokens and investigate the targeted user's account.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats