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

References

Related rules

to-top