Latest alertCVE-2018-11776 in Apache Struts Confirmed Exploited in the WildRead
Search all news in the platform

Detection rule

Suspicious Process By Web Server Process

HighTest-data validatedSigmaHQ (community)T1190T1505.003

Overview

Detects potentially suspicious processes being spawned by a web server process which could be the result of a successfully placed web shell or exploitation

Rule id
8202070f-edeb-4d31-a010-a26c72ac5600
ATT&CK techniques
T1190 Exploit Public-Facing Application, T1505.003 Server Software Component: Web Shell
Severity
High
Confidence
Low
Origin
SigmaHQ (community)
SigmaHQ status
test
Used in defense packs
The Gentlemen, qilin, INC Ransom, Akira, safepay, Play, nightspire

Validation

  1. ExperimentalSyntax checked only. Not yet tested on events.
  2. Test-data validatedMatched positive test events and ignored near-miss events. Not yet run in a production SIEM.
  3. SIEM-validatedRun in a real SIEM, with a recorded result.

2 of 2 positive test events matched; 2 of 2 near-miss events were correctly ignored. Community rule reused unmodified from SigmaHQ. OffSet7 converted it and tested it on synthetic events.

Detection logic and queries

Queries are shown exactly as generated. Test them in your environment before you deploy them.

Sigma

Sigma (YAML) · 8202070f-edeb-4d31-a010-a26c72ac5600

Download
title: Suspicious Process By Web Server Process
id: 8202070f-edeb-4d31-a010-a26c72ac5600
status: test
description: |
    Detects potentially suspicious processes being spawned by a web server process which could be the result of a successfully placed web shell or exploitation
references:
    - https://media.defense.gov/2020/Jun/09/2002313081/-1/-1/0/CSI-DETECT-AND-PREVENT-WEB-SHELL-MALWARE-20200422.PDF
author: Thomas Patzke, Florian Roth (Nextron Systems), Zach Stanford @svch0st, Tim Shelton, Nasreddine Bencherchali (Nextron Systems)
date: 2019-01-16
modified: 2024-11-26
tags:
    - attack.persistence
    - attack.initial-access
    - attack.t1505.003
    - attack.t1190
logsource:
    category: process_creation
    product: windows
detection:
    selection_webserver_image:
        ParentImage|endswith:
            - '\caddy.exe'
            - '\httpd.exe'
            - '\nginx.exe'
            - '\php-cgi.exe'
            - '\php.exe'
            - '\tomcat.exe'
            - '\UMWorkerProcess.exe'  # https://www.fireeye.com/blog/threat-research/2021/03/detection-response-to-exploitation-of-microsoft-exchange-zero-day-vulnerabilities.html
            - '\w3wp.exe'
            - '\ws_TomcatService.exe'
    selection_webserver_characteristics_tomcat1:
        ParentImage|endswith:
            - '\java.exe'
            - '\javaw.exe'
        ParentImage|contains:
            - '-tomcat-'
            - '\tomcat'
    selection_webserver_characteristics_tomcat2:
        ParentImage|endswith:
            - '\java.exe'
            - '\javaw.exe'
        ParentCommandLine|contains:
            - 'CATALINA_HOME'
            - 'catalina.home'
            - 'catalina.jar'
    selection_anomaly_children:
        Image|endswith:
            - '\arp.exe'
            - '\at.exe'
            - '\bash.exe'
            - '\bitsadmin.exe'
            - '\certutil.exe'
            - '\cmd.exe'
            - '\cscript.exe'
            - '\dsget.exe'
            - '\hostname.exe'
            - '\nbtstat.exe'
            - '\net.exe'
            - '\net1.exe'
            - '\netdom.exe'
            - '\netsh.exe'
            - '\nltest.exe'
            - '\ntdsutil.exe'
            - '\powershell_ise.exe'
            - '\powershell.exe'
            - '\pwsh.exe'
            - '\qprocess.exe'
            - '\query.exe'
            - '\qwinsta.exe'
            - '\reg.exe'
            - '\rundll32.exe'
            - '\sc.exe'
            - '\sh.exe'
            - '\wmic.exe'
            - '\wscript.exe'
            - '\wusa.exe'
    filter_main_fp_1:
        ParentImage|endswith: '\java.exe'
        CommandLine|endswith: 'Windows\system32\cmd.exe /c C:\ManageEngine\ADManager "Plus\ES\bin\elasticsearch.bat -Enode.name=RMP-NODE1 -pelasticsearch-pid.txt'
    filter_main_fp_2:
        ParentImage|endswith: '\java.exe'
        CommandLine|contains|all:
            - 'sc query'
            - 'ADManager Plus'
    condition: 1 of selection_webserver_* and selection_anomaly_children and not 1 of filter_main_*
falsepositives:
    - Particular web applications may spawn a shell process legitimately
level: high

QRadar AQL

IBM QRadar AQL (hunting query)Hunting query

Hunting search for the Log Activity tab or the API. It is not a QRadar rule.

AQL search for the Log Activity tab or the API. It is NOT a deployable QRadar rule: real-time detection in QRadar is a CRE (Custom Rule Engine) rule, for which this build only writes a design specification (qradar_cre).

SELECT * FROM events WHERE devicetype=12 AND ((LOWER("Parent Process Path") LIKE '%\caddy.exe' OR LOWER("Parent Process Path") LIKE '%\httpd.exe' OR LOWER("Parent Process Path") LIKE '%\nginx.exe' OR LOWER("Parent Process Path") LIKE '%\php-cgi.exe' OR LOWER("Parent Process Path") LIKE '%\php.exe' OR LOWER("Parent Process Path") LIKE '%\tomcat.exe' OR LOWER("Parent Process Path") LIKE '%\umworkerprocess.exe' OR LOWER("Parent Process Path") LIKE '%\w3wp.exe' OR LOWER("Parent Process Path") LIKE '%\ws_tomcatservice.exe') OR ((LOWER("Parent Process Path") LIKE '%\java.exe' OR LOWER("Parent Process Path") LIKE '%\javaw.exe') AND (LOWER("Parent Process Path") LIKE '%-tomcat-%' OR LOWER("Parent Process Path") LIKE '%\tomcat%')) OR ((LOWER("Parent Process Path") LIKE '%\java.exe' OR LOWER("Parent Process Path") LIKE '%\javaw.exe') AND (LOWER("Parent Command") LIKE '%catalina_home%' OR LOWER("Parent Command") LIKE '%catalina.home%' OR LOWER("Parent Command") LIKE '%catalina.jar%'))) AND ((LOWER("Process Path") LIKE '%\arp.exe' OR LOWER("Process Path") LIKE '%\at.exe' OR LOWER("Process Path") LIKE '%\bash.exe' OR LOWER("Process Path") LIKE '%\bitsadmin.exe' OR LOWER("Process Path") LIKE '%\certutil.exe' OR LOWER("Process Path") LIKE '%\cmd.exe' OR LOWER("Process Path") LIKE '%\cscript.exe' OR LOWER("Process Path") LIKE '%\dsget.exe' OR LOWER("Process Path") LIKE '%\hostname.exe' OR LOWER("Process Path") LIKE '%\nbtstat.exe' OR LOWER("Process Path") LIKE '%\net.exe' OR LOWER("Process Path") LIKE '%\net1.exe' OR LOWER("Process Path") LIKE '%\netdom.exe' OR LOWER("Process Path") LIKE '%\netsh.exe' OR LOWER("Process Path") LIKE '%\nltest.exe' OR LOWER("Process Path") LIKE '%\ntdsutil.exe' OR LOWER("Process Path") LIKE '%\powershell_ise.exe' OR LOWER("Process Path") LIKE '%\powershell.exe' OR LOWER("Process Path") LIKE '%\pwsh.exe' OR LOWER("Process Path") LIKE '%\qprocess.exe' OR LOWER("Process Path") LIKE '%\query.exe' OR LOWER("Process Path") LIKE '%\qwinsta.exe' OR LOWER("Process Path") LIKE '%\reg.exe' OR LOWER("Process Path") LIKE '%\rundll32.exe' OR LOWER("Process Path") LIKE '%\sc.exe' OR LOWER("Process Path") LIKE '%\sh.exe' OR LOWER("Process Path") LIKE '%\wmic.exe' OR LOWER("Process Path") LIKE '%\wscript.exe' OR LOWER("Process Path") LIKE '%\wusa.exe') OR (LOWER("Process Name") LIKE '%\arp.exe' OR LOWER("Process Name") LIKE '%\at.exe' OR LOWER("Process Name") LIKE '%\bash.exe' OR LOWER("Process Name") LIKE '%\bitsadmin.exe' OR LOWER("Process Name") LIKE '%\certutil.exe' OR LOWER("Process Name") LIKE '%\cmd.exe' OR LOWER("Process Name") LIKE '%\cscript.exe' OR LOWER("Process Name") LIKE '%\dsget.exe' OR LOWER("Process Name") LIKE '%\hostname.exe' OR LOWER("Process Name") LIKE '%\nbtstat.exe' OR LOWER("Process Name") LIKE '%\net.exe' OR LOWER("Process Name") LIKE '%\net1.exe' OR LOWER("Process Name") LIKE '%\netdom.exe' OR LOWER("Process Name") LIKE '%\netsh.exe' OR LOWER("Process Name") LIKE '%\nltest.exe' OR LOWER("Process Name") LIKE '%\ntdsutil.exe' OR LOWER("Process Name") LIKE '%\powershell_ise.exe' OR LOWER("Process Name") LIKE '%\powershell.exe' OR LOWER("Process Name") LIKE '%\pwsh.exe' OR LOWER("Process Name") LIKE '%\qprocess.exe' OR LOWER("Process Name") LIKE '%\query.exe' OR LOWER("Process Name") LIKE '%\qwinsta.exe' OR LOWER("Process Name") LIKE '%\reg.exe' OR LOWER("Process Name") LIKE '%\rundll32.exe' OR LOWER("Process Name") LIKE '%\sc.exe' OR LOWER("Process Name") LIKE '%\sh.exe' OR LOWER("Process Name") LIKE '%\wmic.exe' OR LOWER("Process Name") LIKE '%\wscript.exe' OR LOWER("Process Name") LIKE '%\wusa.exe')) AND (NOT(((LOWER("Parent Process Path") LIKE '%\java.exe' AND LOWER(Command) LIKE '%windows\system32\cmd.exe /c c:\manageengine\admanager "plus\es\bin\elasticsearch.bat -enode.name=rmp-node1 -pelasticsearch-pid.txt') OR (LOWER("Parent Process Path") LIKE '%\java.exe' AND (LOWER(Command) LIKE '%sc query%' AND LOWER(Command) LIKE '%admanager plus%')))))

QRadar CRE

Design for the QRadar Rule Wizard. It is not importable and has not been tested in QRadar.

Rule name
OffSet7: Suspicious Process By Web Server Process
Rule type
Event rule (Local)
Log source types
Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1

Building blocks

  • BB:OffSet7:Suspicious Process By Web Server Process:selection_webserver_image (match)
    All test lines must match (AND).
    • Parent Process Path ends with: \caddy.exe, \httpd.exe, \nginx.exe, \php-cgi.exe, \php.exe, \tomcat.exe, \UMWorkerProcess.exe, \w3wp.exe, \ws_TomcatService.exe
  • BB:OffSet7:Suspicious Process By Web Server Process:selection_webserver_characteristics_tomcat1 (match)
    All test lines must match (AND).
    • Parent Process Path ends with: \java.exe, \javaw.exe
    • Parent Process Path contains: -tomcat-, \tomcat
  • BB:OffSet7:Suspicious Process By Web Server Process:selection_webserver_characteristics_tomcat2 (match)
    All test lines must match (AND).
    • Parent Process Path ends with: \java.exe, \javaw.exe
    • Parent Command contains: CATALINA_HOME, catalina.home, catalina.jar
  • BB:OffSet7:Suspicious Process By Web Server Process:selection_anomaly_children (match)
    All test lines must match (AND).
    • Process Path / Process Name ends with: \arp.exe, \at.exe, \bash.exe, \bitsadmin.exe, \certutil.exe, \cmd.exe, \cscript.exe, \dsget.exe, \hostname.exe, \nbtstat.exe, \net.exe, \net1.exe, \netdom.exe, \netsh.exe, \nltest.exe, \ntdsutil.exe, \powershell_ise.exe, \powershell.exe, \pwsh.exe, \qprocess.exe, \query.exe, \qwinsta.exe, \reg.exe, \rundll32.exe, \sc.exe, \sh.exe, \wmic.exe, \wscript.exe, \wusa.exe
  • BB:OffSet7:Suspicious Process By Web Server Process:filter_main_fp_1 (exclusion)
    All test lines must match (AND).
    • Parent Process Path ends with: \java.exe
    • Command ends with: Windows\system32\cmd.exe /c C:\ManageEngine\ADManager "Plus\ES\bin\elasticsearch.bat -Enode.name=RMP-NODE1 -pelasticsearch-pid.txt
  • BB:OffSet7:Suspicious Process By Web Server Process:filter_main_fp_2 (exclusion)
    All test lines must match (AND).
    • Parent Process Path ends with: \java.exe
    • Command contains: sc query, ADManager Plus

Main rule, option A (building blocks)

  1. when the event(s) were detected by one or more of these log source types: Microsoft Windows Security Event Log DSM: Security 4688 (with command-line auditing) or Sysmon EID 1
  2. when an event matches the condition built from these building blocks: (ANY of [BB:OffSet7:Suspicious Process By Web Server Process:selection_webserver_image, BB:OffSet7:Suspicious Process By Web Server Process:selection_webserver_characteristics_tomcat1, BB:OffSet7:Suspicious Process By Web Server Process:selection_webserver_characteristics_tomcat2]) AND BB:OffSet7:Suspicious Process By Web Server Process:selection_anomaly_children AND NOT (ANY of [BB:OffSet7:Suspicious Process By Web Server Process:filter_main_fp_1, BB:OffSet7:Suspicious Process By Web Server Process:filter_main_fp_2])

Main rule, option B (AQL filter test)

  1. when the event matches this AQL filter query: devicetype=12 AND ((LOWER("Parent Process Path") LIKE '%\caddy.exe' OR LOWER("Parent Process Path") LIKE '%\httpd.exe' OR LOWER("Parent Process Path") LIKE '%\nginx.exe' OR LOWER("Parent Process Path") LIKE '%\php-cgi.exe' OR LOWER("Parent Process Path") LIKE '%\php.exe' OR LOWER("Parent Process Path") LIKE '%\tomcat.exe' OR LOWER("Parent Process Path") LIKE '%\umworkerprocess.exe' OR LOWER("Parent Process Path") LIKE '%\w3wp.exe' OR LOWER("Parent Process Path") LIKE '%\ws_tomcatservice.exe') OR ((LOWER("Parent Process Path") LIKE '%\java.exe' OR LOWER("Parent Process Path") LIKE '%\javaw.exe') AND (LOWER("Parent Process Path") LIKE '%-tomcat-%' OR LOWER("Parent Process Path") LIKE '%\tomcat%')) OR ((LOWER("Parent Process Path") LIKE '%\java.exe' OR LOWER("Parent Process Path") LIKE '%\javaw.exe') AND (LOWER("Parent Command") LIKE '%catalina_home%' OR LOWER("Parent Command") LIKE '%catalina.home%' OR LOWER("Parent Command") LIKE '%catalina.jar%'))) AND ((LOWER("Process Path") LIKE '%\arp.exe' OR LOWER("Process Path") LIKE '%\at.exe' OR LOWER("Process Path") LIKE '%\bash.exe' OR LOWER("Process Path") LIKE '%\bitsadmin.exe' OR LOWER("Process Path") LIKE '%\certutil.exe' OR LOWER("Process Path") LIKE '%\cmd.exe' OR LOWER("Process Path") LIKE '%\cscript.exe' OR LOWER("Process Path") LIKE '%\dsget.exe' OR LOWER("Process Path") LIKE '%\hostname.exe' OR LOWER("Process Path") LIKE '%\nbtstat.exe' OR LOWER("Process Path") LIKE '%\net.exe' OR LOWER("Process Path") LIKE '%\net1.exe' OR LOWER("Process Path") LIKE '%\netdom.exe' OR LOWER("Process Path") LIKE '%\netsh.exe' OR LOWER("Process Path") LIKE '%\nltest.exe' OR LOWER("Process Path") LIKE '%\ntdsutil.exe' OR LOWER("Process Path") LIKE '%\powershell_ise.exe' OR LOWER("Process Path") LIKE '%\powershell.exe' OR LOWER("Process Path") LIKE '%\pwsh.exe' OR LOWER("Process Path") LIKE '%\qprocess.exe' OR LOWER("Process Path") LIKE '%\query.exe' OR LOWER("Process Path") LIKE '%\qwinsta.exe' OR LOWER("Process Path") LIKE '%\reg.exe' OR LOWER("Process Path") LIKE '%\rundll32.exe' OR LOWER("Process Path") LIKE '%\sc.exe' OR LOWER("Process Path") LIKE '%\sh.exe' OR LOWER("Process Path") LIKE '%\wmic.exe' OR LOWER("Process Path") LIKE '%\wscript.exe' OR LOWER("Process Path") LIKE '%\wusa.exe') OR (LOWER("Process Name") LIKE '%\arp.exe' OR LOWER("Process Name") LIKE '%\at.exe' OR LOWER("Process Name") LIKE '%\bash.exe' OR LOWER("Process Name") LIKE '%\bitsadmin.exe' OR LOWER("Process Name") LIKE '%\certutil.exe' OR LOWER("Process Name") LIKE '%\cmd.exe' OR LOWER("Process Name") LIKE '%\cscript.exe' OR LOWER("Process Name") LIKE '%\dsget.exe' OR LOWER("Process Name") LIKE '%\hostname.exe' OR LOWER("Process Name") LIKE '%\nbtstat.exe' OR LOWER("Process Name") LIKE '%\net.exe' OR LOWER("Process Name") LIKE '%\net1.exe' OR LOWER("Process Name") LIKE '%\netdom.exe' OR LOWER("Process Name") LIKE '%\netsh.exe' OR LOWER("Process Name") LIKE '%\nltest.exe' OR LOWER("Process Name") LIKE '%\ntdsutil.exe' OR LOWER("Process Name") LIKE '%\powershell_ise.exe' OR LOWER("Process Name") LIKE '%\powershell.exe' OR LOWER("Process Name") LIKE '%\pwsh.exe' OR LOWER("Process Name") LIKE '%\qprocess.exe' OR LOWER("Process Name") LIKE '%\query.exe' OR LOWER("Process Name") LIKE '%\qwinsta.exe' OR LOWER("Process Name") LIKE '%\reg.exe' OR LOWER("Process Name") LIKE '%\rundll32.exe' OR LOWER("Process Name") LIKE '%\sc.exe' OR LOWER("Process Name") LIKE '%\sh.exe' OR LOWER("Process Name") LIKE '%\wmic.exe' OR LOWER("Process Name") LIKE '%\wscript.exe' OR LOWER("Process Name") LIKE '%\wusa.exe')) AND (NOT(((LOWER("Parent Process Path") LIKE '%\java.exe' AND LOWER(Command) LIKE '%windows\system32\cmd.exe /c c:\manageengine\admanager "plus\es\bin\elasticsearch.bat -enode.name=rmp-node1 -pelasticsearch-pid.txt') OR (LOWER("Parent Process Path") LIKE '%\java.exe' AND (LOWER(Command) LIKE '%sc query%' AND LOWER(Command) LIKE '%admanager plus%')))))

Rule response

  • Severity 7, credibility 6, relevance 7
  • Ensure the detected event is part of an offense; index offense on Log Source (host) and annotate with the rule title and OffSet7 rule id
  • Respond no more than once per 30 minutes per Log Source (tune per environment)

Limitations

  • QRadar AQL LIKE / CRE string tests are case-sensitive unless the property is lower-cased; the AQL option uses LOWER() where the backend applied it.

Splunk

Splunk SPLSearch

Search for Splunk with Windows/Sysmon field names. A scheduled search or ES correlation search also needs a schedule, time range, throttling and an adaptive response, set in your environment.

(ParentImage IN ("*\\caddy.exe", "*\\httpd.exe", "*\\nginx.exe", "*\\php-cgi.exe", "*\\php.exe", "*\\tomcat.exe", "*\\UMWorkerProcess.exe", "*\\w3wp.exe", "*\\ws_TomcatService.exe") OR ((ParentImage IN ("*\\java.exe", "*\\javaw.exe")) (ParentImage IN ("*-tomcat-*", "*\\tomcat*"))) OR ((ParentImage IN ("*\\java.exe", "*\\javaw.exe")) (ParentCommandLine IN ("*CATALINA_HOME*", "*catalina.home*", "*catalina.jar*")))) (Image IN ("*\\arp.exe", "*\\at.exe", "*\\bash.exe", "*\\bitsadmin.exe", "*\\certutil.exe", "*\\cmd.exe", "*\\cscript.exe", "*\\dsget.exe", "*\\hostname.exe", "*\\nbtstat.exe", "*\\net.exe", "*\\net1.exe", "*\\netdom.exe", "*\\netsh.exe", "*\\nltest.exe", "*\\ntdsutil.exe", "*\\powershell_ise.exe", "*\\powershell.exe", "*\\pwsh.exe", "*\\qprocess.exe", "*\\query.exe", "*\\qwinsta.exe", "*\\reg.exe", "*\\rundll32.exe", "*\\sc.exe", "*\\sh.exe", "*\\wmic.exe", "*\\wscript.exe", "*\\wusa.exe")) NOT ((ParentImage="*\\java.exe" CommandLine="*Windows\\system32\\cmd.exe /c C:\\ManageEngine\\ADManager \"Plus\\ES\\bin\\elasticsearch.bat -Enode.name=RMP-NODE1 -pelasticsearch-pid.txt") OR (ParentImage="*\\java.exe" CommandLine="*sc query*" CommandLine="*ADManager Plus*"))

Splunk savedsearches.conf stanzaScheduled search template

Template stanza. Review schedule, alert actions and index/sourcetype for your environment before enabling.

[default]
dispatch.earliest_time = -30d
dispatch.latest_time = now

[Suspicious Process By Web Server Process]
description = Detects potentially suspicious processes being spawned by a web server process which could be the result of a successfully placed web shell or exploitation
search = (ParentImage IN ("*\\caddy.exe", "*\\httpd.exe", "*\\nginx.exe", "*\\php-cgi.exe", "*\\php.exe", "*\\tomcat.exe", "*\\UMWorkerProcess.exe", "*\\w3wp.exe", "*\\ws_TomcatService.exe") OR ((ParentImage IN ("*\\java.exe", "*\\javaw.exe")) (ParentImage IN ("*-tomcat-*", "*\\tomcat*"))) OR ((ParentImage IN ("*\\java.exe", "*\\javaw.exe")) (ParentCommandLine IN ("*CATALINA_HOME*", "*catalina.home*", "*catalina.jar*")))) (Image IN ("*\\arp.exe", "*\\at.exe", "*\\bash.exe", "*\\bitsadmin.exe", "*\\certutil.exe", "*\\cmd.exe", "*\\cscript.exe", "*\\dsget.exe", "*\\hostname.exe", "*\\nbtstat.exe", "*\\net.exe", "*\\net1.exe", "*\\netdom.exe", "*\\netsh.exe", "*\\nltest.exe", "*\\ntdsutil.exe", "*\\powershell_ise.exe", "*\\powershell.exe", "*\\pwsh.exe", "*\\qprocess.exe", "*\\query.exe", "*\\qwinsta.exe", "*\\reg.exe", "*\\rundll32.exe", "*\\sc.exe", "*\\sh.exe", "*\\wmic.exe", "*\\wscript.exe", "*\\wusa.exe")) NOT ((ParentImage="*\\java.exe" CommandLine="*Windows\\system32\\cmd.exe /c C:\\ManageEngine\\ADManager \"Plus\\ES\\bin\\elasticsearch.bat -Enode.name=RMP-NODE1 -pelasticsearch-pid.txt") OR (ParentImage="*\\java.exe" CommandLine="*sc query*" CommandLine="*ADManager Plus*"))

Microsoft Sentinel

Microsoft Sentinel KQL (ASIM)Hunting query

Hunting query over ASIM-normalized tables. An analytics rule also needs a schedule, entity mapping and alert grouping.

imProcessCreate
| where (((ParentProcessName endswith "\\caddy.exe" or ParentProcessName endswith "\\httpd.exe" or ParentProcessName endswith "\\nginx.exe" or ParentProcessName endswith "\\php-cgi.exe" or ParentProcessName endswith "\\php.exe" or ParentProcessName endswith "\\tomcat.exe" or ParentProcessName endswith "\\UMWorkerProcess.exe" or ParentProcessName endswith "\\w3wp.exe" or ParentProcessName endswith "\\ws_TomcatService.exe") or (ActingProcessName endswith "\\caddy.exe" or ActingProcessName endswith "\\httpd.exe" or ActingProcessName endswith "\\nginx.exe" or ActingProcessName endswith "\\php-cgi.exe" or ActingProcessName endswith "\\php.exe" or ActingProcessName endswith "\\tomcat.exe" or ActingProcessName endswith "\\UMWorkerProcess.exe" or ActingProcessName endswith "\\w3wp.exe" or ActingProcessName endswith "\\ws_TomcatService.exe")) or (((ParentProcessName endswith "\\java.exe" or ParentProcessName endswith "\\javaw.exe") or (ActingProcessName endswith "\\java.exe" or ActingProcessName endswith "\\javaw.exe")) and ((ParentProcessName contains "-tomcat-" or ParentProcessName contains "\\tomcat") or (ActingProcessName contains "-tomcat-" or ActingProcessName contains "\\tomcat"))) or (((ParentProcessName endswith "\\java.exe" or ParentProcessName endswith "\\javaw.exe") or (ActingProcessName endswith "\\java.exe" or ActingProcessName endswith "\\javaw.exe")) and (ActingProcessCommandLine contains "CATALINA_HOME" or ActingProcessCommandLine contains "catalina.home" or ActingProcessCommandLine contains "catalina.jar"))) and (TargetProcessName endswith "\\arp.exe" or TargetProcessName endswith "\\at.exe" or TargetProcessName endswith "\\bash.exe" or TargetProcessName endswith "\\bitsadmin.exe" or TargetProcessName endswith "\\certutil.exe" or TargetProcessName endswith "\\cmd.exe" or TargetProcessName endswith "\\cscript.exe" or TargetProcessName endswith "\\dsget.exe" or TargetProcessName endswith "\\hostname.exe" or TargetProcessName endswith "\\nbtstat.exe" or TargetProcessName endswith "\\net.exe" or TargetProcessName endswith "\\net1.exe" or TargetProcessName endswith "\\netdom.exe" or TargetProcessName endswith "\\netsh.exe" or TargetProcessName endswith "\\nltest.exe" or TargetProcessName endswith "\\ntdsutil.exe" or TargetProcessName endswith "\\powershell_ise.exe" or TargetProcessName endswith "\\powershell.exe" or TargetProcessName endswith "\\pwsh.exe" or TargetProcessName endswith "\\qprocess.exe" or TargetProcessName endswith "\\query.exe" or TargetProcessName endswith "\\qwinsta.exe" or TargetProcessName endswith "\\reg.exe" or TargetProcessName endswith "\\rundll32.exe" or TargetProcessName endswith "\\sc.exe" or TargetProcessName endswith "\\sh.exe" or TargetProcessName endswith "\\wmic.exe" or TargetProcessName endswith "\\wscript.exe" or TargetProcessName endswith "\\wusa.exe") and (not((((ParentProcessName endswith "\\java.exe" or ActingProcessName endswith "\\java.exe") and TargetProcessCommandLine endswith "Windows\\system32\\cmd.exe /c C:\\ManageEngine\\ADManager \"Plus\\ES\\bin\\elasticsearch.bat -Enode.name=RMP-NODE1 -pelasticsearch-pid.txt") or ((ParentProcessName endswith "\\java.exe" or ActingProcessName endswith "\\java.exe") and (TargetProcessCommandLine contains "sc query" and TargetProcessCommandLine contains "ADManager Plus")))))

Defender XDR

Microsoft Defender XDR KQLHunting query

Advanced hunting query. A custom detection rule also needs a frequency, impacted entities and actions.

DeviceProcessEvents
| where ((InitiatingProcessFolderPath endswith "\\caddy.exe" or InitiatingProcessFolderPath endswith "\\httpd.exe" or InitiatingProcessFolderPath endswith "\\nginx.exe" or InitiatingProcessFolderPath endswith "\\php-cgi.exe" or InitiatingProcessFolderPath endswith "\\php.exe" or InitiatingProcessFolderPath endswith "\\tomcat.exe" or InitiatingProcessFolderPath endswith "\\UMWorkerProcess.exe" or InitiatingProcessFolderPath endswith "\\w3wp.exe" or InitiatingProcessFolderPath endswith "\\ws_TomcatService.exe") or ((InitiatingProcessFolderPath endswith "\\java.exe" or InitiatingProcessFolderPath endswith "\\javaw.exe") and (InitiatingProcessFolderPath contains "-tomcat-" or InitiatingProcessFolderPath contains "\\tomcat")) or ((InitiatingProcessFolderPath endswith "\\java.exe" or InitiatingProcessFolderPath endswith "\\javaw.exe") and (InitiatingProcessCommandLine contains "CATALINA_HOME" or InitiatingProcessCommandLine contains "catalina.home" or InitiatingProcessCommandLine contains "catalina.jar"))) and (FolderPath endswith "\\arp.exe" or FolderPath endswith "\\at.exe" or FolderPath endswith "\\bash.exe" or FolderPath endswith "\\bitsadmin.exe" or FolderPath endswith "\\certutil.exe" or FolderPath endswith "\\cmd.exe" or FolderPath endswith "\\cscript.exe" or FolderPath endswith "\\dsget.exe" or FolderPath endswith "\\hostname.exe" or FolderPath endswith "\\nbtstat.exe" or FolderPath endswith "\\net.exe" or FolderPath endswith "\\net1.exe" or FolderPath endswith "\\netdom.exe" or FolderPath endswith "\\netsh.exe" or FolderPath endswith "\\nltest.exe" or FolderPath endswith "\\ntdsutil.exe" or FolderPath endswith "\\powershell_ise.exe" or FolderPath endswith "\\powershell.exe" or FolderPath endswith "\\pwsh.exe" or FolderPath endswith "\\qprocess.exe" or FolderPath endswith "\\query.exe" or FolderPath endswith "\\qwinsta.exe" or FolderPath endswith "\\reg.exe" or FolderPath endswith "\\rundll32.exe" or FolderPath endswith "\\sc.exe" or FolderPath endswith "\\sh.exe" or FolderPath endswith "\\wmic.exe" or FolderPath endswith "\\wscript.exe" or FolderPath endswith "\\wusa.exe") and (not(((InitiatingProcessFolderPath endswith "\\java.exe" and ProcessCommandLine endswith "Windows\\system32\\cmd.exe /c C:\\ManageEngine\\ADManager \"Plus\\ES\\bin\\elasticsearch.bat -Enode.name=RMP-NODE1 -pelasticsearch-pid.txt") or (InitiatingProcessFolderPath endswith "\\java.exe" and (ProcessCommandLine contains "sc query" and ProcessCommandLine contains "ADManager Plus")))))

Elastic

Elastic Lucene (ECS)Hunting query

Lucene query over ECS fields (Winlogbeat/Elastic Agent Windows mappings). A detection rule also needs an index pattern, schedule and actions.

((process.parent.executable:(*\\caddy.exe OR *\\httpd.exe OR *\\nginx.exe OR *\\php\-cgi.exe OR *\\php.exe OR *\\tomcat.exe OR *\\UMWorkerProcess.exe OR *\\w3wp.exe OR *\\ws_TomcatService.exe)) OR ((process.parent.executable:(*\\java.exe OR *\\javaw.exe)) AND (process.parent.executable:(*\-tomcat\-* OR *\\tomcat*))) OR ((process.parent.executable:(*\\java.exe OR *\\javaw.exe)) AND (process.parent.command_line:(*CATALINA_HOME* OR *catalina.home* OR *catalina.jar*)))) AND (process.executable:(*\\arp.exe OR *\\at.exe OR *\\bash.exe OR *\\bitsadmin.exe OR *\\certutil.exe OR *\\cmd.exe OR *\\cscript.exe OR *\\dsget.exe OR *\\hostname.exe OR *\\nbtstat.exe OR *\\net.exe OR *\\net1.exe OR *\\netdom.exe OR *\\netsh.exe OR *\\nltest.exe OR *\\ntdsutil.exe OR *\\powershell_ise.exe OR *\\powershell.exe OR *\\pwsh.exe OR *\\qprocess.exe OR *\\query.exe OR *\\qwinsta.exe OR *\\reg.exe OR *\\rundll32.exe OR *\\sc.exe OR *\\sh.exe OR *\\wmic.exe OR *\\wscript.exe OR *\\wusa.exe)) AND (NOT ((process.parent.executable:*\\java.exe AND process.command_line:*Windows\\system32\\cmd.exe\ \/c\ C\:\\ManageEngine\\ADManager\ \"Plus\\ES\\bin\\elasticsearch.bat\ \-Enode.name\=RMP\-NODE1\ \-pelasticsearch\-pid.txt) OR (process.parent.executable:*\\java.exe AND (process.command_line:*sc\ query* AND process.command_line:*ADManager\ Plus*))))

Elastic EQL (ECS)Hunting query

EQL query over ECS fields. Usable in an Elastic Security EQL rule after review; index pattern and schedule are set per environment.

any where ((process.parent.executable like~ ("*\\caddy.exe", "*\\httpd.exe", "*\\nginx.exe", "*\\php-cgi.exe", "*\\php.exe", "*\\tomcat.exe", "*\\UMWorkerProcess.exe", "*\\w3wp.exe", "*\\ws_TomcatService.exe")) or ((process.parent.executable like~ ("*\\java.exe", "*\\javaw.exe")) and (process.parent.executable like~ ("*-tomcat-*", "*\\tomcat*"))) or ((process.parent.executable like~ ("*\\java.exe", "*\\javaw.exe")) and (process.parent.command_line like~ ("*CATALINA_HOME*", "*catalina.home*", "*catalina.jar*")))) and (process.executable like~ ("*\\arp.exe", "*\\at.exe", "*\\bash.exe", "*\\bitsadmin.exe", "*\\certutil.exe", "*\\cmd.exe", "*\\cscript.exe", "*\\dsget.exe", "*\\hostname.exe", "*\\nbtstat.exe", "*\\net.exe", "*\\net1.exe", "*\\netdom.exe", "*\\netsh.exe", "*\\nltest.exe", "*\\ntdsutil.exe", "*\\powershell_ise.exe", "*\\powershell.exe", "*\\pwsh.exe", "*\\qprocess.exe", "*\\query.exe", "*\\qwinsta.exe", "*\\reg.exe", "*\\rundll32.exe", "*\\sc.exe", "*\\sh.exe", "*\\wmic.exe", "*\\wscript.exe", "*\\wusa.exe")) and (not ((process.parent.executable:"*\\java.exe" and process.command_line:"*Windows\\system32\\cmd.exe /c C:\\ManageEngine\\ADManager \"Plus\\ES\\bin\\elasticsearch.bat -Enode.name=RMP-NODE1 -pelasticsearch-pid.txt") or (process.parent.executable:"*\\java.exe" and (process.command_line:"*sc query*" and process.command_line:"*ADManager Plus*"))))

Elastic ES|QL (ECS)Hunting query

ES|QL query over ECS fields; the FROM clause uses * and must be narrowed to your indices.

from * metadata _id, _index, _version | where (ends_with(process.parent.executable, "\\caddy.exe") or ends_with(process.parent.executable, "\\httpd.exe") or ends_with(process.parent.executable, "\\nginx.exe") or ends_with(process.parent.executable, "\\php-cgi.exe") or ends_with(process.parent.executable, "\\php.exe") or ends_with(process.parent.executable, "\\tomcat.exe") or ends_with(process.parent.executable, "\\UMWorkerProcess.exe") or ends_with(process.parent.executable, "\\w3wp.exe") or ends_with(process.parent.executable, "\\ws_TomcatService.exe") or (ends_with(process.parent.executable, "\\java.exe") or ends_with(process.parent.executable, "\\javaw.exe")) and (process.parent.executable like "*-tomcat-*" or process.parent.executable like "*\\\\tomcat*") or (ends_with(process.parent.executable, "\\java.exe") or ends_with(process.parent.executable, "\\javaw.exe")) and (process.parent.command_line like "*CATALINA_HOME*" or process.parent.command_line like "*catalina.home*" or process.parent.command_line like "*catalina.jar*")) and (ends_with(process.executable, "\\arp.exe") or ends_with(process.executable, "\\at.exe") or ends_with(process.executable, "\\bash.exe") or ends_with(process.executable, "\\bitsadmin.exe") or ends_with(process.executable, "\\certutil.exe") or ends_with(process.executable, "\\cmd.exe") or ends_with(process.executable, "\\cscript.exe") or ends_with(process.executable, "\\dsget.exe") or ends_with(process.executable, "\\hostname.exe") or ends_with(process.executable, "\\nbtstat.exe") or ends_with(process.executable, "\\net.exe") or ends_with(process.executable, "\\net1.exe") or ends_with(process.executable, "\\netdom.exe") or ends_with(process.executable, "\\netsh.exe") or ends_with(process.executable, "\\nltest.exe") or ends_with(process.executable, "\\ntdsutil.exe") or ends_with(process.executable, "\\powershell_ise.exe") or ends_with(process.executable, "\\powershell.exe") or ends_with(process.executable, "\\pwsh.exe") or ends_with(process.executable, "\\qprocess.exe") or ends_with(process.executable, "\\query.exe") or ends_with(process.executable, "\\qwinsta.exe") or ends_with(process.executable, "\\reg.exe") or ends_with(process.executable, "\\rundll32.exe") or ends_with(process.executable, "\\sc.exe") or ends_with(process.executable, "\\sh.exe") or ends_with(process.executable, "\\wmic.exe") or ends_with(process.executable, "\\wscript.exe") or ends_with(process.executable, "\\wusa.exe")) and not (ends_with(process.parent.executable, "\\java.exe") and ends_with(process.command_line, "Windows\\system32\\cmd.exe /c C:\\ManageEngine\\ADManager \"Plus\\ES\\bin\\elasticsearch.bat -Enode.name=RMP-NODE1 -pelasticsearch-pid.txt") or ends_with(process.parent.executable, "\\java.exe") and process.command_line like "*sc query*" and process.command_line like "*ADManager Plus*")

Required telemetry

Log source
product: windows · category: process_creation
Fields used
CommandLine Image ParentCommandLine ParentImage

False positives

  • Particular web applications may spawn a shell process legitimately

Investigation and response

No OffSet7 investigation guidance has been written for this rule yet. Start from the false positives above and the ATT&CK technique pages.

References

Author and attribution

Author
Thomas Patzke, Florian Roth (Nextron Systems), Zach Stanford @svch0st, Tim Shelton, Nasreddine Bencherchali (Nextron Systems)
Source
SigmaHQ · rules/windows/process_creation/proc_creation_win_webshell_susp_process_spawned_from_webserver.yml
Upstream commit
9688134317a2
Licence
Detection Rule License (DRL) 1.1

Version history

  1. Version 1Imported from SigmaHQ
  2. OffSet7 build · SigmaHQ 9688134317a2

Related rules