Detection rules › Sigma

Suspicious Process By Web Server Process

Status
test
Severity
high
Log source
category process_creation, product windows
Author
Thomas Patzke, Florian Roth (Nextron Systems), Zach Stanford @svch0st, Tim Shelton, Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

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

Known false positives

  • Particular web applications may spawn a shell process legitimately

MITRE ATT&CK coverage

Telemetry coverage

ProviderRecord / event type
SysmonEvent ID 1: Process creation

Rule body

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

Stages and Predicates

Stage 0: condition

1 of selection_webserver_* and selection_anomaly_children and not 1 of filter_main_*

Stage 1: selection_webserver_image

selection_webserver_image:
    ParentImage|endswith:
        - '\caddy.exe'
        - '\httpd.exe'
        - '\nginx.exe'
        - '\php-cgi.exe'
        - '\php.exe'
        - '\tomcat.exe'
        - '\UMWorkerProcess.exe'
        - '\w3wp.exe'
        - '\ws_TomcatService.exe'

Stage 2: selection_webserver_characteristics_tomcat1

selection_webserver_characteristics_tomcat1:
    ParentImage|endswith:
        - '\java.exe'
        - '\javaw.exe'
    ParentImage|contains:
        - '-tomcat-'
        - '\tomcat'

Stage 3: selection_webserver_characteristics_tomcat2

selection_webserver_characteristics_tomcat2:
    ParentImage|endswith:
        - '\java.exe'
        - '\javaw.exe'
    ParentCommandLine|contains:
        - 'CATALINA_HOME'
        - 'catalina.home'
        - 'catalina.jar'

Stage 4: selection_anomaly_children

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'

Stage 5: not filter_main_*

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'

Exclusions

The rule actively suppresses these predicates.

FieldKindExcluded valuesSearch
CommandLineends_withWindows\system32\cmd.exe /c C:\ManageEngine\ADManager "Plus\ES\bin\elasticsearch.bat -Enode.name=RMP-NODE1 -pelasticsearch-pid.txtexcludes:CommandLine
ParentImageends_with\java.exeexcludes:ParentImage field:"ParentImage" value:"\java.exe"
CommandLinematchADManager Plusexcludes:CommandLine field:"CommandLine" value:"ADManager Plus"
CommandLinematchsc queryexcludes:CommandLine field:"CommandLine" value:"sc query"

Indicators

These rows show field, operator, and value matches.

FieldKindValuesSearch
Imageends_with
  • \arp.exe corpus 3 (sigma 3)
  • \at.exe corpus 2 (sigma 2)
  • \bash.exe corpus 21 (sigma 21)
  • \bitsadmin.exe corpus 29 (sigma 29)
  • \certutil.exe corpus 44 (sigma 43, kusto 1)
  • \cmd.exe corpus 130 (sigma 130)
  • \cscript.exe corpus 72 (sigma 72)
  • \dsget.exe
  • \hostname.exe corpus 2 (sigma 2)
  • \nbtstat.exe
  • \net.exe corpus 49 (sigma 49)
  • \net1.exe corpus 47 (sigma 47)
  • \netdom.exe
  • \netsh.exe corpus 28 (sigma 28)
  • \nltest.exe corpus 9 (sigma 9)
  • \ntdsutil.exe corpus 5 (sigma 5)
  • \powershell.exe corpus 179 (sigma 178, kusto 1)
  • \powershell_ise.exe corpus 41 (sigma 41)
  • \pwsh.exe corpus 165 (sigma 164, kusto 1)
  • \qprocess.exe
  • \query.exe corpus 6 (sigma 6)
  • \qwinsta.exe corpus 2 (sigma 2)
  • \reg.exe corpus 58 (sigma 58)
  • \rundll32.exe corpus 94 (sigma 94)
  • \sc.exe corpus 30 (sigma 30)
  • \sh.exe corpus 16 (sigma 16)
  • \wmic.exe corpus 62 (sigma 62)
  • \wscript.exe corpus 74 (sigma 74)
  • \wusa.exe corpus 4 (sigma 4)
field:"Image" kind:ends_with
ParentCommandLinematch
  • CATALINA_HOME
  • catalina.home
  • catalina.jar
field:"ParentCommandLine" kind:match
ParentImageends_with
  • \UMWorkerProcess.exe corpus 2 (sigma 2)
  • \caddy.exe corpus 4 (sigma 4)
  • \httpd.exe corpus 6 (sigma 6)
  • \java.exe corpus 8 (sigma 8)
  • \javaw.exe corpus 7 (sigma 7)
  • \nginx.exe corpus 6 (sigma 6)
  • \php-cgi.exe corpus 6 (sigma 6)
  • \php.exe
  • \tomcat.exe
  • \w3wp.exe corpus 12 (sigma 12)
  • \ws_TomcatService.exe corpus 6 (sigma 6)
field:"ParentImage" kind:ends_with
ParentImagematch
  • -tomcat- corpus 4 (sigma 4)
  • \tomcat corpus 6 (sigma 6)
field:"ParentImage" kind:match