Detection rules › Splunk

Shell Spawned by Web Server - Windows (Windows Event Log)

Group by
_time, host, process_name
Source
github.com/anvilogic-forge/armory

This use case detects web server processes with child processes which can be an indication of a web shell attack

MITRE ATT&CK coverage

References

Event coverage

Rule body yaml

id: '18748.32126'
title: Shell Spawned by Web Server - Windows
description: 'This use case detects web server processes with child processes which
  can be an indication of a web shell attack. - Threat Actor Association: Alloy Taurus/Gallium,
  OilRig, Volt Typhoon (Bronze Silhouette, Vanguard Panda) -- Software Association:
  ALPHV/BlackCat, Clop'
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR
  "<EventID>4688<" OR Type=Process) (TERM(w3wp) OR TERM(httpd) OR TERM(nginx) OR TERM(php-cgi)
  OR TERM(tomcat) OR TERM(UMWorkerProcess)) (TERM(cmd) OR TERM(powershell) OR TERM(pwsh)
  OR TERM(csc) OR TERM(sh) OR TERM(bash) OR TERM(bitsadmin))| regex Creator_Process_Name="(?i)(w3wp|httpd|nginx|php-cgi|tomcat|UMWorkerProcess)\.exe"|
  regex New_Process_Name="(?i)(cmd|powershell|pwsh|csc|sh|bash|bitsadmin)\.exe" |
  table _time, host, user, signature_id, process, process_*, parent_process_* | bin
  span=1s | stats values(*) as * by _time, host, process_name | eventstats c(process_name)
  as c_process_name by process_name| where c_process_name < 25 '
techniques:
- persistence:server software component:iis components
- persistence:server software component:web shell
- defense-evasion:system binary proxy execution
technique_id:
- T1505.004
- T1505.003
- T1218
data_category:
- Windows event logs
references:
- https://www.microsoft.com/security/blog/2021/02/11/web-shell-attacks-continue-to-rise/
- https://www.huntress.com/blog/moveit-transfer-critical-vulnerability-rapid-response

Stages and Predicates

Stage 1: search

`get_endpoint_data` `get_endpoint_data_winevent` (TERM(EventCode=4688) OR "<EventID>4688<" OR Type=Process) (TERM(w3wp) OR TERM(httpd) OR TERM(nginx) OR TERM(php-cgi) OR TERM(tomcat) OR TERM(UMWorkerProcess)) (TERM(cmd) OR TERM(powershell) OR TERM(pwsh) OR TERM(csc) OR TERM(sh) OR TERM(bash) OR TERM(bitsadmin))

Stage 2: regex

| regex Creator_Process_Name="(?i)(w3wp|httpd|nginx|php-cgi|tomcat|UMWorkerProcess)\.exe"

Stage 3: regex

| regex New_Process_Name="(?i)(cmd|powershell|pwsh|csc|sh|bash|bitsadmin)\.exe"

Stage 4: table

| table _time, host, user, signature_id, process, process_*, parent_process_*

Stage 5: bucket

| bin span=1s

Stage 6: stats

| stats values(*) as * by _time, host, process_name

Stage 7: eventstats

| eventstats c(process_name) as c_process_name by process_name

Stage 8: where

| where c_process_name < 25

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
Creator_Process_Nameregex_match
  • "(?i)(w3wp|httpd|nginx|php-cgi|tomcat|UMWorkerProcess).exe"
EventCodeeq
  • 4688 corpus 313 (splunk 283, kusto 30)
New_Process_Nameregex_match
  • "(?i)(cmd|powershell|pwsh|csc|sh|bash|bitsadmin).exe"
c_process_namelt
  • 25 corpus 2 (splunk 2)

Search terms

Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.

StageTerm
1TERM
1"<EventID>4688<"
1TERM
1w3wp
1TERM
1httpd
1TERM
1nginx
1"php-cgi"
1TERM
1tomcat
1TERM
1UMWorkerProcess
1TERM
1cmd
1TERM
1powershell
1TERM
1pwsh
1TERM
1csc
1TERM
1sh
1TERM
1bash
1TERM
1bitsadmin