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", "m365_defender", "sentinel_one_cloud_funnel"]
 4maturity = "production"
 5updated_date = "2024/10/10"
 6min_stack_version = "8.13.0"
 7min_stack_comments = "Breaking change at 8.13.0 for SentinelOne Integration."
 8
 9[rule]
10author = ["Elastic"]
11description = """
12Detects attempts to execute a program on the host from the Windows Subsystem for Linux. Adversaries may enable and use
13WSL for Linux to avoid detection.
14"""
15from = "now-9m"
16index = [
17    "winlogbeat-*",
18    "logs-endpoint.events.process-*",
19    "logs-windows.*",
20    "endgame-*",
21    "logs-system.security*",
22    "logs-m365_defender.event-*",
23    "logs-sentinel_one_cloud_funnel.*",
24]
25language = "eql"
26license = "Elastic License v2"
27name = "Execution via Windows Subsystem for Linux"
28references = ["https://learn.microsoft.com/en-us/windows/wsl/wsl-config"]
29risk_score = 47
30rule_id = "db7dbad5-08d2-4d25-b9b1-d3a1e4a15efd"
31severity = "medium"
32tags = [
33    "Domain: Endpoint",
34    "OS: Windows",
35    "Use Case: Threat Detection",
36    "Tactic: Defense Evasion",
37    "Data Source: Elastic Endgame",
38    "Data Source: Elastic Defend",
39    "Data Source: System",
40    "Data Source: Microsoft Defender for Endpoint",
41    "Data Source: SentinelOne",
42]
43timestamp_override = "event.ingested"
44type = "eql"
45
46query = '''
47process where host.os.type == "windows" and event.type : "start" and
48  process.parent.name : ("wsl.exe", "wslhost.exe") and
49  not process.executable : (
50        "?:\\Program Files (x86)\\*",
51        "?:\\Program Files\\*",
52        "?:\\Program Files*\\WindowsApps\\MicrosoftCorporationII.WindowsSubsystemForLinux_*\\wsl*.exe",
53        "?:\\Windows\\System32\\conhost.exe",
54        "?:\\Windows\\System32\\lxss\\wslhost.exe",
55        "?:\\Windows\\System32\\WerFault.exe",
56        "?:\\Windows\\Sys*\\wslconfig.exe"
57  )
58'''
59
60
61[[rule.threat]]
62framework = "MITRE ATT&CK"
63[[rule.threat.technique]]
64id = "T1202"
65name = "Indirect Command Execution"
66reference = "https://attack.mitre.org/techniques/T1202/"
67
68
69[rule.threat.tactic]
70id = "TA0005"
71name = "Defense Evasion"
72reference = "https://attack.mitre.org/tactics/TA0005/"

References

Related rules

to-top