Microsoft Exchange Worker Spawning Suspicious Processes
Identifies suspicious processes being spawned by the Microsoft Exchange Server worker process (w3wp). This activity may indicate exploitation activity or access to an existing web shell backdoor.
Rule type: eql
Rule indices:
- logs-endpoint.events.process-*
- winlogbeat-*
- logs-windows.sysmon_operational-*
- endgame-*
- logs-m365_defender.event-*
- logs-sentinel_one_cloud_funnel.*
Rule Severity: high
Risk Score: 73
Runs every:
Searches indices from: now-9m
Maximum alerts per execution: 100
References:
- https://www.microsoft.com/security/blog/2021/03/02/hafnium-targeting-exchange-servers
- https://www.volexity.com/blog/2021/03/02/active-exploitation-of-microsoft-exchange-zero-day-vulnerabilities
- https://discuss.elastic.co/t/detection-and-response-for-hafnium-activity/266289
Tags:
- Domain: Endpoint
- OS: Windows
- Use Case: Threat Detection
- Tactic: Initial Access
- Data Source: Elastic Endgame
- Data Source: Elastic Defend
- Data Source: Sysmon
- Data Source: Microsoft Defender XDR
- Data Source: SentinelOne
- Resources: Investigation Guide
Version: 316
Rule authors:
- Elastic
Rule license: Elastic License v2
This rule is designed for data generated by Elastic Defend, which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
Setup instructions: https://ela.st/install-elastic-defend
This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- What Exchange worker-child path did the alert capture?
- Focus: child
process.executableandprocess.command_line; workerprocess.parent.executable,process.parent.args, andprocess.parent.command_line; exact MSExchange app pool. - Implication: escalate when an Exchange app pool launches shell/PowerShell for execution, download, discovery, or staging; lower suspicion only when parent arguments and child command match one narrow maintenance task with no webshell or RCE indicators.
- Focus: child
- What intent does the shell or PowerShell command show?
- Focus:
process.command_line; encoded or inline execution, download cradles, archive/export, discovery, Set-OabVirtualDirectory, mailbox access, or FrontEnd\HttpProxy, aspnet_client, web.config, and applicationHost.config paths. - Implication: escalate on payload retrieval, web-root staging, credential access, account changes, mailbox export, cleanup, or lateral movement; lower suspicion only for one bounded recognized Exchange maintenance or validation action.
- Focus:
- Does token and session context support human administration or service-context abuse?
- Why: w3wp.exe children often inherit app-pool or service identity, so user fields alone do not prove human administration.
- Focus:
user.id,user.name,user.domain,process.Ext.session_info.logon_type, andprocess.Ext.authentication_id. - Implication: escalate when a service, app-pool, or unexpected logon context launches interactive shell behavior or remote administration; lower suspicion only when identity, session type, and command scope match the same recognized workflow.
- Is the child binary expected or masqueraded?
- Focus:
process.executable,process.hash.sha256,process.pe.original_file_name,process.code_signature.subject_name, andprocess.code_signature.trusted. - Implication: escalate when the child is renamed, user-writable, unsigned or untrusted, hash-new for the server, or mismatched to PE original name; a trusted Microsoft shell lowers identity concern but does not clear the unusual chain.
- Focus:
- If process evidence is suspicious or unresolved, did file evidence show webshells or artifacts?
- Focus: with endpoint file telemetry, scope by
host.id+process.entity_id, orhost.id+process.pid+ tight alert window if absent; inspectfile.path,file.Ext.original.path,file.origin_url, andfile.Ext.windows.zone_identifierfor ASPX, scripts, binaries, DLLs, archives, or output under Exchange/IIS paths. $investigate_1 - Hint: check whether a written
file.pathlater appears asprocess.executable; missing file telemetry limits proof but is not benign. - Implication: escalate when the child writes new or modified ASPX, scripts, binaries, DLLs, archives, or output under Exchange FrontEnd\HttpProxy, IIS aspnet_client, temp, or web-root paths; lower suspicion only when file activity stays inside the exact maintenance path with no web-content or payload staging.
- Focus: with endpoint file telemetry, scope by
- If process evidence is suspicious or unresolved, did network evidence show retrieval or callback?
- Focus: with endpoint network telemetry, scope DNS and connections by
host.id+process.entity_id, orhost.id+process.pid+ tight alert window if absent; read DNS (dns.question.name,dns.resolved_ip) separately from connections (destination.ip,destination.port). $investigate_2 - Hint: map
dns.resolved_iptodestination.ipbefore deciding whether the same process reached it. Missing network telemetry is unresolved, not benign. - Implication: escalate when the child downloads tools, reaches public staging or callback infrastructure, or connects to systems unrelated to the Exchange task; lower suspicion only when destinations are internal, proxy, or vendor services fitting the same bounded workflow.
- Focus: with endpoint network telemetry, scope DNS and connections by
- Does same-worker or same-host scope show broader Exchange compromise?
- Focus: surrounding same-worker process starts and related alerts on
host.idoruser.id, especiallyprocess.parent.executable,process.parent.args,process.command_line, andprocess.hash.sha256for repeated w3wp.exe descendants, credential dumping, account changes, archiving, cleanup, or side-loading chains.- $investigate_3
- $investigate_0
- $investigate_4
- Implication: escalate scope when the host shows credential dumping, account changes, archive creation, cleanup, lateral movement, or repeated Exchange worker children; keep local only when surrounding process evidence and related alerts stay confined to the same recognized maintenance window.
- Focus: surrounding same-worker process starts and related alerts on
- Escalate on unexplained server-side execution, suspicious command intent, payload staging, suspicious destinations, or broader host compromise; close only when all available evidence aligns with one recognized Exchange workflow on this host; preserve artifacts and escalate when evidence is mixed or visibility incomplete.
- Recognized Exchange maintenance or controlled validation is the bounded benign path. Confirm only when
process.parent.args, childprocess.command_line,process.executable,process.hash.sha256,process.code_signature.subject_name,user.id, andhost.idalign with one task, and anyfile.path,dns.question.name, ordestination.ipevidence shows no payload staging or external callback. Use change records as corroboration; otherwise require recurring prior alerts with the same parent arguments, command pattern, child identity, user, host, and no contradictory artifacts or destinations. - Build exceptions only from the minimum confirmed pattern:
process.parent.args, childprocess.executableorprocess.hash.sha256,process.code_signature.subject_name, stableprocess.command_linefragment,user.id,host.id, and any bounded artifact or destination pattern distinguishing the benign task. Avoid exceptions on "w3wp.exe",process.name, orhost.idalone.
- If confirmed benign, reverse temporary containment and document the exact evidence that validated the workflow:
process.parent.args, childprocess.executable,process.command_line,user.id,host.id, and any bounded artifact or destination pattern. Create an exception only after the same pattern is stable across prior alerts from this rule. - If suspicious but unconfirmed, preserve the alert, process tree, child
process.entity_idorprocess.pid,process.command_line, parentprocess.parent.entity_id,process.parent.args, child hash and signer,user.id,host.id, and any staged artifacts, destinations, or IIS/Exchange log snippets before containment. Apply reversible containment first: block confirmed malicious destinations, restrict external access to the implicated Exchange service, or increase monitoring. Isolate only when active compromise evidence and server criticality justify disruption. - If confirmed malicious, contain the Exchange server or exposed service path based on the process, artifact, destination, and same-host evidence already preserved. Record process and artifact identifiers before terminating the child, then block confirmed malicious domains, IPs, and hashes.
- Eradicate only the webshells, scripts, archives, scheduled tasks, dropped utilities, and configuration changes identified during triage. Restore modified Exchange or IIS content from known-good state, patch the Exchange server, review the virtual directories and app pools implicated by
process.parent.args, and rotate Exchange, application, or service credentials if credential access, configuration theft, or mailbox export was involved. - Retain the related process, file, network, IIS, and Exchange logs that supported the decision. Document any adjacent variant or telemetry gap, such as missing endpoint file/network events or unavailable IIS request logs, for the detection engineering team.
process where host.os.type == "windows" and event.type == "start" and
process.parent.name : "w3wp.exe" and process.parent.args : "MSExchange*AppPool" and
(
(process.name : ("cmd.exe", "powershell.exe", "pwsh.exe", "powershell_ise.exe") or
?process.pe.original_file_name in ("Cmd.Exe", "PowerShell.EXE", "pwsh.dll", "powershell_ise.EXE"))
)
Framework: MITRE ATT&CK
Tactic:
- Name: Initial Access
- Id: TA0001
- Reference URL: https://attack.mitre.org/tactics/TA0001/
Technique:
- Name: Exploit Public-Facing Application
- Id: T1190
- Reference URL: https://attack.mitre.org/techniques/T1190/
Framework: MITRE ATT&CK
Tactic:
- Name: Execution
- Id: TA0002
- Reference URL: https://attack.mitre.org/tactics/TA0002/
Technique:
- Name: Command and Scripting Interpreter
- Id: T1059
- Reference URL: https://attack.mitre.org/techniques/T1059/
Sub Technique:
- Name: PowerShell
- Id: T1059.001
- Reference URL: https://attack.mitre.org/techniques/T1059/001/
Sub Technique:
- Name: Windows Command Shell
- Id: T1059.003
- Reference URL: https://attack.mitre.org/techniques/T1059/003/
Framework: MITRE ATT&CK
Tactic:
- Name: Persistence
- Id: TA0003
- Reference URL: https://attack.mitre.org/tactics/TA0003/
Technique:
- Name: Server Software Component
- Id: T1505
- Reference URL: https://attack.mitre.org/techniques/T1505/
Sub Technique:
- Name: Web Shell
- Id: T1505.003
- Reference URL: https://attack.mitre.org/techniques/T1505/003/