Detection rules › Sigma
Windows Subsystem for Linux (WSL) installation (PowerShell)
Detects scenarios where an attacker enables the WSL to cary out malicious activities in a virtual instance to avoid detection.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth | T1564.006 Hide Artifacts: Run Virtual Instance |
Event coverage
| Provider | Event | Title |
|---|---|---|
| PowerShell | Event ID 4103 | Payload Context: ContextInfo User Data: UserData. |
| PowerShell | Event ID 4104 | Creating Scriptblock text (MessageNumber of MessageTotal). |
Rule body yaml
title: Windows Subsystem for Linux (WSL) installation (PowerShell)
description: Detects scenarios where an attacker enables the WSL to cary out malicious activities in a virtual instance to avoid detection.
references:
- https://www.hackers-arise.com/post/linux-basics-for-hackers-part-13-the-windows-subsystem-for-linux-wsl
- https://linuxhint.com/enable-wsl-optional-component/
- https://blog.lumen.com/no-longer-just-theory-black-lotus-labs-uncovers-linux-executables-deployed-as-stealth-windows-loaders/
- https://learn.microsoft.com/en-us/windows/wsl/
tags:
- attack.defense_evasion
- attack.t1564.006
author: mdecrevoisier
status: experimental
logsource:
product: windows
category:
- ps_module
- ps_classic_script
- ps_script
detection: # full command "Enable-windowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux"
selection2_powershell_modern:
EventID: 4103
Payload|contains:
- 'Enable-windowsOptionalFeature'
- 'Microsoft-Windows-Subsystem-Linux'
selection3_powershell_block:
EventID: 4104
ScriptBlockText|contains:
- 'Enable-windowsOptionalFeature'
- 'Microsoft-Windows-Subsystem-Linux'
condition: 1 of selection*
falsepositives:
- developer computer (with Visual Studio Code)
- administrator activity
level: medium
Stages and Predicates
Stage 0: condition
1 of selection*Stage 1: selection2_powershell_modern
selection2_powershell_modern:
EventID: 4103
Payload|contains:
- 'Enable-windowsOptionalFeature'
- 'Microsoft-Windows-Subsystem-Linux'
Stage 2: selection3_powershell_block
selection3_powershell_block:
EventID: 4104
ScriptBlockText|contains:
- 'Enable-windowsOptionalFeature'
- '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.
| Field | Kind | Values |
|---|---|---|
Payload | match |
|
ScriptBlockText | match |
|