Potential DLL Side-Loading via Microsoft Antimalware Service Executable

Identifies a Windows trusted program that is known to be vulnerable to DLL Search Order Hijacking starting after being renamed or from a non-standard path. This is uncommon behavior and may indicate an attempt to evade defenses via side-loading a malicious DLL within the memory space of one of those processes.

Elastic rule (View on GitHub)

 1[metadata]
 2creation_date = "2021/07/07"
 3integration = ["endpoint", "windows", "m365_defender"]
 4maturity = "production"
 5updated_date = "2024/10/15"
 6min_stack_version = "8.14.0"
 7min_stack_comments = "Breaking change at 8.14.0 for the Windows Integration."
 8
 9[rule]
10author = ["Elastic", "Dennis Perto"]
11description = """
12Identifies a Windows trusted program that is known to be vulnerable to DLL Search Order Hijacking starting after being
13renamed or from a non-standard path. This is uncommon behavior and may indicate an attempt to evade defenses via
14side-loading a malicious DLL within the memory space of one of those processes.
15"""
16false_positives = ["Microsoft Antimalware Service Executable installed on non default installation path."]
17from = "now-9m"
18index = ["winlogbeat-*", "logs-endpoint.events.process-*", "logs-windows.sysmon_operational-*", "endgame-*", "logs-m365_defender.event-*"]
19language = "eql"
20license = "Elastic License v2"
21name = "Potential DLL Side-Loading via Microsoft Antimalware Service Executable"
22references = [
23    "https://news.sophos.com/en-us/2021/07/04/independence-day-revil-uses-supply-chain-exploit-to-attack-hundreds-of-businesses/",
24]
25risk_score = 73
26rule_id = "053a0387-f3b5-4ba5-8245-8002cca2bd08"
27setup = """## Setup
28
29If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2,
30events will not define `event.ingested` and default fallback for EQL rules was not added until version 8.2.
31Hence for this rule to work effectively, users will need to add a custom ingest pipeline to populate
32`event.ingested` to @timestamp.
33For more details on adding a custom ingest pipeline refer - https://www.elastic.co/guide/en/fleet/current/data-streams-pipeline-tutorial.html
34"""
35severity = "high"
36tags = [
37    "Domain: Endpoint",
38    "OS: Windows",
39    "Use Case: Threat Detection",
40    "Tactic: Defense Evasion",
41    "Data Source: Elastic Endgame",
42    "Tactic: Execution",
43    "Data Source: Elastic Defend",
44    "Data Source: Sysmon",
45    "Data Source: Microsoft Defender for Endpoint",
46]
47timestamp_override = "event.ingested"
48type = "eql"
49
50query = '''
51process where host.os.type == "windows" and event.type == "start" and
52(
53  (process.pe.original_file_name == "MsMpEng.exe" and not process.name : "MsMpEng.exe") or
54  (process.name : "MsMpEng.exe" and not
55        process.executable : ("?:\\ProgramData\\Microsoft\\Windows Defender\\*.exe",
56                              "?:\\Program Files\\Windows Defender\\*.exe",
57                              "?:\\Program Files (x86)\\Windows Defender\\*.exe",
58                              "?:\\Program Files\\Microsoft Security Client\\*.exe",
59                              "?:\\Program Files (x86)\\Microsoft Security Client\\*.exe"))
60)
61'''
62
63
64[[rule.threat]]
65framework = "MITRE ATT&CK"
66[[rule.threat.technique]]
67id = "T1574"
68name = "Hijack Execution Flow"
69reference = "https://attack.mitre.org/techniques/T1574/"
70[[rule.threat.technique.subtechnique]]
71id = "T1574.002"
72name = "DLL Side-Loading"
73reference = "https://attack.mitre.org/techniques/T1574/002/"
74
75
76
77[rule.threat.tactic]
78id = "TA0005"
79name = "Defense Evasion"
80reference = "https://attack.mitre.org/tactics/TA0005/"

References

Related rules

to-top