Detection: Windows Suspicious Child Process Spawned From WebServer

Description

This analytic detects selected system, scripting, discovery, and administration utilities spawned by Windows web or application server processes. Parent processes include common web server and application server services; Java and JavaW parents are included when their command lines identify known server frameworks or applications. Unexpected child process activity may indicate that an exposed application or web server has been abused to run commands on the host. Review the parent command line, child process, user, and surrounding activity to determine whether the behavior is authorized.

  1
  2| tstats `security_content_summariesonly`
  3  count max(_time) as lastTime
  4        min(_time) as firstTime
  5
  6FROM datamodel=Endpoint.Processes WHERE
  7
  8Processes.parent_process_name IN (
  9    "apache*.exe",
 10    "beasvc.exe",
 11    "caddy.exe",
 12    "coldfusion.exe",
 13    "frankenphp.exe",
 14    "gswin32.exe",
 15    "gswin32c.exe",
 16    "gswin64.exe",
 17    "gswin64c.exe",
 18    "http*.exe",
 19    "iisexpress.exe",
 20    "java.exe",
 21    "javaw.exe",
 22    "jbosssvc.exe",
 23    "jrun.exe",
 24    "lighttpd.exe",
 25    "lsphp*.exe",
 26    "nginx*.exe",
 27    "openresty.exe",
 28    "php*.exe",
 29    "roadrunner.exe",
 30    "ruby.exe",
 31    "rubyw.exe",
 32    "tomcat*.exe",
 33    "traefik.exe",
 34    "UMWorkerProcess.exe",
 35    "w3wp.exe",
 36    "wildfly-service.exe",
 37    "ws_TomcatService.exe"
 38)
 39NOT Processes.parent_process_name IN ("phpstorm*")
 40
 41Processes.process_name IN (
 42    "adfind.exe", "arp.exe", "at.exe", "bitsadmin.exe", "certreq.exe", "certutil.exe", "cmd.exe", "cmdkey.exe",
 43    "cscript.exe", "curl.exe", "dnscmd.exe", "dsget.exe", "dsquery.exe", "find.exe", "findstr.exe",
 44    "fsutil.exe", "getmac.exe", "gswin32.exe", "gswin32c.exe", "gswin64.exe", "gswin64c.exe", "hostname.exe", "ipconfig.exe", "klist.exe", "mshta.exe",
 45    "nbtstat.exe", "net.exe", "net1.exe", "netdom.exe", "netsh.exe", "netstat.exe", "nltest.exe",
 46    "nslookup.exe", "ntdsutil.exe", "pathping.exe", "perl.exe", "ping.exe", "powershell.exe", "pwsh.exe", "python.exe", "python3.exe",
 47    "qprocess.exe", "query.exe", "quser.exe", "qwinsta.exe", "reg.exe", "regsvr32.exe", "route.exe",
 48    "rundll32.exe", "sc.exe", "schtasks.exe", "scrcons.exe", "setspn.exe", "systeminfo.exe",
 49    "tasklist.exe", "tracert.exe", "vssadmin.exe", "wevtutil.exe", "wget.exe", "whoami.exe",
 50    "wmic.exe", "wscript.exe", "wusa.exe"
 51)
 52
 53NOT (
 54    Processes.parent_process_name="javaw.exe"
 55    Processes.parent_process_path = "C:\\ViewPowerPro\\openJDK\\bin\\javaw.exe"
 56    Processes.parent_process = "*viewpowerpro.lax*"
 57    Processes.parent_process = "*com.zerog.lax.*"
 58    Processes.process_name = "sc.exe"
 59)
 60
 61NOT (
 62    Processes.parent_process_name="javaw.exe"
 63    Processes.parent_process_path = "*:\\Program Files\\ArcGIS\\Portal\\framework\\runtime\\jre\\bin\\*"
 64    Processes.process_current_directory = "*:\\Program Files\\ArcGIS\\Portal\\framework\\etc\\*"
 65    Processes.process_name = "cmd.exe"
 66    Processes.process = "*whoami*"
 67)
 68
 69NOT (
 70    Processes.parent_process_name="w3wp.exe"
 71    Processes.parent_process_path="C:\\Windows\\System32\\inetsrv\\w3wp.exe"
 72    Processes.parent_process="*mobileframe server (64-bit)*"
 73    Processes.process_name="cmd.exe"
 74    Processes.process IN (
 75        "*/c ren *",
 76        "*eemsp_test*",
 77        "*getworkorderpart_*"
 78    )
 79)
 80
 81NOT (
 82    Processes.parent_process_path IN (
 83        "*:\\Program Files\\Datacard\\AppContainer\\bin\\*",
 84        "*:\\Program Files\\AeroScout\\MobileView\\services*"
 85    )
 86    Processes.parent_process_name = "tomcat*.exe"
 87    Processes.process_name  IN ("sc.exe", "reg.exe")
 88    Processes.process IN ("*qc *", "*query*")
 89)
 90
 91BY Processes.action Processes.dest Processes.original_file_name
 92   Processes.parent_process Processes.parent_process_exec Processes.parent_process_guid
 93   Processes.parent_process_id Processes.parent_process_name Processes.parent_process_path
 94   Processes.process Processes.process_exec Processes.process_guid
 95   Processes.process_hash Processes.process_id Processes.process_integrity_level
 96   Processes.process_current_directory Processes.process_name Processes.process_path Processes.user
 97   Processes.user_id Processes.vendor_product
 98
 99
100| `drop_dm_object_name("Processes")`
101
102```Keep Java and JavaW parents only when their command line identifies a known web or application server.```
103
104
105| where (
106    NOT match(parent_process_name, "(?i)^javaw?(\.exe)?$")
107    OR match(parent_process, "(?i)(org\.apache\.catalina\.startup\.Bootstrap
108|-Dcatalina\.base=
109|org\.eclipse\.jetty\.start\.Main
110|-Djetty\.home=
111|org\.jboss\.modules\.Main
112|-Djboss\.home\.dir=
113|weblogic\.Server
114|-Dweblogic\.Name=
115|weblogic-launcher\.jar
116|com\.ibm\.ws\.runtime\.WsServer
117|com\.ibm\.ws\.kernel\.boot\.cmdline\.Bootstrap
118|com\.sun\.enterprise\.glassfish\.bootstrap\.ASMain
119|com\.caucho\.server\.resin\.Resin)")
120    OR match(parent_process, "(?i)(org\.springframework\.boot\.loader\.
121|quarkus-run\.jar
122|io\.quarkus\.runner\.GeneratedMain
123|io\.micronaut\.runtime\.Micronaut
124|io\.dropwizard\.cli\.ServerCommand
125|play\.core\.server\.ProdServerStart
126|io\.helidon\.microprofile\.server\.Main
127|io\.helidon\.webserver
128|io\.vertx\.core\.Launcher)")
129    OR match(parent_process, "(?i)(org\.keycloak
130|org\.apereo\.cas
131|org\.elasticsearch\.bootstrap\.Elasticsearch
132|com\.atlassian\.jira\.startup\.Launcher
133|BitbucketServerLauncher
134|com\.google\.gerrit\.pgm\.Daemon
135|-Dsolr\.solr\.home=
136|jenkins\.war)")
137)
138
139
140| where (
141    NOT match(parent_process_name, "(?i)ruby")
142    OR match(coalesce(parent_process,""), "(?i)\b(rails
143|rack
144|rackup
145|puma
146|passenger
147|unicorn
148|thin
149|webrick
150|falcon
151|sidekiq
152|sinatra
153|hanami
154|agoo
155|iodine)\b")
156)
157
158
159| where NOT (
160    process_name="tasklist.exe"
161    AND match(
162        lower(process),
163        "^\"?tasklist(\.exe)?\"? +/fi +\"pid eq [0-9]+\" *$"
164    )
165)
166
167
168| `security_content_ctime(firstTime)`
169
170| `security_content_ctime(lastTime)`
171
172| `windows_suspicious_child_process_spawned_from_webserver_filter`

Data Source

Name Platform Sourcetype Source
CrowdStrike ProcessRollup2 Other 'crowdstrike:events:sensor' 'crowdstrike'
Sysmon EventID 1 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Microsoft-Windows-Sysmon/Operational'
Cisco Endpoint Visibility Module Process Activity Other 'cisco:evm:process_activity' 'not_applicable'
Windows Event Log Security 4688 Windows icon Windows 'XmlWinEventLog' 'XmlWinEventLog:Security'

Macros Used

Name Value
security_content_summariesonly summariesonly=summariesonly_config allow_old_summaries=oldsummaries_config fillnull_value=fillnull_config``
windows_suspicious_child_process_spawned_from_webserver_filter search *
windows_suspicious_child_process_spawned_from_webserver_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

CVE

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Finding (Notable) No
Creates Intermediate Finding (Risk Event) Yes
Anomaly detections generate Intermediate Findings (Risk Events). They do not generate a Finding (Notable) directly.

Implementation

The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process GUID, process name, and parent process. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the Processes node of the Endpoint data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process.

Known False Positives

Legitimate OS functions called by vendor applications, baseline the environment and filter before enabling. Recommend throttle by dest/process_name

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
Potential Webshell Exploit Behavior - [$parent_process_name$] spawned [$process_name$] on [$dest$]. user user 20
Potential Webshell Exploit Behavior - [$parent_process_name$] spawned [$process_name$] on [$dest$]. dest system 20

Threat Objects

Field Type
parent_process_name parent_process_name
process process
process_name process_name

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation ✅ Passing N/A N/A N/A
Unit ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog
Integration ✅ Passing Dataset XmlWinEventLog:Microsoft-Windows-Sysmon/Operational XmlWinEventLog

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub |

Version: 16