Detection rules › Sigma

WSL Child Process Anomaly

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Nasreddine Bencherchali (Nextron Systems)
Source
github.com/SigmaHQ/sigma

Detects uncommon or suspicious child processes spawning from a WSL process. This could indicate an attempt to evade parent/child relationship detections or persistence attempts via cron using WSL

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: WSL Child Process Anomaly
id: 2267fe65-0681-42ad-9a6d-46553d3f3480
related:
    - id: dec44ca7-61ad-493c-bfd7-8819c5faa09b # LOLBIN Rule
      type: derived
status: test
description: Detects uncommon or suspicious child processes spawning from a WSL process. This could indicate an attempt to evade parent/child relationship detections or persistence attempts via cron using WSL
references:
    - https://lolbas-project.github.io/lolbas/OtherMSBinaries/Wsl/
    - https://twitter.com/nas_bench/status/1535431474429808642
author: Nasreddine Bencherchali (Nextron Systems)
date: 2023-01-23
modified: 2023-08-15
tags:
    - attack.execution
    - attack.stealth
    - attack.t1218
    - attack.t1202
logsource:
    category: process_creation
    product: windows
detection:
    selection_parent:
        ParentImage|endswith:
            - '\wsl.exe'
            - '\wslhost.exe'
    selection_children_images:
        Image|endswith:
            # Add more suspicious/uncommon "lolbin" processes
            - '\calc.exe'
            - '\cmd.exe'
            - '\cscript.exe'
            - '\mshta.exe'
            - '\powershell.exe'
            - '\pwsh.exe'
            - '\regsvr32.exe'
            - '\rundll32.exe'
            - '\wscript.exe'
    selection_children_paths:
        Image|contains:
            - '\AppData\Local\Temp\'
            - 'C:\Users\Public\'
            - 'C:\Windows\Temp\'
            - 'C:\Temp\'
            - '\Downloads\'
            - '\Desktop\'
    condition: selection_parent and 1 of selection_children_*
falsepositives:
    - Unknown
level: medium

Stages and Predicates

Stage 0: condition

selection_parent and 1 of selection_children_*

Stage 1: selection_parent

selection_parent:
    ParentImage|endswith:
        - '\wsl.exe'
        - '\wslhost.exe'

Stage 2: selection_children_images

selection_children_images:
    Image|endswith:
        - '\calc.exe'
        - '\cmd.exe'
        - '\cscript.exe'
        - '\mshta.exe'
        - '\powershell.exe'
        - '\pwsh.exe'
        - '\regsvr32.exe'
        - '\rundll32.exe'
        - '\wscript.exe'

Stage 3: selection_children_paths

selection_children_paths:
    Image|contains:
        - '\AppData\Local\Temp\'
        - 'C:\Users\Public\'
        - 'C:\Windows\Temp\'
        - 'C:\Temp\'
        - '\Downloads\'
        - '\Desktop\'

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
  • \calc.exe corpus 13 (sigma 13)
  • \cmd.exe corpus 130 (sigma 130)
  • \cscript.exe corpus 73 (sigma 73)
  • \mshta.exe corpus 67 (sigma 67)
  • \powershell.exe corpus 182 (sigma 182)
  • \pwsh.exe corpus 168 (sigma 168)
  • \regsvr32.exe corpus 65 (sigma 65)
  • \rundll32.exe corpus 95 (sigma 95)
  • \wscript.exe corpus 75 (sigma 75)
Imagematch
  • C:\Temp\
  • C:\Users\Public\ corpus 2 (sigma 2)
  • C:\Windows\Temp\ corpus 2 (sigma 2)
  • \AppData\Local\Temp\ corpus 11 (sigma 11)
  • \Desktop\ corpus 7 (sigma 7)
  • \Downloads\ corpus 10 (sigma 10)
ParentImageends_with
  • \wsl.exe corpus 4 (sigma 4)
  • \wslhost.exe corpus 2 (sigma 2)