name: W3WP Spawning Shell id: 0f03423c-7c6a-11eb-bc47-acde48001122 version: 2 date: '2021-03-03' author: Michael Haag, Splunk status: production type: TTP description: This query identifies a shell, PowerShell.exe or Cmd.exe, spawning from W3WP.exe, or IIS. In addition to IIS logs, this behavior with an EDR product will capture potential webshell activity, similar to the HAFNIUM Group abusing CVEs, on publicly available Exchange mail servers. During triage, review the parent process and child process of the shell being spawned. Review the command-line arguments and any file modifications that may occur. Identify additional parallel process, child processes, that may highlight further commands executed. After triaging, work to contain the threat and patch the system that is vulnerable. data_source: - Sysmon Event ID 1 search: selection1: ParentImage: w3wp.exe selection2: OriginalFileName: Cmd.Exe selection3: Image|endswith: cmd.exe selection4: OriginalFileName: Cmd.Exe selection5: Image|endswith: cmd.exe condition: selection1 and selection2 and selection3 or selection4 or selection5 how_to_implement: To successfully implement this search you need to be ingesting information on process that include the name of the process responsible for the changes from your endpoints into the `Endpoint` datamodel in the `Processes` node. In addition, confirm the latest CIM App 4.20 or higher is installed and the latest TA for the endpoint product. known_false_positives: Baseline your environment before production. It is possible build systems using IIS will spawn cmd.exe to perform a software build. Filter as needed. references: - https://www.microsoft.com/security/blog/2020/02/04/ghost-in-the-shell-investigating-web-shell-attacks/ - https://www.zerodayinitiative.com/blog/2021/8/17/from-pwn2own-2021-a-new-attack-surface-on-microsoft-exchange-proxyshell - https://www.youtube.com/watch?v=FC6iHw258RI - https://www.huntress.com/blog/rapid-response-microsoft-exchange-servers-still-vulnerable-to-proxyshell-exploit#what-should-you-do tags: analytic_story: - Hermetic Wiper - HAFNIUM Group - ProxyShell - CISA AA22-257A - ProxyNotShell - CISA AA22-264A asset_type: Endpoint confidence: 80 cve: - CVE-2021-34473 - CVE-2021-34523 - CVE-2021-31207 impact: 70 message: Possible Web Shell execution on $dest$ mitre_attack_id: - T1505 - T1505.003 observable: - name: dest type: Endpoint role: - Victim product: - Splunk Enterprise - Splunk Enterprise Security - Splunk Cloud risk_score: 56 security_domain: endpoint tests: - name: True Positive Test attack_data: - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1505.003/windows-sysmon.log source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational sourcetype: xmlwineventlog