MadApe, a phishing kit newly documented by Group-IB, takes over Microsoft 365 accounts without ever asking for a password, yet its whole attack still depends on one clickable link inside a PDF attachment. Remove that link’s ability to be clicked, and the chain stops before the victim ever reaches the kit.

Group-IB researchers Mansour Alhmoud and Faraz Ali assessed MadApe as a distinct, previously undocumented kit, and Help Net Security reported the findings on 30 November 2026. The kit abuses Microsoft’s legitimate Device Code sign-in flow, so the victim authenticates on a real Microsoft domain and hands the attacker access and refresh tokens instead of a password.

Why device code phishing works

The Device Code flow, formally the OAuth 2.0 device authorization grant, exists so that devices without a keyboard or browser, such as smart TVs and conference room systems, can sign in. The device requests a short user code from Microsoft, and the user types that code at microsoft.com/devicelogin on a phone or laptop. Once the user signs in there, Microsoft issues tokens to the device that asked for the code.

Device code phishing exploits the gap between the device that requests access and the person who approves it. The attacker plays the role of the device, requests a code, and persuades the victim to enter it. The victim sees a genuine Microsoft page, completes a genuine sign-in, and may satisfy MFA in the process, because MFA confirms the identity of the person signing in, not the identity of the device receiving the tokens. Group-IB notes that a successful device code authentication may satisfy MFA requirements, and that the resulting access token, plus a refresh token where supported, gives the operators access to the victim’s mailbox and files.

This makes the technique hard to catch with controls built for classic credential phishing. There is no spoofed login page to detect, no lookalike domain in the final step, and no password to rotate. Microsoft has noted that a generated device code stays valid for only 15 minutes, which is why older campaigns that embedded a static code in the email often failed. MadApe avoids that limitation by fetching a fresh code from Microsoft for every visitor.

Inside the MadApe attack chain

MadApe runs in five stages, and every stage after the first depends on the victim clicking a link inside the email attachment.

Stage 1, the PDF lure. The attack opens with an email carrying a PDF styled as a SharePoint file-sharing notification, with an embedded link to the next stage. Attachment names mostly reference payments, invoices, contracts and account statements, and some emails carry the target organization’s own branding, signatures or forwarded content. Group-IB found the lures localized in at least nine languages: English, Hebrew, German, Portuguese, French, Spanish, Polish, Finnish and Icelandic. Its IOC table lists 40 SHA1 hashes, mostly PDFs plus a few DOCX variants.

Stage 2, the redirect page. The link opens a SharePoint-themed “document access” page. A click shows a 500 ms loading overlay and then runs a JavaScript redirect to a destination hard-coded in each page. Because the destination varies between samples, operators can swap it at will. Some of these pages sit in dedicated directories on compromised legitimate websites, which lends them a clean reputation.

Stage 3, the verification gate. Before the phishing page loads, the visitor must pass a challenge chosen at random: a text CAPTCHA, a text entry field, an image selection or a press-and-hold button. The challenges are custom-built and validated only in the browser. On success the page sets a short-lived _cv=1 cookie with a 300 second lifetime and reloads, and the server serves the phishing page only to requests that carry that cookie. The purpose is to keep automated scanners and URL reputation services from ever seeing the final page.

Stage 4, the device code. The kit’s backend requests a device code from Microsoft and injects it into the page, so the code shown changes on every visit while the template stays the same. When the victim clicks the code, it is copied to the clipboard and the page calls /api/code/entered, which logs the event. An “Open File” button then sends the victim to microsoft.com/devicelogin to paste the code. The page script is also designed to poll /api/code/status/ every five seconds for a “captured” status and a follow-on redirect. Templates impersonate SharePoint, OneDrive, Microsoft Teams, Adobe Acrobat, DocuSign and Microsoft sign-in, including a German-language Teams voicemail lure, and Group-IB describes them as frontend variations of one framework that share JavaScript functions and backend endpoints.

Stage 5, token collection. Out of the victim’s sight, the kit’s server polls Microsoft’s token endpoint until the victim completes sign-in, then collects the issued tokens. The page also suppresses right-click and the F12, Ctrl+Shift+I/J/C and Ctrl+U shortcuts, which deters casual inspection but not analysis with external tools.

Infrastructure built for churn

MadApe’s operators registered domains in bulk and in advance, which means any blocklist built from today’s indicators will trail tomorrow’s campaign. Group-IB mapped 155 root domains: 97 already host kit components on subdomains or URL paths, and the remaining 58 appear staged for later use. Dynadot registered 133 of 154 domains (86.4%), with the rest going through Namecheap and Tucows. Registration was heavily batched, with 105 of 152 domains sharing an exact creation timestamp with at least one other domain, and the largest batch of ten registered at 23:48:21 UTC on 18 August 2026. In 37 of 41 cases, a .net or .co domain was registered on the same day as its .com twin.

Most root domains serve a decoy business page, often for a fictitious “C2S Logistics,” built from one shared template and rebranded for industrial, technology, software and real estate themes. The phishing components live on subdomains such as secure-docs.liveoakfarmsllc[.]net, docusign.cepoffices[.]com and microsoftforms.securemailencryptit[.]com, so the root domain looks like an ordinary small business site to reputation services.

The kit names itself. Its operator panel login, titled “Mad Ape” with an ape logo, is exposed on at least five domains, the earliest being householdwares[.]co on 19 August 2026 at 5.230.194[.]87 (AS12586, ASGHOSTNET GmbH, Germany). Later instances sit behind Cloudflare. Most domains were registered between June and August 2026, registrations continued through September and October, and Group-IB did not attribute the activity to a known threat actor.

Indicator type Examples (defanged)
Phishing and redirect domains securelogin.qimmxn[.]icu, lvborses[.]com, durakdisplay[.]com, neottdesign[.]com, nxinet[.]com
Operator panel domains itencrypted[.]co, householdwares[.]co, liva-fit[.]com, uouso[.]net, wbconnecticut[.]net
Decoy site c2slogistics[.]online
Backend endpoints /api/code/entered, /api/code/status/

The full list of URLs, domains and file hashes is in Group-IB’s report.

The weakest link is the link

Every evasion technique in MadApe protects the stages after the click, and none of them protects the click itself. The kit’s designers invested in a randomized verification gate, decoy business sites, batch-registered domains, compromised redirect hosts and a legitimate Microsoft sign-in page. All of that is reached through one object: a clickable area inside a PDF that looks like a SharePoint “open document” button.

FileDNA CADR vs MadApe

How FileDNA turns the link into plain text

FileDNA CADR ( Content Analysis, Disarm and Reconstruction ) platform, processes attachments at the point of delivery and rebuilds them without active content. For links, that means a clickable hyperlink becomes plain, visible text. The reader can still see what the document says, but clicking does nothing, because the object that made the text clickable is gone.

In a PDF, a clickable link is not the text itself. It is a link annotation, a rectangle on the page bound to an action, most often a URI action that tells the viewer to open an address. MadApe’s SharePoint-styled lures rely on exactly this: a “View document” or “Open file” area mapped to the redirect page. When FileDNA reconstructs the PDF, it drops link annotations and their URI actions and keeps the visible page content. The “Open file” button still appears, but it no longer points anywhere. The same principle applies to the DOCX variants Group-IB found, where hyperlinks are stored as relationships separate from the visible text and can be removed while the words stay.

This breaks MadApe at its entry point, before any of the kit’s evasion has a chance to work. The random verification gate, the decoy business sites, the hard-coded and swappable redirects and the 58 staged domains all assume the victim arrives by clicking. If the click never happens, the victim never sees a device code, never visits microsoft.com/devicelogin on the attacker’s behalf, and the kit’s backend polls Microsoft for tokens that are never issued.

The approach also holds up where indicator-based filtering falls behind. A blocklist must know the destination in advance, but MadApe’s operators register domains in timestamped batches, keep dozens in reserve, host redirects on compromised legitimate sites and change hard-coded destinations between samples. Link-to-text conversion does not need to know where a link goes or whether that destination is malicious today. It removes the clickable path for every link, so a domain registered tomorrow is covered the same way as one listed in today’s IOC feed. It is also unaffected by the verification gate, which exists to hide the final page from scanners: there is nothing to scan when no link is followed.

Pairing content controls with identity controls

FileDNA removes the delivery path, and identity controls remove the payoff, so the strongest posture uses both. Group-IB’s guidance centers on the identity layer.

The most direct control is to block the Device Code flow in Microsoft Entra Conditional Access where the organization does not need it, using the Authentication flows condition with Device code flow selected. Validate the policy in Report-only mode first, since some conference room systems and shared devices legitimately depend on it.

For detection, filter Entra sign-in logs on the Authentication Protocol field to surface device code sign-ins, and review the Original transfer method field to link later activity back to an earlier session. Group-IB recommends hunting for device code sign-ins originating from hosting providers and correlating them with preceding link clicks from PDF attachments, unexpected device registrations, new inbox rules, MailItemsAccessed events and new OAuth consent grants. DNS and web proxy logs can be searched for the published domains and for requests to /api/code/entered and /api/code/status/.

On a confirmed compromise, revoke the user’s sessions and refresh tokens, keeping in mind that access tokens already issued may stay valid until they expire. Group-IB has also published two YARA rules dated 28 October 2026. GIB_MadApe_Phishing_Page matches the phishing page through the microsoft.com/devicelogin string and the /api/code/entered endpoint, and GIB_MadApe_Verification_Gate matches the gate through its _cv=1 cookie and challenge text such as “Hold to Verify.” Both target the web pages rather than the PDF lures, which are covered by the hash list.

Conclusion

MadApe shows how far phishing has moved from fake login pages. The credential step now happens on Microsoft’s own domain, MFA can be satisfied along the way, and the operators maintain a reserve of domains to outlast blocklists. What has not changed is how the victim gets there: a document arrives, and a link inside it gets clicked. Converting those links to plain text at the point of delivery removes that step for every destination at once, and blocking the Device Code flow where it is not needed removes the reward if a lure slips through by another channel. Device code phishing kits such as EvilTokens, Venom, Kali365 and Tycoon2FA’s newer builds follow the same pattern, so the same two layers apply well beyond MadApe.

References

  1. Group-IB, MadApe: Microsoft device code phishing kit
  2. Expert Insights, New MadApe phishing kit abuses Microsoft device code sign-in to steal account tokens
  3. Microsoft Security Blog, Device code phishing and the OAuth 2.0 device authorization grant
  4. Push Security, Device code phishing
  5. Barracuda, Threat Spotlight: Device code phishing is on the rise