Detection rules › Sigma

Potential Webshell Creation On Static Website

Status
test
Severity
medium
Log source
product windows, category file_event
Author
Beyu Denis, oscd.community, Tim Shelton, Thurein Oo
Source
github.com/SigmaHQ/sigma

Detects the creation of files with certain extensions on a static web site. This can be indicative of potential uploads of a web shell.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 11FileCreate

Rule body yaml

title: Potential Webshell Creation On Static Website
id: 39f1f9f2-9636-45de-98f6-a4046aa8e4b9
status: test
description: Detects the creation of files with certain extensions on a static web site. This can be indicative of potential uploads of a web shell.
references:
    - PT ESC rule and personal experience
    - https://github.com/swisskyrepo/PayloadsAllTheThings/blob/c95a0a1a2855dc0cd7f7327614545fe30482a636/Upload%20Insecure%20Files/README.md
author: Beyu Denis, oscd.community, Tim Shelton, Thurein Oo
date: 2019-10-22
modified: 2023-10-15
tags:
    - attack.persistence
    - attack.t1505.003
logsource:
    product: windows
    category: file_event
detection:
    selection_wwwroot_path:
        TargetFilename|contains: '\inetpub\wwwroot\'
    selection_wwwroot_ext:
        TargetFilename|contains:
            - '.ashx'
            - '.asp'
            - '.ph'
            - '.soap'
    selection_htdocs_path:
        TargetFilename|contains:
            - '\www\'
            - '\htdocs\'
            - '\html\'
    selection_htdocs_ext:
        TargetFilename|contains: '.ph'
    # selection_tomcat_path:
    #     TargetFilename|contains: '\webapps\ROOT'
    # selection_tomcat_ext:
    #     TargetFilename|contains:
    #         - '.jsp' # .jspx, .jspf
    #         - '.jsv'
    #         - '.jsw'
    filter_main_temp:  # FP when unpacking some executables in $TEMP
        TargetFilename|contains:
            - '\AppData\Local\Temp\'
            - '\Windows\Temp\'
    filter_main_system:
        Image: 'System' # FP when backup/restore from drivers
    filter_main_legitimate:
        TargetFilename|contains: '\xampp'
    condition: (all of selection_wwwroot_* or all of selection_htdocs_*) and not 1 of filter_main_*
falsepositives:
    - Legitimate administrator or developer creating legitimate executable files in a web application folder
level: medium

Stages and Predicates

Stage 0: condition

(all of selection_wwwroot_* or all of selection_htdocs_*) and not 1 of filter_main_*

Stage 1: selection_wwwroot_path

selection_wwwroot_path:
    TargetFilename|contains: '\inetpub\wwwroot\'

Stage 2: selection_wwwroot_ext

selection_wwwroot_ext:
    TargetFilename|contains:
        - '.ashx'
        - '.asp'
        - '.ph'
        - '.soap'

Stage 3: selection_htdocs_path

selection_htdocs_path:
    TargetFilename|contains:
        - '\www\'
        - '\htdocs\'
        - '\html\'

Stage 4: selection_htdocs_ext

selection_htdocs_ext:
    TargetFilename|contains: '.ph'

Stage 5: not filter_main_*

filter_main_temp:
    TargetFilename|contains:
        - '\AppData\Local\Temp\'
        - '\Windows\Temp\'
filter_main_system:
    Image: 'System'
filter_main_legitimate:
    TargetFilename|contains: '\xampp'

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
ImageeqSystem
TargetFilenamematch\AppData\Local\Temp\
TargetFilenamematch\Windows\Temp\
TargetFilenamematch\xampp

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
TargetFilenamematch
  • .ashx
  • .asp
  • .ph
  • .soap
  • \htdocs\
  • \html\
  • \inetpub\wwwroot\ corpus 2 (sigma 2)
  • \www\