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

References

Related rules

to-top