← All hunts medium TLP:CLEAR Part 2 of 2

M365 Session Hijacking and Mailbox Manipulation

An adversary has hijacked an authenticated Microsoft 365 session using stolen cookies, bypassing MFA to create stealthy inbox rules and perform fraudulent financial transactions.

Based on research by Huntress 2026-10-15 11 steps · 3 queries T1133 T1137.005 T1550.004 T1565.002

Brief

Why This Hunt

Adversaries favor session hijacking over credential theft to bypass multi-factor authentication. The Huntress report, ClickFix to BEC in 24 Hours: Tragic Quadrant (https://www.huntress.com/blog/clickfix-bec-tragic-quadrant-doris), details how a fake browser update leads to Business Email Compromise (BEC) within 24 hours. After an attacker steals a session cookie, they access the target inbox without triggering new MFA challenges.

How the Hunt Flows

The hunt starts by querying M365 cloud activity for the creation or modification of inbox rules. We look specifically for rules with minimalist names like ".", "..", " ", or "z". These names are common in BEC attacks because they are easily overlooked by users in the Outlook interface. This step identifies the specific user accounts that might be under attacker control.

Once the hunt identifies a suspicious rule, an analyst or automated agent evaluates the lead. Not every minimalist rule name is malicious, but in the context of a potential BEC, this activity is a high-fidelity gate for the more resource-intensive steps that follow. If the rule is deemed suspicious, the hunt fanned out to investigate both authentication and mailbox impact simultaneously.

The hunt then investigates authentication and mailbox impact simultaneously. The first branch of the parallel investigation examines authentication logs for the flagged users. We look for session concurrency anomalies, such as a shift in the User-Agent string or a change in the source country while a session is active. A sudden move from a known corporate IP to a residential proxy or a different browser type suggests cookie theft.

The second branch of the parallel investigation searches for impact. We look for the technical side effects of BEC: the hard deletion of messages, emptying of folders, or the sending of unauthorized emails. Attackers often delete their own sent messages or incoming replies from victims to keep the legitimate user unaware of the ongoing fraud.

Finally, the hunt synthesizes these points—the suspicious rule, the session anomaly, and the destructive mailbox activity—into a single verdict. If the evidence aligns, the hunt provides an automated action to revoke all active M365 sessions for the user, which kills the stolen cookie.

Blind Spots

This hunt relies on the Microsoft 365 Unified Audit Log (UAL). If UAL is disabled or if the tenant lacks the necessary licensing level for advanced audit features, the signals for rule creation and mailbox deletions are invisible. Additionally, Microsoft logs can experience a latency of several hours. An attacker moving at high speed may complete their objectives before the logs are available for the hunt to process.

In this series

Steps

  1. Lead: Suspicious M365 Inbox Rule Creation

    Query · detection candidate

    Identify the creation or modification of inbox rules with minimalist names like '..' which attackers use to hide mailbox manipulation.

    reads hb_cloud_api_activitysql
    SELECT actor_user_name, resource_name, api_operation, src_endpoint_ip, user_agent, time FROM hb_cloud_api_activity WHERE provider = 'm365' AND (api_operation = 'New-InboxRule' OR api_operation = 'Set-InboxRule') AND (instr(',' || '{{suspicious_rule_names}}' || ',', ',' || LOWER(substr(resource_name, instr(resource_name, '\') + 1)) || ',') > 0 OR LENGTH(substr(resource_name, instr(resource_name, '\') + 1)) <= 2) AND time >= datetime('now', '-{{lookback_days}} days')

    What a hit looks like. A row indicates a rule created with a near-invisible name. Silence indicates no such rules were created via the API in the window.

  2. Evaluate Rule Lead

    Agent triage

    Decide if the identified inbox rule creation warrants a full investigation of the user session.

  3. Gate: Suspicious Rules Detected?

    Decision

    Limit expensive concurrency and impact queries to only those cases where a suspicious rule lead exists.

  4. M365 Session Concurrency Anomalies

    Query · baseline

    Examine the session history for flagged users to find browser-string shifts or proxy use concurrent with the rule creation.

    reads hb_auth_signinsql
    SELECT actor_user_name, user_agent, src_endpoint_ip, src_location_country, is_proxy, MIN(time) as first_seen, MAX(time) as last_seen FROM hb_auth_signin WHERE provider = 'm365' AND status_id = 1 AND ('{{scope_users}}' = '' OR instr(',' || '{{scope_users}}' || ',', ',' || actor_user_name || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY actor_user_name, user_agent, src_endpoint_ip, src_location_country, is_proxy

    What a hit looks like. Users with disparate browser strings or VPN use within the same window. Silence implies single-browser sessions.

  5. M365 Mailbox Impact Actions

    Query · enrichment

    Identify fraudulent emails being sent or the deletion of evidence to hide the attacker's presence, specifically for the flagged users.

    reads hb_cloud_api_activitysql
    SELECT actor_user_name, api_operation, resource_name, src_endpoint_ip, time FROM hb_cloud_api_activity WHERE provider = 'm365' AND ('{{scope_users}}' = '' OR instr(',' || '{{scope_users}}' || ',', ',' || actor_user_name || ',') > 0) AND (api_operation IN ('Send', 'MoveToDeletedItems', 'HardDelete', 'EmptyFolder') OR (api_operation = 'Update' AND LOWER(resource_name) LIKE '%inbox%')) AND time >= datetime('now', '-{{lookback_days}} days')

    What a hit looks like. A burst of email deletions or sends from a user who also showed rule anomalies. Silence indicates no destructive mailbox actions.

  6. Triage Investigation

    Agent triage

    Synthesize the rule creation, the session browser shift, and the mailbox impact to confirm a BEC event.

  7. Route on Verdict

    Decision

    Automate the containment request if the session hijack is confirmed.

  8. Revoke M365 Sessions

    Response action

    Immediately invalidate the stolen session cookie and prevent further unauthorized access.

  9. Analyst Manual Review

    Analyst task

    Provide human oversight for indeterminate or suspicious cases.

  10. Close Out

    Analyst task

    Finalize the hunt and record findings.

Coverage

Scenario coverage

StageCoveredHow, or why not
Session Hijacking and MFA Bypass
T1133 · T1550.004
Yes m365-session-concurrency
Persistence via Hidden Inbox Rule
T1137.005
Yes m365-suspicious-inbox-rules
Business Email Compromise Impact
T1565.002
Yes m365-mailbox-impact-activity
ClickFix Social Engineering Execution
T1204.002 · T1059.004
Out of scope Belongs to another part of the 'ClickFix to BEC in 24 Hours: Tragic Quadrant | Huntress' series.
Browser Session Cookie Theft
T1539
Out of scope Belongs to another part of the 'ClickFix to BEC in 24 Hours: Tragic Quadrant | Huntress' series.

Blind spots

  • Needs Microsoft 365 Unified Audit Log (UAL) to be enabled. If UAL is disabled, rule creations and email deletions are invisible to the hunt. It would answer whether mailbox manipulation occurred.
  • Needs Real-time log ingestion for UAL. M365 UAL logs can have a delay of several hours, meaning the attacker may have already completed the BEC before the hunt sees the signals. It would answer if the attacker is currently active in the mailbox.

Parameters & data

Parameters

ParameterTypeDefaultWhat it is
lookback_daysnumber14Number of days of history to examine for session and mailbox activity.
scope_userslist[string]—The specific users flagged in the lead step; empty means all users.
suspicious_rule_nameslist[string].., ., ..., , zMinimalist or common evasion names used for malicious inbox rules.

Telemetry

SourceCategoryTelemetry
Endpoint telemetry (hb_ surfaces)endpointendpoint
Identity / sign-in telemetryidentityidentity

Source

Download hunt.md Definition (JSON) An open hunt.md file; it runs anywhere that reads the format.
---
analysis: A rule fires on '..' rules; this hunt validates the alert by correlating
  it with browser fingerprints and subsequent data destruction, such as HardDelete,
  reducing noise and providing a clear path to containment.
blind_spots:
- id: no-m365-audit-logs
  question: whether mailbox manipulation occurred
  requires: Microsoft 365 Unified Audit Log (UAL) to be enabled
  risk: If UAL is disabled, rule creations and email deletions are invisible to the
    hunt.
  stage: hidden-inbox-rule-persistence
- id: m365-log-latency
  question: if the attacker is currently active in the mailbox
  requires: Real-time log ingestion for UAL
  risk: M365 UAL logs can have a delay of several hours, meaning the attacker may
    have already completed the BEC before the hunt sees the signals.
  stage: bec-invoice-manipulation-impact
coverage:
- stage: session-hijack-mfa-bypass
  status: covered
  steps:
  - m365-session-concurrency
- stage: hidden-inbox-rule-persistence
  status: covered
  steps:
  - m365-suspicious-inbox-rules
- stage: bec-invoice-manipulation-impact
  status: covered
  steps:
  - m365-mailbox-impact-activity
- reason: 'Belongs to another part of the ''ClickFix to BEC in 24 Hours: Tragic Quadrant
    | Huntress'' series.'
  stage: click-fix-terminal-execution
  status: out_of_scope
- reason: 'Belongs to another part of the ''ClickFix to BEC in 24 Hours: Tragic Quadrant
    | Huntress'' series.'
  stage: browser-session-cookie-theft
  status: out_of_scope
guardrails:
  claims: no_unsupported
  evidence: citation_required
  missing_data: not_benign
  telemetry: untrusted
hunt:
  applicability: campaign-specific
  handoff: promote-to-detection
  justification: Protecting corporate assets from Business Email Compromise (BEC)
    and unauthorized financial diversions resulting from session theft is a high-priority
    requirement.
  methodology: model-assisted
  trigger: intel-report
hypothesis: An adversary has hijacked an authenticated Microsoft 365 session using
  stolen cookies, bypassing MFA to create stealthy inbox rules and perform fraudulent
  financial transactions.
labels:
- hunt
- attack.t1550.004
- attack.t1137.005
- attack.t1565.002
- attack.t1133
- credential access
- execution
- impact
- initial access
- persistence
- m365
name: M365 Session Hijacking and Mailbox Manipulation
parameters:
  lookback_days:
    default: '14'
    description: Number of days of history to examine for session and mailbox activity.
    from:
      kind: manual
      observed: '2024-10-24'
      ref: standard-retention
    type: number
  scope_users:
    default: []
    description: The specific users flagged in the lead step; empty means all users.
    from:
      kind: manual
      observed: '2024-10-24'
      ref: analyst-scoping
    type: list[string]
  suspicious_rule_names:
    default:
    - ..
    - .
    - '...'
    - ' '
    - z
    description: Minimalist or common evasion names used for malicious inbox rules.
    from:
      kind: article
      observed: '2024-10-13'
      ref: huntress-clickfix-bec
    type: list[string]
provenance:
  authors:
  - name: Huntbase hunt generation
    org: huntbase.io
  generated:
    by: huntbase-hunt-generation
    from: https://www.huntress.com/blog/clickfix-bec-tragic-quadrant-doris
    gates:
    - dry-run
    - lint
    model: hb_google/gemini-3-flash-preview
rationale: Focus on M365 tenants with high financial risk, such as Finance or Treasury
  departments. Widen the lookback window if investigating a known invoice fraud incident.
references:
- name: 'ClickFix to BEC in 24 Hours: Tragic Quadrant | Huntress'
  url: https://www.huntress.com/blog/clickfix-bec-tragic-quadrant-doris
related:
- hunt: click-fix-terminal-execution
  reason: Initial access via Terminal execution is handled by a separate endpoint-focused
    hunt.
  relation: out-of-scope-alternative
- hunt: clickfix-terminal-execution-cookie-theft
  relation: follows
scenario:
  stages:
  - name: ClickFix Social Engineering Execution
    observables:
    - Terminal.app
    - Command+Space
    - curl
    - Base64-encoded IP address in shell command
    slug: click-fix-terminal-execution
    tactic: execution
    techniques:
    - T1204.002
    - T1059.004
  - name: Browser Session Cookie Theft
    observables:
    - Microsoft 365 session cookie
    - Access to browser cookie storage files
    slug: browser-session-cookie-theft
    tactic: credential-access
    techniques:
    - T1539
  - name: Session Hijacking and MFA Bypass
    observables:
    - Two browsers active in one session
    - Two different operating systems for the same login
    - Traffic routed through a VPN
    - Sign-in without password or MFA prompt
    slug: session-hijack-mfa-bypass
    tactic: initial-access
    techniques:
    - T1133
    - T1550.004
  - name: Persistence via Hidden Inbox Rule
    observables:
    - Inbox rule named '..'
    - Rule set to archive messages containing invoice numbers
    slug: hidden-inbox-rule-persistence
    tactic: persistence
    techniques:
    - T1137.005
  - name: Business Email Compromise Impact
    observables:
    - Replies to Treasury emails
    - Modified routing numbers for payments
    - Deletion of sent messages
    - Emptying of trash/deleted items folder
    slug: bec-invoice-manipulation-impact
    tactic: impact
    techniques:
    - T1565.002
  summary: A user seeking AI assistance was targeted by a ClickFix social engineering
    attack that induced them to execute a malicious shell command via Terminal. This
    command stole a Microsoft 365 session cookie, enabling the attacker to bypass
    MFA, gain unauthorized inbox access, and perform mailbox manipulation to redirect
    invoice payments in a Business Email Compromise (BEC) scenario.
series:
  index: 2
  slug: clickfix-to-bec-in-24-hours-tragic-quadrant-huntress
  title: 'ClickFix to BEC in 24 Hours: Tragic Quadrant | Huntress'
  total: 2
severity: medium
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
tlp: clear
type: investigation
---


# M365 Session Hijacking and Mailbox Manipulation

This hunt identifies the transition from endpoint compromise to identity-based fraud. It starts by finding suspicious inbox rule creations that use minimalist or hidden naming conventions common in BEC attacks. If found, the hunt expands to analyze authentication anomalies, specifically concurrent sessions using different browser fingerprints or locations, and corroborates these with mailbox activities like unauthorized email sending or permanent deletion of evidence. This flow follows the scenario where a stolen session cookie allows an attacker to manipulate an inbox for hours without triggering MFA alerts.

## m365-suspicious-inbox-rules
<!-- Lead: Suspicious M365 Inbox Rule Creation -->
Identify the creation or modification of inbox rules with minimalist names like '..' which attackers use to hide mailbox manipulation.

```sqlite target=endpoint role=detection-candidate params=(lookback_days=lookback_days, suspicious_rule_names=suspicious_rule_names)
~~~yaml
expected: A row indicates a rule created with a near-invisible name. Silence indicates
  no such rules were created via the API in the window.
reads:
- actor_user_name
- resource_name
- api_operation
- src_endpoint_ip
- user_agent
- time
silence: not_evidence_of_absence
source: hb_cloud_api_activity
verified: dry-run
verified_at: '2026-10-15'
~~~
SELECT actor_user_name, resource_name, api_operation, src_endpoint_ip, user_agent, time FROM hb_cloud_api_activity WHERE provider = 'm365' AND (api_operation = 'New-InboxRule' OR api_operation = 'Set-InboxRule') AND (instr(',' || '{{suspicious_rule_names}}' || ',', ',' || LOWER(substr(resource_name, instr(resource_name, '\') + 1)) || ',') > 0 OR LENGTH(substr(resource_name, instr(resource_name, '\') + 1)) <= 2) AND time >= datetime('now', '-{{lookback_days}} days')
```

## evaluate-rule-lead
<!-- Evaluate Rule Lead -->
```agent target=hunter
cite: required
context:
- m365-suspicious-inbox-rules
max_iterations: 3
objective: Review the rule creation events and determine if they represent unusual
  administrative behavior for the named users.
success_criteria: A verdict of suspicious or benign for each user identified in the
  lead query.
tools:
- endpoint
- identity
```

## gate-suspicious-rules
<!-- Gate: Suspicious Rules Detected? -->
if~: "the evaluate-rule-lead verdict is suspicious for at least one user" (confidence: high, judge=hunter)
then: → corroborate-theft
indeterminate: → analyst-manual-review
unavailable: → analyst-manual-review (blind_spot: no-m365-audit-logs)
else: → close-out

## corroborate-theft
<!-- Corroborate Session and Impact -->
parallel:
- → m365-session-concurrency
- → m365-mailbox-impact-activity
join: → triage-investigation

## m365-session-concurrency
<!-- M365 Session Concurrency Anomalies -->
Examine the session history for flagged users to find browser-string shifts or proxy use concurrent with the rule creation.

```sqlite target=identity role=baseline params=(lookback_days=lookback_days, scope_users=scope_users)
~~~yaml
baseline:
  compare: new_this_window
  window: '{{lookback_days}}d'
expected: Users with disparate browser strings or VPN use within the same window.
  Silence implies single-browser sessions.
prevalence:
  by: actor_user_name
  key:
  - user_agent
  rare_below: 2
reads:
- actor_user_name
- user_agent
- src_endpoint_ip
- src_location_country
- is_proxy
- time
silence: not_evidence_of_absence
source: hb_auth_signin
verified: dry-run
verified_at: '2026-10-15'
~~~
SELECT actor_user_name, user_agent, src_endpoint_ip, src_location_country, is_proxy, MIN(time) as first_seen, MAX(time) as last_seen FROM hb_auth_signin WHERE provider = 'm365' AND status_id = 1 AND ('{{scope_users}}' = '' OR instr(',' || '{{scope_users}}' || ',', ',' || actor_user_name || ',') > 0) AND time >= datetime('now', '-{{lookback_days}} days') GROUP BY actor_user_name, user_agent, src_endpoint_ip, src_location_country, is_proxy
```

## m365-mailbox-impact-activity
<!-- M365 Mailbox Impact Actions -->
Identify fraudulent emails being sent or the deletion of evidence to hide the attacker's presence, specifically for the flagged users.

```sqlite target=endpoint role=enrichment params=(lookback_days=lookback_days, scope_users=scope_users)
~~~yaml
expected: A burst of email deletions or sends from a user who also showed rule anomalies.
  Silence indicates no destructive mailbox actions.
reads:
- actor_user_name
- api_operation
- resource_name
- src_endpoint_ip
- time
silence: not_evidence_of_absence
source: hb_cloud_api_activity
verified: dry-run
verified_at: '2026-10-15'
~~~
SELECT actor_user_name, api_operation, resource_name, src_endpoint_ip, time FROM hb_cloud_api_activity WHERE provider = 'm365' AND ('{{scope_users}}' = '' OR instr(',' || '{{scope_users}}' || ',', ',' || actor_user_name || ',') > 0) AND (api_operation IN ('Send', 'MoveToDeletedItems', 'HardDelete', 'EmptyFolder') OR (api_operation = 'Update' AND LOWER(resource_name) LIKE '%inbox%')) AND time >= datetime('now', '-{{lookback_days}} days')
```

## triage-investigation
<!-- Triage Investigation -->
```agent target=hunter
cite: required
context:
- evaluate-rule-lead
- m365-session-concurrency
- m365-mailbox-impact-activity
max_iterations: 6
objective: Determine if the user from the lead query shows session hijacking indicators,
  such as a new user agent during the rule creation that differs from their history,
  and corresponding impact actions.
success_criteria: A verdict of malicious | suspicious | benign per user, citing specific
  timestamps and browser strings.
tools:
- endpoint
- identity
```

## route-on-verdict
<!-- Route on Verdict -->
if~: "the triage-investigation verdict is malicious for at least one user" (confidence: high, judge=hunter)
then: → revoke-m365-sessions
indeterminate: → analyst-manual-review
unavailable: → analyst-manual-review (blind_spot: m365-log-latency)
else: → close-out

## revoke-m365-sessions
<!-- Revoke M365 Sessions -->
```action target=identity
~~~yaml
approval: required
~~~
Revoke all active M365 sessions for the affected user and reset the password.
```
→ analyst-manual-review

## analyst-manual-review
<!-- Analyst Manual Review -->
```manual target=analyst
Review the triage investigation output. Verify the browser string differences and the timing of the inbox rule.
```
→ end

## close-out
<!-- Close Out -->
```manual target=analyst
Document the findings. Suggest tuning the suspicious rule name list if false positives were encountered.
```
→ 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, then reviewed by a person.