Component Object Model Hijacking
Identifies Component Object Model (COM) hijacking via registry modification. Adversaries may establish persistence by executing malicious content triggered by hijacked references to COM objects.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2020/11/18"
3integration = ["endpoint"]
4maturity = "production"
5updated_date = "2024/09/05"
6
7[rule]
8author = ["Elastic"]
9description = """
10Identifies Component Object Model (COM) hijacking via registry modification. Adversaries may establish persistence by
11executing malicious content triggered by hijacked references to COM objects.
12"""
13from = "now-9m"
14index = ["logs-endpoint.events.registry-*"]
15language = "eql"
16license = "Elastic License v2"
17name = "Component Object Model Hijacking"
18note = """## Triage and analysis
19
20### Investigating Component Object Model Hijacking
21
22Adversaries can insert malicious code that can be executed in place of legitimate software through hijacking the COM references and relationships as a means of persistence.
23
24#### Possible investigation steps
25
26- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
27- Identify the user account that performed the action and whether it should perform this kind of action.
28- Investigate other alerts associated with the user/host during the past 48 hours.
29- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
30- Retrieve the file referenced in the registry and determine if it is malicious:
31 - Use a private sandboxed malware analysis system to perform analysis.
32 - Observe and collect information about the following activities:
33 - Attempts to contact external domains and addresses.
34 - File and registry access, modification, and creation activities.
35 - Service creation and launch activities.
36 - Scheduled task creation.
37 - Use the PowerShell Get-FileHash cmdlet to get the files' SHA-256 hash values.
38 - Search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
39
40### False positive analysis
41
42- Some Microsoft executables will reference the LocalServer32 registry key value for the location of external COM objects.
43
44### Response and remediation
45
46- Initiate the incident response process based on the outcome of the triage.
47- Isolate the involved host to prevent further post-compromise behavior.
48- If the triage identified malware, search the environment for additional compromised hosts.
49 - Implement temporary network rules, procedures, and segmentation to contain the malware.
50 - Stop suspicious processes.
51 - Immediately block the identified indicators of compromise (IoCs).
52 - Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
53- Remove and block malicious artifacts identified during triage.
54- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
55- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
56- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
57- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
58"""
59references = [
60 "https://bohops.com/2018/08/18/abusing-the-com-registry-structure-part-2-loading-techniques-for-evasion-and-persistence/",
61]
62risk_score = 21
63rule_id = "16a52c14-7883-47af-8745-9357803f0d4c"
64severity = "low"
65tags = [
66 "Domain: Endpoint",
67 "OS: Windows",
68 "Use Case: Threat Detection",
69 "Tactic: Persistence",
70 "Tactic: Defense Evasion",
71 "Tactic: Privilege Escalation",
72 "Resources: Investigation Guide",
73 "Data Source: Elastic Defend",
74]
75timestamp_override = "event.ingested"
76type = "eql"
77
78query = '''
79registry where host.os.type == "windows" and event.type == "change" and
80 /* not necessary but good for filtering privileged installations */
81 user.domain != "NT AUTHORITY" and process.executable != null and
82 (
83 (
84 registry.path : "HK*\\InprocServer32\\" and
85 registry.data.strings: ("scrobj.dll", "?:\\*\\scrobj.dll") and
86 not registry.path : "*\\{06290BD*-48AA-11D2-8432-006008C3FBFC}\\*"
87 ) or
88
89 (
90 registry.path : "HKLM\\*\\InProcServer32\\*" and
91 registry.data.strings : ("*\\Users\\*", "*\\ProgramData\\*")
92 ) or
93
94 /* in general COM Registry changes on Users Hive is less noisy and worth alerting */
95 (
96 registry.path : (
97 "HKEY_USERS\\*\\InprocServer32\\",
98 "HKEY_USERS\\*\\LocalServer32\\",
99 "HKEY_USERS\\*\\DelegateExecute",
100 "HKEY_USERS\\*\\TreatAs\\",
101 "HKEY_USERS\\*\\ScriptletURL*"
102 ) and
103 not registry.data.strings : (
104 /* COM related to Windows Spotlight feature */
105 "{4813071a-41ad-44a2-9835-886d2f63ca30}",
106
107 /* AppX/MSIX DelegateExecute handlers: execute, protocol, file */
108 "{A56A841F-E974-45C1-8001-7E3F8A085917}",
109 "{4ED3A719-CEA8-4BD9-910D-E252F997AFC2}",
110 "{BFEC0C93-0B7D-4F2C-B09C-AFFFC4BDAE78}"
111 )
112 )
113 ) and
114
115 not (
116 process.code_signature.trusted == true and
117 process.code_signature.subject_name in (
118 "Island Technology Inc.", "Google LLC", "Grammarly, Inc.", "Dropbox, Inc", "REFINITIV US LLC", "HP Inc.", "Adobe Inc.",
119 "Citrix Systems, Inc.", "Veeam Software Group GmbH", "Zhuhai Kingsoft Office Software Co., Ltd.", "Oracle America, Inc.",
120 "Brave Software, Inc.", "DeepL SE", "Opera Norway AS"
121 )
122 ) and
123
124 /* excludes Microsoft signed noisy processes */
125 not
126 (
127 process.name : (
128 "OneDrive.exe", "OneDriveSetup.exe", "FileSyncConfig.exe", "Teams.exe", "MicrosoftEdgeUpdate.exe", "msrdcw.exe",
129 "MicrosoftEdgeUpdateComRegisterShell64.exe", "setup.exe"
130 ) and
131 process.code_signature.trusted == true and process.code_signature.subject_name in ("Microsoft Windows", "Microsoft Corporation")
132 ) and
133
134 not process.executable : (
135 "?:\\$WINDOWS.~BT\\Sources\\SetupHost.exe",
136 "?:\\Program Files (x86)\\*.exe",
137 "?:\\Program Files\\*.exe",
138 "?:\\ProgramData\\4Team\\4Team-Updater\\4Team-Updater-Helper.exe",
139 "?:\\ProgramData\\Microsoft\\Windows Defender\\Platform\\*\\MsMpEng.exe",
140 "?:\\Users\\*\\AppData\\Local\\Wondershare\\Wondershare NativePush\\WsToastNotification.exe",
141 "?:\\Windows\\System32\\DriverStore\\FileRepository\\*.exe",
142 "?:\\Windows\\System32\\msiexec.exe",
143 "?:\\Windows\\System32\\svchost.exe",
144 "?:\\Windows\\SysWOW64\\regsvr32.exe",
145 "?:\\Windows\\System32\\regsvr32.exe",
146 "\\Device\\Mup\\*\\Kufer\\KuferSQL\\BasysSQL.exe"
147 )
148'''
149
150
151[[rule.threat]]
152framework = "MITRE ATT&CK"
153[[rule.threat.technique]]
154id = "T1546"
155name = "Event Triggered Execution"
156reference = "https://attack.mitre.org/techniques/T1546/"
157[[rule.threat.technique.subtechnique]]
158id = "T1546.015"
159name = "Component Object Model Hijacking"
160reference = "https://attack.mitre.org/techniques/T1546/015/"
161
162
163
164[rule.threat.tactic]
165id = "TA0003"
166name = "Persistence"
167reference = "https://attack.mitre.org/tactics/TA0003/"
168[[rule.threat]]
169framework = "MITRE ATT&CK"
170[[rule.threat.technique]]
171id = "T1546"
172name = "Event Triggered Execution"
173reference = "https://attack.mitre.org/techniques/T1546/"
174[[rule.threat.technique.subtechnique]]
175id = "T1546.015"
176name = "Component Object Model Hijacking"
177reference = "https://attack.mitre.org/techniques/T1546/015/"
178
179
180
181[rule.threat.tactic]
182id = "TA0004"
183name = "Privilege Escalation"
184reference = "https://attack.mitre.org/tactics/TA0004/"
185[[rule.threat]]
186framework = "MITRE ATT&CK"
187[[rule.threat.technique]]
188id = "T1112"
189name = "Modify Registry"
190reference = "https://attack.mitre.org/techniques/T1112/"
191
192
193[rule.threat.tactic]
194id = "TA0005"
195name = "Defense Evasion"
196reference = "https://attack.mitre.org/tactics/TA0005/"
Triage and analysis
Investigating Component Object Model Hijacking
Adversaries can insert malicious code that can be executed in place of legitimate software through hijacking the COM references and relationships as a means of persistence.
Possible investigation steps
- Investigate the process execution chain (parent process tree) for unknown processes. Examine their executable files for prevalence, whether they are located in expected locations, and if they are signed with valid digital signatures.
- Identify the user account that performed the action and whether it should perform this kind of action.
- Investigate other alerts associated with the user/host during the past 48 hours.
- Assess whether this behavior is prevalent in the environment by looking for similar occurrences across hosts.
- Retrieve the file referenced in the registry and determine if it is malicious:
- Use a private sandboxed malware analysis system to perform analysis.
- Observe and collect information about the following activities:
- Attempts to contact external domains and addresses.
- File and registry access, modification, and creation activities.
- Service creation and launch activities.
- Scheduled task creation.
- Observe and collect information about the following activities:
- Use the PowerShell Get-FileHash cmdlet to get the files' SHA-256 hash values.
- Search for the existence and reputation of the hashes in resources like VirusTotal, Hybrid-Analysis, CISCO Talos, Any.run, etc.
- Use a private sandboxed malware analysis system to perform analysis.
False positive analysis
- Some Microsoft executables will reference the LocalServer32 registry key value for the location of external COM objects.
Response and remediation
- Initiate the incident response process based on the outcome of the triage.
- Isolate the involved host to prevent further post-compromise behavior.
- If the triage identified malware, search the environment for additional compromised hosts.
- Implement temporary network rules, procedures, and segmentation to contain the malware.
- Stop suspicious processes.
- Immediately block the identified indicators of compromise (IoCs).
- Inspect the affected systems for additional malware backdoors like reverse shells, reverse proxies, or droppers that attackers could use to reinfect the system.
- Remove and block malicious artifacts identified during triage.
- Investigate credential exposure on systems compromised or used by the attacker to ensure all compromised accounts are identified. Reset passwords for these accounts and other potentially compromised credentials, such as email, business systems, and web services.
- Run a full antimalware scan. This may reveal additional artifacts left in the system, persistence mechanisms, and malware components.
- Determine the initial vector abused by the attacker and take action to prevent reinfection through the same vector.
- Using the incident response data, update logging and audit policies to improve the mean time to detect (MTTD) and the mean time to respond (MTTR).
References
Related rules
- Suspicious DLL Loaded for Persistence or Privilege Escalation
- Suspicious WerFault Child Process
- System File Ownership Change
- Registry Persistence via AppInit DLL
- UAC Bypass Attempt via Privileged IFileOperation COM Interface