Detection rules › Sigma

Windows Subsystem for Linux (WSL) installation (command)

Status
experimental
Severity
medium
Log source
product windows, category process_creation
Author
mdecrevoisier
Source
github.com/mdecrevoisier/SIGMA-detection-rules

Detects scenarios where an attacker enables the WSL to cary out malicious activities in a virtual instance to avoid detection.

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Windows Subsystem for Linux (WSL) installation (command)
description: Detects scenarios where an attacker enables the WSL to cary out malicious activities in a virtual instance to avoid detection.
references:
- https://github.com/mdecrevoisier/EVTX-to-MITRE-Attack/tree/master/TA0005-Defense%20Evasion/T1564-Hide%20artifacts
- https://learn.microsoft.com/en-us/windows/wsl/install-manual
- https://learn.microsoft.com/en-us/windows/wsl/install
- https://lolbas-project.github.io/lolbas/OtherMSBinaries/Wsl/
- https://blog.f-secure.com/hunting-for-windows-subsystem-for-linux/
- https://blog.lumen.com/no-longer-just-theory-black-lotus-labs-uncovers-linux-executables-deployed-as-stealth-windows-loaders/
tags:
- attack.defense_evasion
- attack.t1564.006
author: mdecrevoisier
status: experimental
logsource:
  product: windows
  category: process_creation
detection:
  selection_wsl_activation_modern: # wsl --install
    CommandLine|contains|all:
      - wsl
      - '--install'

  selection_wsl_activation_deprecated: # dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
    NewProcessName|endswith: '\dism.exe'
    CommandLine|contains|all: 
      - Enable-feature
      - Microsoft-Windows-Subsystem-Linux
      
  condition: selection_wsl_activation_modern or selection_wsl_activation_deprecated
falsepositives:
- developer computer (with Visual Studio Code)
- administrator activity
level: medium

Stages and Predicates

Stage 0: condition

selection_wsl_activation_modern or selection_wsl_activation_deprecated

Stage 1: selection_wsl_activation_modern

selection_wsl_activation_modern:
  CommandLine|contains|all:
    - wsl
    - '--install'

Stage 2: selection_wsl_activation_deprecated

selection_wsl_activation_deprecated:
  NewProcessName|endswith: '\dism.exe'
  CommandLine|contains|all:
    - Enable-feature
    - Microsoft-Windows-Subsystem-Linux

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
CommandLinematch
  • --install corpus 3 (sigma 3)
  • Enable-feature
  • Microsoft-Windows-Subsystem-Linux corpus 3 (sigma 2, elastic 1)
  • wsl
NewProcessNameends_with
  • \dism.exe corpus 6 (sigma 6)