Execution via Windows Subsystem for Linux
Detects attempts to execute a program on the host from the Windows Subsystem for Linux. Adversaries may enable and use WSL for Linux to avoid detection.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2023/01/12"
3integration = ["endpoint", "windows", "system"]
4maturity = "production"
5updated_date = "2024/05/21"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects attempts to execute a program on the host from the Windows Subsystem for Linux. Adversaries may enable and use
11WSL for Linux to avoid detection.
12"""
13from = "now-9m"
14index = [
15 "winlogbeat-*",
16 "logs-endpoint.events.process-*",
17 "logs-windows.*",
18 "endgame-*",
19 "logs-system.security*",
20]
21language = "eql"
22license = "Elastic License v2"
23name = "Execution via Windows Subsystem for Linux"
24references = ["https://learn.microsoft.com/en-us/windows/wsl/wsl-config"]
25risk_score = 47
26rule_id = "db7dbad5-08d2-4d25-b9b1-d3a1e4a15efd"
27severity = "medium"
28tags = [
29 "Domain: Endpoint",
30 "OS: Windows",
31 "Use Case: Threat Detection",
32 "Tactic: Defense Evasion",
33 "Data Source: Elastic Endgame",
34 "Data Source: Elastic Defend",
35]
36timestamp_override = "event.ingested"
37type = "eql"
38
39query = '''
40process where host.os.type == "windows" and event.type : "start" and
41 process.parent.name : ("wsl.exe", "wslhost.exe") and
42 not process.executable : (
43 "?:\\Program Files (x86)\\*",
44 "?:\\Program Files\\*",
45 "?:\\Program Files*\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForLinux_*\\wsl*.exe",
46 "?:\\Windows\\System32\\conhost.exe",
47 "?:\\Windows\\System32\\lxss\\wslhost.exe",
48 "?:\\Windows\\System32\\WerFault.exe",
49 "?:\\Windows\\Sys*\\wslconfig.exe"
50 )
51'''
52
53
54[[rule.threat]]
55framework = "MITRE ATT&CK"
56[[rule.threat.technique]]
57id = "T1202"
58name = "Indirect Command Execution"
59reference = "https://attack.mitre.org/techniques/T1202/"
60
61
62[rule.threat.tactic]
63id = "TA0005"
64name = "Defense Evasion"
65reference = "https://attack.mitre.org/tactics/TA0005/"
References
Related rules
- Adding Hidden File Attribute via Attrib
- Attempt to Install Kali Linux via WSL
- Clearing Windows Console History
- Clearing Windows Event Logs
- Code Signing Policy Modification Through Built-in tools