Attempt to Install Kali Linux via WSL

Detects attempts to install or use Kali Linux via 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/03/28"
 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 install or use Kali Linux via Windows Subsystem for Linux. Adversaries may 
13enable and use WSL for Linux to avoid detection.
14"""
15from = "now-9m"
16index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.*", "endgame-*", "logs-system.security*"]
17language = "eql"
18license = "Elastic License v2"
19name = "Attempt to Install Kali Linux via WSL"
20references = ["https://learn.microsoft.com/en-us/windows/wsl/wsl-config"]
21risk_score = 73
22rule_id = "dd34b062-b9e3-4a6b-8c0c-6c8ca6dd450e"
23severity = "high"
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(
31 (process.name : "wsl.exe" and process.args : ("-d", "--distribution", "-i", "--install") and process.args : "kali*") or 
32 process.executable : 
33        ("?:\\Users\\*\\AppData\\Local\\packages\\kalilinux*", 
34         "?:\\Users\\*\\AppData\\Local\\Microsoft\\WindowsApps\\kali.exe",
35         "?:\\Program Files*\\WindowsApps\\KaliLinux.*\\kali.exe")
36 )
37'''
38
39
40[[rule.threat]]
41framework = "MITRE ATT&CK"
42[[rule.threat.technique]]
43id = "T1202"
44name = "Indirect Command Execution"
45reference = "https://attack.mitre.org/techniques/T1202/"
46
47
48[rule.threat.tactic]
49id = "TA0005"
50name = "Defense Evasion"
51reference = "https://attack.mitre.org/tactics/TA0005/"

References

Related rules

to-top