Back to BlogEmail Security Insights

What is device code phishing? The MadApe kit hijacks Microsoft 365 with no fake login page

StopSpoofingMe TeamPublished 7 min read

On October 29, 2026, Group-IB described MadApe, a previously undocumented phishing kit that takes over Microsoft 365 accounts without a fake login page. Victims are handed a code and sent to Microsoft's real device sign-in page. Microsoft recommends blocking device code flow wherever possible, so check whether your business still needs it.

Key takeaways

  • Group-IB says MadApe abuses Microsoft's device code sign-in, so no password is collected on any phishing page.
  • The lures are business-themed PDFs and fake document-sharing pages that imitate SharePoint, OneDrive, Teams, Adobe Acrobat, DocuSign and Microsoft sign-in.
  • Group-IB identified 155 root domains tied to the kit and found device code phishing components on 97 of them.
  • According to Group-IB, a successful device code sign-in may also satisfy multifactor authentication (MFA), so MFA alone does not close this gap.
  • Microsoft's documentation calls device code flow a high-risk authentication method and recommends blocking it wherever possible.

What happened?

On October 29, 2026, the security company Group-IB published research on a phishing kit it tracks as MadApe. Group-IB says it found no earlier public reporting on the kit or its infrastructure, and it assesses MadApe as a distinct, previously undocumented kit.

What sets it apart from classic phishing is what it does not do. According to Group-IB, the campaign reaches Microsoft 365 accounts without collecting a password on any phishing page. Instead of a fake login page, the kit shows the victim a device code and sends them to Microsoft's legitimate device login portal.

What is device code sign-in?

It is a real Microsoft feature. Microsoft's developer documentation says the device code flow lets people sign in to input-constrained devices such as a smart TV, an IoT device or a printer. The device shows a short code, and the user opens a web page on another device, enters the code and signs in. After that, the device is able to get access tokens and refresh tokens. By default, the user has 15 minutes to sign in.

Microsoft's guidance on Teams devices describes the abuse plainly: an attacker can start the flow, send a user a code, and ask the user to enter it on a legitimate Microsoft sign-in page.

How does the MadApe attack work?

Based on Group-IB's description of the kit:

Step What the victim sees What is really happening
1 An email with a business-themed PDF attached, styled as a SharePoint file-sharing notice Localized PDF lures start the chain
2 An in-between page that redirects, then a page that looks like SharePoint, OneDrive, Teams, Adobe Acrobat, DocuSign or a Microsoft sign-in Every template shares one underlying device code workflow
3 A code, and a prompt to enter it on Microsoft's device login page The login page is genuine, but the kit's backend requested the code from Microsoft
4 A normal Microsoft sign-in The victim is approving that sign-in, and Group-IB says a successful one may also satisfy MFA
5 (No further step for the victim) The attacker's client can receive tokens for the permissions granted, which could give access to mailboxes and files and enable further abuse of the account

How big is the operation?

Group-IB identified 155 root domains in MadApe's infrastructure and found device code phishing components on 97 of them. The name comes from the kit's operator panel, whose login page has Mad Ape in its title. Because the panel sits on the same hosts as the phishing pages and decoy websites, Group-IB assesses that all three are run as one deployment. It links the domains to one operator through overlapping traits, while acknowledging that no single clue proves the link.

The report gives no number of victims. Group-IB says it treats the organization and individual names found in the lures and web addresses as intended targets, not confirmed compromises.

Is device code phishing new?

No. Group-IB notes that other kits have used it. On May 21, 2026, the FBI issued a public service announcement about Kali365, a phishing-as-a-service kit that uses the same device code technique against Microsoft 365. Its tips included a Conditional Access policy that blocks device code flow for all users, with limited exceptions.

Why does this matter for your business?

The usual advice does not catch it. Staff are taught to check that a login page is really Microsoft's. Here it is. Microsoft notes that because the sign-in page is real, this attack can be harder for users to recognize.

MFA is not a complete answer. MFA is still essential. But here the victim completes the sign-in personally, and Group-IB says that may satisfy MFA too.

A hijacked mailbox sends real email. Access to a Microsoft 365 account can include its mailbox. Messages sent from a genuine mailbox come from your real domain, so SPF, DKIM and DMARC have nothing to object to. Those checks confirm that a domain authorized a message, not who is at the keyboard. We explained that limit in If a scam email passes SPF and DKIM, is it legit?.

You may be able to switch the feature off. Microsoft says some Teams devices use device code flow, and that some organizations use it for tools such as Azure CLI and developer command-line tools. If none of that describes your business, blocking it may cost you nothing.

What should you do now?

  1. Give staff one simple rule. Never enter a code from an email, a PDF or a web page into a Microsoft sign-in page. Only enter a code that you requested yourself, for a device that is in front of you.
  2. Find out whether you use device code flow. Microsoft says you can filter Microsoft Entra sign-in logs with the authentication protocol filter to find device code flow events. Group-IB also advises reviewing those logs for unexpected device code sign-ins and comparing them with phishing link clicks and later mailbox or file activity.
  3. Block it where you do not need it. Microsoft's instructions use a Conditional Access policy: under Conditions, choose Authentication flows, select Device code flow, and set the grant control to Block access. Microsoft recommends creating the policy in report-only mode first, checking the results, then turning it on, and excluding your emergency access accounts so you cannot lock yourself out.
  4. Check your license. Microsoft says Conditional Access requires Microsoft Entra ID P1 and that customers with Microsoft 365 Business Premium can use it too.
  5. If someone entered a code, act on the session, not just the password. Group-IB warns that a blocking policy should not be assumed to end existing access right away, and advises revoking sign-in sessions and refresh tokens. In Microsoft Entra, the Revoke sessions action invalidates a user's refresh tokens. Group-IB adds that revocation may not immediately invalidate every token, so review recent account activity, application grants, device registrations, inbox rules, forwarding settings and file access. Microsoft's guide for compromised email accounts covers similar checks.
  6. Keep the basics in place. Device code phishing does not depend on forging your domain, but spoofing still happens. Check your SPF, DKIM and DMARC records with our free domain scanner. For sign-in changes, see our post on Microsoft making passkeys the Entra ID default.

If you would like help reviewing sign-in logs or Conditional Access settings, call us at (818) 574-8240.

Frequently asked questions

Does MFA stop device code phishing?

Not by itself. The victim signs in on Microsoft's real page, and according to Group-IB a successful device code authentication may also satisfy MFA checks. Keep MFA switched on, and block device code flow wherever your business does not need it.

Does my business need device code flow?

Possibly not. Microsoft names some Teams devices, Azure CLI and developer command-line tools as places it is used, and recommends allowing it only where necessary. Check your sign-in logs before you block it.

Would DMARC have stopped this attack?

No. DMARC tells receiving mail servers what to do with email that forges your domain in the From address. Device code phishing tricks a person into approving a sign-in instead. You still need DMARC, because it deals with a different problem.

Sources

  1. Group-IB: MadApe: The Code That Opens the Door (October 29, 2026)
  2. FBI Internet Crime Complaint Center: Kali365 Phishing-as-a-Service Kit Hijacks Microsoft 365 Access Tokens (Alert Number I-052126-PSA) (May 21, 2026)
  3. Microsoft Learn: Conditional Access: Authentication flows (undated)
  4. Microsoft Learn: Block authentication flows with Conditional Access policy (undated)
  5. Microsoft Learn: Microsoft identity platform and the OAuth 2.0 device authorization grant flow (undated)
  6. Microsoft Learn: Restrict device code flow for Microsoft Teams devices with Conditional Access (undated)
  7. Microsoft Learn: What is Conditional Access? (undated)
  8. Microsoft Learn: Manage user authentication methods for Microsoft Entra multifactor authentication (undated)
  9. Microsoft Learn: Respond to a compromised cloud email account (undated)

Editor's note: This article was researched and written with AI assistance. Every factual claim was checked against the sources listed above; see our fact-check process for details.

Related Topics

device code phishingMadApe phishing kitMicrosoft 365 account takeoverblock device code flow Conditional Accessdoes MFA stop device code phishingMicrosoft 365 phishing small businesstoken theft phishing

Ready to Secure Your Email?

Check your domain's email security status with our free scanner, or get professional help setting up DMARC, SPF, and DKIM.