# MadApe phishing kit abuses Microsoft 365 Device Code authentication to steal access tokens without passwords

> Group-IB documents MadApe, a previously undocumented phishing kit that uses PDF lures impersonating SharePoint, OneDrive, Teams, Adobe Acrobat and DocuSign to push victims to microsoft.com/devicelogin with an attacker-initiated device code. If the victim completes sign-in, operators can obtain access and, where supported, refresh tokens for mailbox and file access, and the authentication may satisfy MFA. Group-IB mapped 155 root domains, 97 of which host phishing components.

- **Author:** Threadlinqs Team
- **Published:** 2026-11-30T10:18:15Z
- **Last updated:** 2026-11-30T10:18:15Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7067
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-7067.png
- **ID:** TL-2026-7067
- **Severity:** HIGH
- **Category:** PHISHING
- **Status:** ACTIVE
- **Detections:** 9 (1 shown free below) · **IOCs:** 25 (3 shown free below)

## Description

MadApe is a Microsoft Device Code phishing kit reported by Group-IB Threat Intelligence (researchers Mansour Alhmoud and Faraz Ali). No credentials are collected on attacker-controlled pages. The phishing backend requests a device code from Microsoft and embeds the user code in the lure page; the victim copies it (the page's JavaScript cc() function handles display, clipboard copy and logging via navigator.clipboard.writeText, and ne() opens the Device Login page) and enters it at the legitimate microsoft.com/devicelogin. Token polling against Microsoft's token endpoint runs server-side, so if the victim completes sign-in and tenant policy allows, the operator can obtain an access token and, where supported, a refresh token granting mailbox and file access. Because the victim performs the authentication, it may also satisfy MFA.

Delivery chain: a phishing email carries a business-themed PDF (payments, invoices, contracts, account statements; some emails use the target organization's branding, signatures or forwarded-mail content). The PDF's embedded link leads to an intermediary page, either a SharePoint-style 'Secure Document Access' page (redirect after a click and a ~500 ms overlay) or a client-side human-verification gate (randomly selected text CAPTCHA, text entry, image selection or press-and-hold challenge) intended to keep security scanners out; completion sets a short-lived cookie _cv=1 (max-age 300) and reloads. A per-sample targetUrl variable lets operators swap the destination without altering the template. Lure templates impersonate SharePoint, OneDrive, Microsoft Teams (including a German voicemail lure), Adobe Acrobat, DocuSign and Microsoft sign-in, in at least nine languages (English, Hebrew, German, Portuguese, French, Spanish, Polish, Finnish, Icelandic); Hebrew payment-themed lures target recipients in Israel. Pages block right-click and F12/Ctrl+Shift+I/J/C/Ctrl+U, which only hinders casual inspection. Backend endpoints are /api/code/entered and /api/code/status/ (polled every 5 seconds); sequential record IDs reflect backend records, not confirmed victims.

Infrastructure: Group-IB mapped 155 root domains; Device Code components were found on 97 (33 subdomain-only, 54 path-only, 10 both) and the remaining 58 are assessed as staged. 154 were registered in 2026 (117 between mid-June and late August, peak week from 2026-08-17 with 26 registrations), 133 of 154 (86.4%) via Dynadot, and 69% share a creation second with another domain (largest batch: 10 domains at 2026-08-18 23:48:21 UTC). Decoy sites share one 'C2S Logistics — Global Supply Chain Solutions' HTML template. Nine legitimate third-party sites were assessed as likely compromised and used to host redirect pages. The operator panel ('Mad Ape — Login') was first seen 2026-08-19 on 5.230.194.87 (AS12586, ASGHOSTNET GmbH, Germany) and appeared on at least five domains. Group-IB linked everything to one operator via shared code, decoys, naming and registration patterns, while noting no single clue proves it, and does not attribute the activity to any known actor. Group-IB published YARA rules (GIB_MadApe_Phishing_Page, GIB_MadApe_Verification_Gate, dated 2026-10-28; the latter has a flaw where $title is an empty string matching any file) and IOC lists (~300 URLs, 250+ domains, ~50 PDF SHA1 hashes). Victim counts, sectors and confirmed compromises are not reported. Note: Group-IB's blog page and the platform hunt record carry a 2026-11-25 date, while Expert Insights dates both its coverage and the Group-IB research to 2026-10-29; the earlier date is used for first_disclosed.

## MITRE ATT&CK

- T1583.001 Domains
- T1584 Compromise Infrastructure
- T1566.001 Spearphishing Attachment
- T1566.002 Spearphishing Link
- T1204.001 Malicious Link
- T1528 Steal Application Access Token
- T1550.001 Application Access Token
- T1550.001 Application Access Token
- T1684.001 Impersonation
- T1622 Debugger Evasion
- T1497 Virtualization/Sandbox Evasion

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**MadApe Device Code Phishing - Successful Entra ID Device Code Sign-In from Unmanaged Device** (`TL-2026-7067-SPL-001`)

Detects successful Microsoft Entra ID sign-ins using the OAuth 2.0 Device Authorization Grant (device code flow) from unmanaged devices. MadApe PDF lures push victims to microsoft.com/devicelogin with an attacker-initiated code; when the victim signs in, the operator's server-side polling obtains access/refresh tokens (T1528) that can satisfy MFA. Entra sign-in telemetry is the authoritative record of the victim completing the flow, so this fires even when the lure domain is unknown.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1528, T1550.001, T1204.001
- **Data sources:** azure:monitor:aad SignInLogs (index=azure), Microsoft Entra ID SigninLogs
- **Severity:** high
- **Confidence:** high

### Splunk SPL

````spl
index=azure sourcetype="azure:monitor:aad" category=SignInLogs properties.authenticationProtocol=deviceCode properties.status.errorCode=0 earliest=-24h
```MadApe TL-2026-7067 - successful Entra device code sign-ins from unmanaged devices (victim completes microsoft.com/devicelogin)```
| eval user=lower('properties.userPrincipalName'), src_ip='properties.ipAddress', app='properties.appDisplayName', country='properties.location', unmanaged=if(lower('properties.deviceDetail.isManaged')="true",0,1)
| stats count AS signins dc(src_ip) AS distinct_ips values(src_ip) AS src_ips values(app) AS apps values(country) AS countries max(unmanaged) AS unmanaged min(_time) AS first_seen max(_time) AS last_seen BY user
| where unmanaged=1
| convert ctime(first_seen) ctime(last_seen)
````

### Microsoft KQL

```kql
SigninLogs
| where TimeGenerated > ago(24h)
| where ResultType == 0
| where AuthenticationProtocol =~ "deviceCode" or OriginalTransferMethod =~ "deviceCodeFlow"
| extend IsManaged = tostring(DeviceDetail.isManaged), Country = tostring(LocationDetails.countryOrRegion)
| where IsManaged !~ "true"
| summarize SignIns = count(), SourceIPs = make_set(IPAddress), Apps = make_set(AppDisplayName), Countries = make_set(Country), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by UserPrincipalName
| project UserPrincipalName, SignIns, SourceIPs, Apps, Countries, FirstSeen, LastSeen
```

### Sigma

```yaml
title: MadApe - Successful Entra ID Device Code Flow Sign-In
id: a1d3c5e7-1b2f-4c6a-8d90-3e4f5a6b7c01
status: experimental
description: Detects successful Microsoft Entra ID sign-ins that use the OAuth device code flow. MadApe phishing PDFs direct victims to microsoft.com/devicelogin with an attacker-initiated code, letting the operator obtain access and refresh tokens without a password.
references:
    - https://www.group-ib.com/blog/madape-microsoft-device-code-phishing-kit/
    - https://learn.microsoft.com/en-us/entra/identity/conditional-access/policy-block-authentication-flows
author: Threadlinqs Team
date: 2026/11/30
tags:
    - attack.credential_access
    - attack.t1528
    - attack.execution
    - attack.t1204.001
    - attack.defense_evasion
    - attack.t1550.001
logsource:
    product: azure
    service: signinlogs
detection:
    selection:
        AuthenticationProtocol: deviceCode
        ResultType: 0
    condition: selection
falsepositives:
    - Legitimate device code use on input-constrained devices such as shared Teams Rooms, IoT or CLI tooling
    - Administrators using Azure CLI or PowerShell with device code authentication
level: high
```

**Known false positives:**

- Administrators and developers legitimately using Azure CLI / PowerShell device code login
- Shared devices such as Teams Rooms, kiosks or IoT devices that authenticate with device code

**Tuning notes:** Inventory legitimate device code users first (Conditional Access report-only with the Authentication flows condition) and exclude those accounts/apps and compliant corporate egress IPs. Adjust index/sourcetype and the properties.* field names to match your Splunk add-on's Entra sign-in ingestion. Enrich with ASN to prioritise hosting-provider source IPs.

### 8 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- MadApe PDF Lure Delivery - Known Lure Attachment Names and SHA1 Hashes (locked: unlock with TL Creds)
- MadApe Token Reuse - Non-Interactive Sign-Ins from a New IP After a Device Code Sign-In (locked: unlock with TL Creds)
- MadApe Operator Panel Infrastructure - Connections to [indicator] and Panel Domains (locked: unlock with TL Creds)
- MadApe Lure and Staging Domain Access via Web Proxy, Safe Links or Endpoint (locked: unlock with TL Creds)
- MadApe Follow-On - OAuth Application Consent Granted After Token Theft (locked: unlock with TL Creds)
- MadApe Brand-Impersonating Hosts - SharePoint, OneDrive, DocuSign and Adobe Lure Domains (locked: unlock with TL Creds)
- MadApe Post-Compromise - Device Code Sign-In Followed by Inbox Rule, Mail Access or OAuth Consent (locked: unlock with TL Creds)
- MadApe Kit Backend - [indicator] Polling and [indicator] Requests (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (3 of 25)

Defanged, TLP:CLEAR.

- IP address: `5.230.194[.]87`
- Domain: `householdwares[.]co`
- File hash: `e9621f90091b56c712858a27d3a775cde21c6463`

Full set of 25 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [MadApe: The Code That Opens the Door (Group-IB)](https://www.group-ib.com/blog/madape-microsoft-device-code-phishing-kit/)
- [MadApe phishing kit steals Microsoft 365 access without ever asking for a password (Help Net Security)](https://www.helpnetsecurity.com/2026/11/30/madape-phishing-kit-microsoft-365-device-code/)
- [New MadApe Phishing Kit Abuses Microsoft Device Code Sign-In to Steal Account Tokens (Expert Insights)](https://expertinsights.com/?p=63628)
- [MITRE ATT&CK T1528 Steal Application Access Token](https://attack.mitre.org/techniques/T1528/)
- [MITRE ATT&CK T1566.001 Spearphishing Attachment](https://attack.mitre.org/techniques/T1566/001/)
- [Microsoft Learn: Block authentication flows with Conditional Access](https://learn.microsoft.com/en-us/entra/identity/conditional-access/policy-block-authentication-flows)

## Full data

The other 8 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-7067
