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"
 5min_stack_comments = "New fields added: required_fields, related_integrations, setup"
 6min_stack_version = "8.3.0"
 7updated_date = "2023/02/22"
 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.*", "logs-windows.*", "endgame-*"]
19language = "eql"
20license = "Elastic License v2"
21name = "Potential DLL Side-Loading via Microsoft Antimalware Service Executable"
22note = """## Setup
23
24If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work.
25"""
26references = [
27    "https://news.sophos.com/en-us/2021/07/04/independence-day-revil-uses-supply-chain-exploit-to-attack-hundreds-of-businesses/",
28]
29risk_score = 73
30rule_id = "053a0387-f3b5-4ba5-8245-8002cca2bd08"
31severity = "high"
32tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion", "Elastic Endgame"]
33timestamp_override = "event.ingested"
34type = "eql"
35
36query = '''
37process where host.os.type == "windows" and event.type == "start" and
38(
39  (process.pe.original_file_name == "MsMpEng.exe" and not process.name : "MsMpEng.exe") or
40  (process.name : "MsMpEng.exe" and not
41        process.executable : ("?:\\ProgramData\\Microsoft\\Windows Defender\\*.exe",
42                              "?:\\Program Files\\Windows Defender\\*.exe",
43                              "?:\\Program Files (x86)\\Windows Defender\\*.exe",
44                              "?:\\Program Files\\Microsoft Security Client\\*.exe",
45                              "?:\\Program Files (x86)\\Microsoft Security Client\\*.exe"))
46)
47'''
48
49
50[[rule.threat]]
51framework = "MITRE ATT&CK"
52[[rule.threat.technique]]
53id = "T1574"
54name = "Hijack Execution Flow"
55reference = "https://attack.mitre.org/techniques/T1574/"
56[[rule.threat.technique.subtechnique]]
57id = "T1574.002"
58name = "DLL Side-Loading"
59reference = "https://attack.mitre.org/techniques/T1574/002/"
60
61
62
63[rule.threat.tactic]
64id = "TA0005"
65name = "Defense Evasion"
66reference = "https://attack.mitre.org/tactics/TA0005/"

Setup

If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define event.ingested and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate event.ingested to @timestamp for this rule to work.

to-top