← All hunts high TLP:CLEAR

Microsoft Teams Booking Device Code Phishing

An attacker is using a multi-stage redirect chain and a convincing Microsoft Teams booking lure to trick users into authorizing a device code, subsequently replaying the stolen session tokens via residential proxies using programmatic tools.

Based on research by Huntress 2026-11-14 12 steps · 5 queries T1027.013 T1090 T1204.001 T1528 T1539 T1550.004 T1557 T1566.002 T1684.001

Brief

Why

NowaaRecent research from Huntress (https://www.huntress.com/blog/crafty-microsoft-teams-booking-flow-disguises-device-code-phishing) describes a campaign targeting organizations through convincing Teams booking lures. The adversary avoids traditional credential harvesting, opting for device code flows that bypass many MFA configurations. This hunt identifies the specific sequence of redirects and token replays used in these attacks.aa

The

HypothesisaaAn attacker uses a multi-stage redirect chain and a Microsoft Teams booking lure to trick users into authorizing a device code, subsequently replaying stolen session tokens via residential proxies using programmatic tools like Python or Node.js.aa

Phase 1: Scoping the

SurfaceaaThe hunt begins by identifying the potential targets within the environment. The analyst identifies hosts with Microsoft Teams installed via software inventory logs. This scoping ensures the subsequent telemetry focus remains on the systems where the lure is most likely to execute. While many organizations use Teams, focusing the search on these hosts reduces noise during the web-telemetry phase.aa

Phase 2: Redirection and Backend

TrafficaaThe adversary uses a sequence of redirects involving Google short links and Railway domains to reach the phishing kit. The hunt queries DNS records for these specific redirectors and scans HTTP traffic for requests to the attacker’s backend API. It specifically flags any interaction with the /api/device/start endpoint, which signals the beginning of the device code flow. This phase identifies users who engaged with the lure before any identity-based activity occurs.aa

Phase 3: Identity Abuse and Rare

AgentsaaOnce the analyst identifies interaction with the phishing site, the hunt transitions to the identity surface. The hunt searches M365 and Azure AD logs for the ‘Cmsi:Cmsi’ login flow. This tag appears during the device code process. Simultaneously, the query stacks user agents across the environment to find rare programmatic access from Python or Node.js scripts. This rarity indicates programmatic session replay rather than standard user activity from a browser.aa

Phase 4: Multi-Surface

CorrelationaaA single sign-in or a single DNS query might appear as noise. The hunt uses an automated agent to correlate these disparate signals. It confirms a compromise when a user interacts with the phishing infrastructure and then exhibits anomalous identity activity within a specific timeframe. This correlation logic provides the high-confidence verdict required for a response, moving the workload from simple detection to a true hunt.aa

What This Hunt Cannot

SeeaaThe hunt cannot see the kit's internal execution if it decrypts purely in memory on the client side. If the attacker routes their programmatic tools through high-reputation residential proxies, the source IP may look like a legitimate remote worker, making it difficult to detect based on location alone. The hunt relies on the specific Cmsi login flow and the presence of programmatic user agents.aa

Steps

  1. Identify potential targets with Microsoft Teams

    Query · scoping

    Identify hosts that have Microsoft Teams installed, as they are the primary targets for this specific lure.

    reads hb_software_inventorysql
    SELECT device_hostname, package_name, package_version FROM hb_software_inventory WHERE LOWER(package_name) LIKE '%teams%'

    What a hit looks like. A list of hosts where Teams is present. Silence indicates no Teams installation was visible to the inventory provider.

  2. DNS resolutions for phishing redirectors

    Query · enrichment

    Identify hosts resolving domains used in the attacker's multi-stage redirect chain.

    reads hb_dns_activitysql
    SELECT device_hostname, query_hostname, time FROM hb_dns_activity WHERE (instr(',' || '{{redirect_domains}}' || ',', ',' || LOWER(query_hostname) || ',') > 0 OR instr(',' || '{{phishing_backend}}' || ',', ',' || LOWER(query_hostname) || ',') > 0) AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')

    What a hit looks like. Hosts resolving the known malicious or redirector domains. Silence means the lure was not triggered or used different domains.

  3. HTTP traffic to the phishing kit API

    Query · detection candidate

    Find direct HTTP requests to the attacker backend, specifically the /api/device/start endpoint described in the research.

    reads hb_http_activitysql
    SELECT device_hostname, url_hostname, url_path, user_agent, time FROM hb_http_activity WHERE (instr(',' || '{{phishing_backend}}' || ',', ',' || LOWER(url_hostname) || ',') > 0 OR LOWER(url_path) LIKE '%/api/device/%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')

    What a hit looks like. Traffic matching the known backend infrastructure and API patterns. Silence suggests no active engagement with the kit.

  4. Triage early lure interaction

    Agent triage

    Analyze the web telemetry to identify specific hosts or users who likely completed the phishing booking flow.

  5. Sign-ins with Cmsi login flow

    Query · triage

    Identify device code authentication events tagged with the Cmsi:Cmsi flow, as identified in the Huntress research.

    reads hb_auth_signinsql
    SELECT actor_user_name, src_endpoint_ip, src_location_country, user_agent, event_type, status_detail, time FROM hb_auth_signin WHERE provider IN ('m365', 'azure_ad') AND (LOWER(event_type) LIKE '%cmsi:cmsi%' OR LOWER(status_detail) LIKE '%cmsi:cmsi%') AND time >= datetime('now', '-{{lookback_days}} days')

    What a hit looks like. Logins explicitly using the device code flow pattern associated with the campaign. Silence means no successful device code flow was recorded with this specific tag.

  6. Prevalence of programmatic user agents in sign-ins

    Query · baseline

    Stack-count user agents to identify rare programmatic sign-ins (Python, Node) that stand out from standard browser traffic.

    reads hb_auth_signinsql
    SELECT LOWER(user_agent) AS ua, COUNT(DISTINCT actor_user_name) AS users, COUNT(*) AS signins, MIN(time) AS first_seen FROM hb_auth_signin WHERE provider IN ('m365', 'azure_ad') AND (instr(',' || '{{programmatic_uas}}' || ',', ',' || LOWER(user_agent) || ',') > 0 OR LOWER(user_agent) LIKE 'python%' OR LOWER(user_agent) LIKE 'node%') AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY LOWER(user_agent) HAVING users <= 3 ORDER BY users ASC

    What a hit looks like. A programmatic user agent seen for only a few users, suggesting attacker automation replaying session tokens. Standard browser traffic should be common across the fleet.

  7. Correlate attack chain across surfaces

    Agent triage

    Link the web-based lure interaction from Phase 1 with the identity-based session abuse in Phase 2 for each user.

  8. Route on evidence of compromise

    Decision

    Route the investigation based on whether the agent found a correlated attack chain for any account.

  9. Revoke sessions and isolate identity

    Response action

    Terminate the attacker's replayed session and prevent further access.

  10. Forensic analyst review

    Analyst task

    Confirm the agent's findings and investigate the extent of post-compromise activity.

  11. Close out hunt

    Analyst task

    Document results and tune parameters for future runs.

Coverage

Scenario coverage

StageCoveredHow, or why not
Multi-stage Phishing Redirects
T1566.002
Yes dns-redirect-chain
Teams Booking Lure Interaction
T1204.001 · T1027.013 · T1684.001
Yes http-phishing-interaction, triage-early-interaction
Device Code Token Theft
T1528 · T1539 · T1557
Yes anomalous-cmsi-logins
Session Replay via Residential Proxy
T1550.004 · T1078.004 · T1090
Yes programmatic-ua-prevalence, correlate-attack-chain

Blind spots

  • Needs Endpoint script memory inspection. The kit is delivered as ciphertext and decrypted client-side; network sensors only see an encrypted blob, making it difficult to prove the kit ran. It would answer Whether the phishing kit successfully decrypted and executed in the user's browser.
  • Needs Residential IP reputation feed. The attacker routes traffic through residential proxies; without specialized threat intelligence, these sign-ins appear as legitimate remote employees. It would answer Whether the source IP for a sign-in is a legitimate residential address or a known callback proxy node.

Parameters & data

Parameters

ParameterTypeDefaultWhat it is
lookback_daysnumber14Days of history to examine.
phishing_backendlist[domain]gpimmlgration.com, cloudflare.comDomains hosting the phishing kit backend or lure page.
programmatic_uaslist[string]python-requests, nodeProgrammatic user agents used for session replay and automation.
redirect_domainslist[domain]share.google, railway.com, safelinks.protection.outlook.comDomains observed in the initial redirection chain.
scope_hostslist[host]—Limit the hunt to specific hosts; leave empty to hunt across the entire estate.

Telemetry

SourceCategoryTelemetry
Endpoint telemetry (hb_ surfaces)endpointendpoint
Identity / sign-in telemetryidentityidentity
Web server / proxy logssiemnetwork

Source

Download hunt.md Definition (JSON) An open hunt.md file; it runs anywhere that reads the format.
---
analysis: A single detection rule cannot correlate a DNS resolution of a redirector
  (Phase 1) with an anomalous programmatic sign-in (Phase 2) hours later. This phased
  hunt uses an agent to link user behavior across disparate surfaces.
blind_spots:
- id: encrypted-phishing-kit
  question: Whether the phishing kit successfully decrypted and executed in the user's
    browser
  requires: Endpoint script memory inspection
  risk: The kit is delivered as ciphertext and decrypted client-side; network sensors
    only see an encrypted blob, making it difficult to prove the kit ran.
  stage: phishing-infrastructure-interaction
- id: residential-proxy-origin
  question: Whether the source IP for a sign-in is a legitimate residential address
    or a known callback proxy node
  requires: Residential IP reputation feed
  risk: The attacker routes traffic through residential proxies; without specialized
    threat intelligence, these sign-ins appear as legitimate remote employees.
  stage: session-replay-and-abuse
coverage:
- stage: initial-access-redirect-chain
  status: covered
  steps:
  - dns-redirect-chain
- stage: phishing-infrastructure-interaction
  status: covered
  steps:
  - http-phishing-interaction
  - triage-early-interaction
- stage: credential-access-device-code
  status: covered
  steps:
  - anomalous-cmsi-logins
- stage: session-replay-and-abuse
  status: covered
  steps:
  - programmatic-ua-prevalence
  - correlate-attack-chain
guardrails:
  claims: no_unsupported
  evidence: citation_required
  missing_data: not_benign
  telemetry: untrusted
hunt:
  applicability: campaign-specific
  handoff: keep-as-periodic-hunt
  justification: Device code phishing bypasses MFA by using the victim's own session.
    This hunt provides a negative result over the estate for a specific, highly-disguised
    campaign identified by recent threat research.
  methodology: model-assisted
  trigger: intel-report
hypothesis: An attacker is using a multi-stage redirect chain and a convincing Microsoft
  Teams booking lure to trick users into authorizing a device code, subsequently replaying
  the stolen session tokens via residential proxies using programmatic tools.
labels:
- hunt
- attack.t1566.002
- attack.t1204.001
- attack.t1027.013
- attack.t1684.001
- attack.t1528
- attack.t1539
- attack.t1557
- attack.t1550.004
- attack.t1090
- credential access
- execution
- initial access
- lateral movement
name: Microsoft Teams Booking Device Code Phishing
parameters:
  lookback_days:
    default: '14'
    description: Days of history to examine.
    type: number
  phishing_backend:
    default:
    - gpimmlgration.com
    - cloudflare.com
    description: Domains hosting the phishing kit backend or lure page.
    from:
      kind: article
      observed: '2026-11-12'
      ref: https://www.huntress.com/blog/crafty-microsoft-teams-booking-flow-disguises-device-code-phishing
    type: list[domain]
  programmatic_uas:
    default:
    - python-requests
    - node
    description: Programmatic user agents used for session replay and automation.
    from:
      kind: article
      observed: '2026-11-12'
      ref: https://www.huntress.com/blog/crafty-microsoft-teams-booking-flow-disguises-device-code-phishing
    type: list[string]
  redirect_domains:
    default:
    - share.google
    - railway.com
    - safelinks.protection.outlook.com
    description: Domains observed in the initial redirection chain.
    from:
      kind: article
      observed: '2026-11-12'
      ref: https://www.huntress.com/blog/crafty-microsoft-teams-booking-flow-disguises-device-code-phishing
    type: list[domain]
  scope_hosts:
    default: []
    description: Limit the hunt to specific hosts; leave empty to hunt across the
      entire estate.
    type: list[host]
provenance:
  authors:
  - name: Huntbase hunt generation
    org: huntbase.io
  generated:
    by: huntbase-hunt-generation
    from: https://www.huntress.com/blog/crafty-microsoft-teams-booking-flow-disguises-device-code-phishing
    gates:
    - dry-run
    - lint
    - critic
    model: hb_google/gemini-3-flash-preview
rationale: Scope to hosts with Microsoft Teams installed. Focus on users in executive
  or finance roles who are more likely to be targeted by such a sophisticated spear-phishing
  lure.
references:
- name: "Huntress \u2014 Crafty Microsoft Teams Booking Flow Disguises Device Code\
    \ Phishing"
  url: https://www.huntress.com/blog/crafty-microsoft-teams-booking-flow-disguises-device-code-phishing
related:
- hunt: m365-token-theft-by-adversary-in-the-middle
  reason: This hunt focuses on device code lures specifically; AiTM attacks like Evilginx
    require different telemetry for proxy interception.
  relation: out-of-scope-alternative
scenario:
  stages:
  - name: Multi-stage Phishing Redirects
    observables:
    - nam12.safelinks.protection.outlook.com
    - share.google/?q=UltJkMsVWI5V9GJM1
    - www.google.com/share.google?q=UltJkMsVWI5V9GJM1
    slug: initial-access-redirect-chain
    tactic: initial-access
    techniques:
    - T1566.002
  - name: Teams Booking Lure Interaction
    observables:
    - gpimmlgration.com
    - X-Antibot-Token
    - X-WinHello
    - X-Automatic-Target-Country
    - X-Visitor-Country
    - Idempotency-Key
    - /static-export/api/device/start
    - AES-256-GCM encrypted phishing kit
    slug: phishing-infrastructure-interaction
    tactic: execution
    techniques:
    - T1204.001
    - T1027.013
    - T1684.001
  - name: Device Code Token Theft
    observables:
    - microsoft.com/devicelogin
    - Cmsi:Cmsi login flow
    - Microsoft Authentication Broker client
    slug: credential-access-device-code
    tactic: credential-access
    techniques:
    - T1528
    - T1539
    - T1557
  - name: Session Replay via Residential Proxy
    observables:
    - python-requests
    - node
    - ASN and region change within same session ID
    - Residential callback proxy traffic
    slug: session-replay-and-abuse
    tactic: lateral-movement
    techniques:
    - T1550.004
    - T1078.004
    - T1090
  summary: This campaign leverages a deceptive Microsoft Teams booking workflow to
    facilitate device code phishing. Attackers lead victims through a multi-stage
    redirect chain to a typosquatted domain hosting an encrypted phishing kit that
    initiates a Microsoft device code sign-in, ultimately capturing OAuth tokens and
    session cookies for account takeovers via residential proxies.
severity: high
targets:
  analyst:
    name: Tier-2 analyst
    role: analyst
  endpoint:
    category: endpoint
    name: Endpoint telemetry (hb_ surfaces)
    telemetry:
    - endpoint
  hunter:
    agent: true
    name: Hunt agent
  identity:
    category: identity
    name: Identity / sign-in telemetry
    telemetry:
    - identity
  web:
    category: siem
    name: Web server / proxy logs
    telemetry:
    - network
tlp: clear
type: investigation
---


# Microsoft Teams Booking Device Code Phishing

This hunt follows the lifecycle of a device code phishing attack identified in recent research. It identifies users who interacted with a typosquatted Teams booking site through a redirect chain involving Google short links and then correlates that web interaction with subsequent anomalous identity events. The follow-on phase looks for the specific 'Cmsi:Cmsi' login flow and session abuse by programmatic user agents (Python, Node) replaying tokens through residential proxies. An agent correlates these two surfaces to confirm successful compromise.

## identify-potential-targets
<!-- Identify potential targets with Microsoft Teams -->
Identify hosts that have Microsoft Teams installed, as they are the primary targets for this specific lure.

```sqlite target=endpoint role=scoping
~~~yaml
expected: A list of hosts where Teams is present. Silence indicates no Teams installation
  was visible to the inventory provider.
reads:
- device_hostname
- package_name
- package_version
silence: not_evidence_of_absence
source: hb_software_inventory
verified: dry-run
verified_at: '2026-11-14'
~~~
SELECT device_hostname, package_name, package_version FROM hb_software_inventory WHERE LOWER(package_name) LIKE '%teams%'
```

## detect-web-indicators
<!-- Detect web-based indicators of the phishing lure -->
parallel:
- → dns-redirect-chain
- → http-phishing-interaction
join: → triage-early-interaction

## dns-redirect-chain
<!-- DNS resolutions for phishing redirectors -->
Identify hosts resolving domains used in the attacker's multi-stage redirect chain.

```sqlite target=endpoint role=enrichment params=(redirect_domains=redirect_domains, phishing_backend=phishing_backend, scope_hosts=scope_hosts, lookback_days=lookback_days)
~~~yaml
expected: Hosts resolving the known malicious or redirector domains. Silence means
  the lure was not triggered or used different domains.
reads:
- device_hostname
- query_hostname
- time
silence: not_evidence_of_absence
source: hb_dns_activity
verified: dry-run
verified_at: '2026-11-14'
~~~
SELECT device_hostname, query_hostname, time FROM hb_dns_activity WHERE (instr(',' || '{{redirect_domains}}' || ',', ',' || LOWER(query_hostname) || ',') > 0 OR instr(',' || '{{phishing_backend}}' || ',', ',' || LOWER(query_hostname) || ',') > 0) AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')
```

## http-phishing-interaction
<!-- HTTP traffic to the phishing kit API -->
Find direct HTTP requests to the attacker backend, specifically the /api/device/start endpoint described in the research.

```sqlite target=web role=detection-candidate params=(phishing_backend=phishing_backend, scope_hosts=scope_hosts, lookback_days=lookback_days)
~~~yaml
expected: Traffic matching the known backend infrastructure and API patterns. Silence
  suggests no active engagement with the kit.
reads:
- device_hostname
- url_hostname
- url_path
- user_agent
- time
silence: not_evidence_of_absence
source: hb_http_activity
verified: dry-run
verified_at: '2026-11-14'
~~~
SELECT device_hostname, url_hostname, url_path, user_agent, time FROM hb_http_activity WHERE (instr(',' || '{{phishing_backend}}' || ',', ',' || LOWER(url_hostname) || ',') > 0 OR LOWER(url_path) LIKE '%/api/device/%') AND ('{{scope_hosts}}' = '' OR instr(',' || '{{scope_hosts}}' || ',', ',' || device_hostname || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days')
```

## triage-early-interaction
<!-- Triage early lure interaction -->
```agent target=hunter
cite: required
context:
- dns-redirect-chain
- http-phishing-interaction
max_iterations: 3
objective: Determine which users likely clicked through the booking lure and triggered
  the device code API based on DNS and HTTP telemetry.
success_criteria: A list of users and timestamps for further session abuse analysis.
tools:
- endpoint
- identity
- web
```

## detect-session-abuse
<!-- Detect session replay and identity abuse -->
parallel:
- → anomalous-cmsi-logins
- → programmatic-ua-prevalence
join: → correlate-attack-chain

## anomalous-cmsi-logins
<!-- Sign-ins with Cmsi login flow -->
Identify device code authentication events tagged with the Cmsi:Cmsi flow, as identified in the Huntress research.

```sqlite target=identity role=triage params=(lookback_days=lookback_days)
~~~yaml
expected: Logins explicitly using the device code flow pattern associated with the
  campaign. Silence means no successful device code flow was recorded with this specific
  tag.
reads:
- actor_user_name
- src_endpoint_ip
- src_location_country
- user_agent
- event_type
- status_detail
- time
silence: not_evidence_of_absence
source: hb_auth_signin
verified: dry-run
verified_at: '2026-11-14'
~~~
SELECT actor_user_name, src_endpoint_ip, src_location_country, user_agent, event_type, status_detail, time FROM hb_auth_signin WHERE provider IN ('m365', 'azure_ad') AND (LOWER(event_type) LIKE '%cmsi:cmsi%' OR LOWER(status_detail) LIKE '%cmsi:cmsi%') AND time >= datetime('now', '-{{lookback_days}} days')
```

## programmatic-ua-prevalence
<!-- Prevalence of programmatic user agents in sign-ins -->
Stack-count user agents to identify rare programmatic sign-ins (Python, Node) that stand out from standard browser traffic.

```sqlite target=identity role=baseline params=(programmatic_uas=programmatic_uas, lookback_days=lookback_days)
~~~yaml
baseline:
  compare: first_seen
  window: '{{lookback_days}}d'
expected: A programmatic user agent seen for only a few users, suggesting attacker
  automation replaying session tokens. Standard browser traffic should be common across
  the fleet.
prevalence:
  by: actor_user_name
  key:
  - user_agent
  rare_below: 3
reads:
- actor_user_name
- user_agent
- time
silence: not_evidence_of_absence
source: hb_auth_signin
verified: dry-run
verified_at: '2026-11-14'
~~~
SELECT LOWER(user_agent) AS ua, COUNT(DISTINCT actor_user_name) AS users, COUNT(*) AS signins, MIN(time) AS first_seen FROM hb_auth_signin WHERE provider IN ('m365', 'azure_ad') AND (instr(',' || '{{programmatic_uas}}' || ',', ',' || LOWER(user_agent) || ',') > 0 OR LOWER(user_agent) LIKE 'python%' OR LOWER(user_agent) LIKE 'node%') AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY LOWER(user_agent) HAVING users <= 3 ORDER BY users ASC
```

## correlate-attack-chain
<!-- Correlate attack chain across surfaces -->
```agent target=hunter
cite: required
context:
- triage-early-interaction
- anomalous-cmsi-logins
- programmatic-ua-prevalence
max_iterations: 5
objective: Determine if any user who interacted with the phishing loader subsequently
  showed signs of session abuse, such as Cmsi logins or programmatic access from anomalous
  IPs.
success_criteria: A per-user verdict citing specific rows from HTTP, DNS, and sign-in
  logs.
tools:
- endpoint
- identity
- web
```

## route-on-evidence
<!-- Route on evidence of compromise -->
if~: "the correlated attack chain shows a user interacting with the lure and subsequent anomalous sign-ins" (confidence: high, judge=hunter)
then: → isolate-identity
indeterminate: → forensic-review
unavailable: → forensic-review (blind_spot: residential-proxy-origin)
else: → close-out

## isolate-identity
<!-- Revoke sessions and isolate identity -->
```action target=identity
~~~yaml
approval: required
~~~
Revoke all active M365 sessions for the compromised user and force a password reset. Review the account for new MFA enrollments or mailbox rules.
```
→ forensic-review

## forensic-review
<!-- Forensic analyst review -->
```manual target=analyst
Verify the correlated events in the raw logs. Check for lateral movement or data exfiltration performed via the programmatic user agents (Python/Node).
```
→ close-out

## close-out
<!-- Close out hunt -->
```manual target=analyst
Record all findings. If the programmatic user agent list is too noisy, refine it to only includes those not typically used for legitimate automation in this environment.
```
→ end

Run it

Take this hunt into your environment.

Open it in Huntbase to run every step against your own connections, with Scout weighing the evidence and your analysts in command. Or take the open hunt.md file anywhere that reads the format.

Machine-drafted by huntbase-hunt-generation using hb_google/gemini-3-flash-preview, gated by dry-run, lint, critic, then reviewed by a person.

Locked pack

Sign up to unlock

Pack contents are available to Huntbase users.