Detection rules › Sigma

Linux Webshell Indicators

Status
test
Severity
high
Log source
product linux, category process_creation
Author
Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects suspicious sub processes of web server processes

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Linux Webshell Indicators
id: 818f7b24-0fba-4c49-a073-8b755573b9c7
status: test
description: Detects suspicious sub processes of web server processes
references:
    - https://www.acunetix.com/blog/articles/web-shells-101-using-php-introduction-web-shells-part-2/
    - https://media.defense.gov/2020/Jun/09/2002313081/-1/-1/0/CSI-DETECT-AND-PREVENT-WEB-SHELL-MALWARE-20200422.PDF
author: Florian Roth (Nextron Systems), Nasreddine Bencherchali (Nextron Systems)
date: 2021-10-15
modified: 2022-12-28
tags:
    - attack.persistence
    - attack.t1505.003
logsource:
    product: linux
    category: process_creation
detection:
    selection_general:
        ParentImage|endswith:
            - '/httpd'
            - '/lighttpd'
            - '/nginx'
            - '/apache2'
            - '/node'
            - '/caddy'
    selection_tomcat:
        ParentCommandLine|contains|all:
            - '/bin/java'
            - 'tomcat'
    selection_websphere:  # ? just guessing
        ParentCommandLine|contains|all:
            - '/bin/java'
            - 'websphere'
    sub_processes:
        Image|endswith:
            - '/whoami'
            - '/ifconfig'
            - '/ip'
            - '/bin/uname'
            - '/bin/cat'
            - '/bin/crontab'
            - '/hostname'
            - '/iptables'
            - '/netstat'
            - '/pwd'
            - '/route'
    condition: 1 of selection_* and sub_processes
falsepositives:
    - Web applications that invoke Linux command line tools
level: high

Stages and Predicates

Stage 0: condition

1 of selection_* and sub_processes

Stage 1: selection_general

selection_general:
    ParentImage|endswith:
        - '/httpd'
        - '/lighttpd'
        - '/nginx'
        - '/apache2'
        - '/node'
        - '/caddy'

Stage 2: selection_tomcat

selection_tomcat:
    ParentCommandLine|contains|all:
        - '/bin/java'
        - 'tomcat'

Stage 3: selection_websphere

selection_websphere:
    ParentCommandLine|contains|all:
        - '/bin/java'
        - 'websphere'

Stage 4: sub_processes

sub_processes:
    Image|endswith:
        - '/whoami'
        - '/ifconfig'
        - '/ip'
        - '/bin/uname'
        - '/bin/cat'
        - '/bin/crontab'
        - '/hostname'
        - '/iptables'
        - '/netstat'
        - '/pwd'
        - '/route'

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
Imageends_with
  • /bin/cat
  • /bin/crontab
  • /bin/uname
  • /hostname
  • /ifconfig
  • /ip
  • /iptables
  • /netstat
  • /pwd
  • /route
  • /whoami
ParentCommandLinematch
  • /bin/java
  • tomcat
  • websphere
ParentImageends_with
  • /apache2
  • /caddy
  • /httpd
  • /lighttpd
  • /nginx
  • /node