Suspicious Microsoft Diagnostics Wizard Execution

Identifies potential abuse of the Microsoft Diagnostics Troubleshooting Wizard (MSDT) to proxy malicious command or binary execution via malicious process arguments.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2022/05/31"
 3integration = ["endpoint", "windows"]
 4maturity = "production"
 5updated_date = "2024/05/21"
 6
 7[rule]
 8author = ["Elastic"]
 9description = """
10Identifies potential abuse of the Microsoft Diagnostics Troubleshooting Wizard (MSDT) to proxy malicious command or
11binary execution via malicious process arguments.
12"""
13from = "now-9m"
14index = ["logs-endpoint.events.process-*", "winlogbeat-*", "logs-windows.*", "endgame-*"]
15language = "eql"
16license = "Elastic License v2"
17name = "Suspicious Microsoft Diagnostics Wizard Execution"
18references = [
19    "https://twitter.com/nao_sec/status/1530196847679401984",
20    "https://lolbas-project.github.io/lolbas/Binaries/Msdt/",
21]
22risk_score = 73
23rule_id = "2c3c29a4-f170-42f8-a3d8-2ceebc18eb6a"
24setup = """## Setup
25
26If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
27events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
28Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
29`event.ingested` to @timestamp.
30For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
31"""
32severity = "high"
33tags = [
34    "Domain: Endpoint",
35    "OS: Windows",
36    "Use Case: Threat Detection",
37    "Tactic: Defense Evasion",
38    "Data Source: Elastic Endgame",
39    "Data Source: Elastic Defend",
40]
41timestamp_override = "event.ingested"
42type = "eql"
43
44query = '''
45process where host.os.type == "windows" and event.type == "start" and
46   (process.pe.original_file_name == "msdt.exe" or process.name : "msdt.exe") and
47   (
48    process.args : ("IT_RebrowseForFile=*", "ms-msdt:/id", "ms-msdt:-id", "*FromBase64*") or
49
50    (process.args : "-af" and process.args : "/skip" and
51     process.parent.name : ("explorer.exe", "cmd.exe", "powershell.exe", "cscript.exe", "wscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe") and
52     process.args : ("?:\\WINDOWS\\diagnostics\\index\\PCWDiagnostic.xml", "PCWDiagnostic.xml", "?:\\Users\\Public\\*", "?:\\Windows\\Temp\\*")) or
53
54    (process.pe.original_file_name == "msdt.exe" and not process.name : "msdt.exe" and process.name != null) or
55
56    (process.pe.original_file_name == "msdt.exe" and not process.executable : ("?:\\Windows\\system32\\msdt.exe", "?:\\Windows\\SysWOW64\\msdt.exe"))
57    )
58'''
59
60
61[[rule.threat]]
62framework = "MITRE ATT&CK"
63[[rule.threat.technique]]
64id = "T1218"
65name = "System Binary Proxy Execution"
66reference = "https://attack.mitre.org/techniques/T1218/"
67
68
69[rule.threat.tactic]
70id = "TA0005"
71name = "Defense Evasion"
72reference = "https://attack.mitre.org/tactics/TA0005/"

References

Related rules

to-top