BEC & Exchange Forensics · T1114.002 / Discovery

SearchQueryInitiatedExchange: Spotting Attacker Mailbox Keyword Searches

Direct Answer (Key Forensic Takeaway)

When attackers search a compromised Exchange mailbox or SharePoint site for lucrative fraud targets, Microsoft Purview records SearchQueryInitiatedExchange and SearchQueryInitiatedSharePoint containing the exact QueryText string typed. Keywords like "wire", "invoice", "bank", "ACH", "IBAN", "password", or "MFA" from unfamiliar IPs trigger AuditVane rule AV-007 automatically.

Detection Objective & Threat Scope

A compromised executive mailbox often holds ten years of emails—far too noisy for a human attacker or BEC script to read chronologically. Instead, within two to five minutes of initial login, threat actors click straight into the OWA or SharePoint search bar and search for keywords pointing directly to cash flow or credentials.

Because SearchQueryInitiatedExchange and SearchQueryInitiatedSharePoint record the literal QueryText parameter in Purview UAL, hunting these search events gives defenders a real-time window into the attacker’s exact intent.

Both Outlook on the Web (OWA), New Outlook, and SharePoint search emit SearchQueryInitiated telemetry under RecordType 2 and SharePoint workloads. Inside AuditData, QueryText contains the raw query terms, QuerySource shows whether OWA or REST/Substrate originated the query, and ClientIP pins down the search location.

AuditVane rule AV-007 scans every SearchQueryInitiatedExchange and SearchQueryInitiatedSharePoint event against curated BEC financial keywords (wire, invoice, bank, ach, iban, routing, payment, remittance) and credential-harvesting keywords (password, credential, mfa, recovery, payroll), cutting out everyday benign employee search noise.

1. RAW TELEMETRY BEC & Exchange Forensics T1114.002 / Discovery 2. CLIENT-SIDE PARSE AuditVane Engine SearchQueryInitiatedExchange Query 0 Bytes Uploaded 3. SOC OUTCOME Scoped Containment IOCs · CSV · KQL
Local browser DFIR workflow for SearchQueryInitiatedExchange QueryText (T1114.002 / Discovery)
AdSense-Ready In-Article Placement

Forensic Telemetry Fields & High-Signal Indicators

Telemetry Field / Pattern Meaning in M365 / Entra High-Signal Threat Indicator
QueryText (Financial BEC)wire, invoice, bank, ACH, IBAN, routing, paymentClassic payment-diversion targeting
QueryText (Credential Recon)password, VPN, MFA, secret, ssh, recoveryLateral movement & cloud key hunting
QuerySourceOWA, Outlook, REST, SharePointCompare against employee’s daily client
ScenarioNameMailSearch vs. PeopleSearch vs. FileSearchShows whether attacker searched mail or org chart
ClientIP / SessionIdNetwork origin & session of search callCorrelates search straight to AiTM login
TimeDelta from LoginTypically 1–5 minutes post-compromiseClassic automated or hands-on-keyboard BEC pacing

Hunt High-Signal Financial & Credential Searches via PowerShell & KQL

# PowerShell Purview UAL pull:
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-14) -EndDate (Get-Date) -Operations SearchQueryInitiatedExchange,SearchQueryInitiatedSharePoint -SessionId ([guid]::NewGuid()) -SessionCommand ReturnLargeSet -ResultSize 5000 |
  Export-Csv .\M365_Searches.csv -NoTypeInformation

# Microsoft Sentinel KQL equivalent:
OfficeActivity | where Operation in ("SearchQueryInitiatedExchange","SearchQueryInitiatedSharePoint")
| extend QueryText = tostring(parse_json(RawEventData).QueryText)
| where QueryText matches regex "(?i)(wire|invoice|bank|ach|iban|password|credential|payroll)"

Sample Suspicious QueryText Discovery

CreationTime         UserId                            ClientIP        QueryText
------------         ------                            --------        ---------
2026-12-01T08:14:19Z finance.director@contoso.invalid  185.220.101.45  wire transfer OR invoice OR ACH

Normal Employee Search Behavior vs. Attacker Reconnaissance

CharacteristicNormal Employee SearchAttacker BEC / Lateral Recon
Query TermsSpecific colleague names, project codes, ticket IDsBroad Boolean OR queries ("wire OR invoice OR ACH")
Timing PatternSpread across business hoursBurst within minutes of anomalous login
Client OriginUsual Outlook Desktop (MSExchangeRPC)Unexpected OWA or REST API from foreign IP
Follow-Up ActionOpens 1–2 historical threadsImmediately followed by New-InboxRule or MailItemsAccessed burst

SearchQueryInitiatedExchange AuditData Payload

{
  "CreationTime": "2026-12-01T08:14:19Z",
  "Operation": "SearchQueryInitiatedExchange",
  "RecordType": 2,
  "Workload": "Exchange",
  "UserId": "finance.director@contoso-demo.invalid",
  "ClientIP": "185.220.101.45",
  "QueryText": "wire transfer OR invoice OR ACH",
  "ClientInfoString": "Client=OWA;Action=Search"
}

Notice the Boolean syntax ("wire transfer OR invoice OR ACH")—a telltale signature of BEC scripts and experienced fraud operators hunting active receivables threads rapidly in OWA.

Real-World Incident Walkthrough

During an incident affecting a CFO account, initial alerts only flagged an impossible-travel login—making it unclear whether an employee merely used an unapproved VPN or a real intruder entered the mailbox.

Loading the Purview UAL CSV into AuditVane instantly fires AV-007 on SearchQueryInitiatedExchange at 08:14 UTC: QueryText = "wire transfer OR invoice OR ACH" coming from 185.220.101.45 (`Client=OWA;Action=Search`). That single keyword search removes all ambiguity and confirms active financial BEC targeting.

Step-by-Step Triage, Containment & Verification

  1. Load the victim’s Purview UAL export into AuditVane and review any AV-007 alerts.
  2. Inspect every QueryText executed during the compromise window (not just flagged financial terms—check for client/vendor names too).
  3. Re-run the attacker’s exact QueryText inside Purview eDiscovery scoped to the target mailbox to see the exact emails their search surfaced.
  4. Cross-reference timestamps immediately following the search for MailItemsAccessed Bind events and New-InboxRule creation.
  5. Notify internal finance/payroll stakeholders and any vendors named in the attacker’s search queries.

How to Verify Containment Completed Cleanly

  • All SearchQueryInitiatedExchange and SearchQueryInitiatedSharePoint records audited.
  • Sensitive files or threads matching attacker QueryText inventoried for exposure risk.
  • Vendor fraud alerts issued where invoice/wire terms appeared.

Analyst Blind Spots, Licensing Quirks & False Positives

Accountants, HR managers, and procurement specialists legitimately search "invoice", "wire", and "payroll" every single day! Always evaluate QueryText alongside ClientIP, UserAgent, SessionId, and timing relative to anomalous logins rather than alerting on keywords in isolation.

Remember that SearchQueryInitiated logs can expose sensitive internal searches (like HR investigations or M&A code names)—handle exports strictly inside zero-upload tools like AuditVane.

Frequently Asked Questions

Does SearchQueryInitiatedExchange log Outlook Desktop and OWA searches?

Yes, modern Outlook search (Microsoft Search / Substrate), OWA, and SharePoint search emit SearchQueryInitiated telemetry.

Does AuditVane flag every single search query?

No—to keep noise low, AuditVane AV-007 filters SearchQueryInitiated events for high-signal BEC financial and credential keywords.

Can an attacker erase their Purview search trail by clearing Outlook search history?

No. Clearing recent UI suggestions in Outlook only removes local UI history and never deletes Purview audit logs.

Why do attackers search SharePoint too?

Using SearchQueryInitiatedSharePoint lets attackers quickly locate shared Excel vendor sheets, password spreadsheets, and AWS/VPN documentation.

Related Forensics Guides