Component Object Model Hijacking
Adversaries may establish persistence by executing malicious content triggered by hijacked references to Component Object Model (COM) objects. COM is a system within Windows to enable interaction between software components through the operating system. References to various COM objects are stored in the Registry. Adversaries can use the COM system to insert malicious code that can be executed in place of legitimate software through hijacking the COM references and relationships as a means for persistence. Hijacking a COM object requires a change in the Windows Registry to replace a reference to a legitimate system component which may cause the execution of the adversary's code instead of the intended COM component.
let SuspiciousComPaths = dynamic([
"AppData", "Temp", "ProgramData", "Users\\Public",
"powershell", "cmd.exe", "wscript", "cscript", "mshta",
"rundll32", "regsvr32"
]);
DeviceRegistryEvents
| where Timestamp > ago(24h)
| where (
(RegistryKey has "HKCU\\SOFTWARE\\Classes\\CLSID"
or RegistryKey has "SOFTWARE\\Classes\\CLSID")
and RegistryValueName in~ ("InprocServer32", "LocalServer32", "InprocServer", "LocalServer",
"TreatAs", "ProgID")
)
| where ActionType in ("RegistryValueSet", "RegistryKeyCreated")
| extend ClsidGuid = extract(@"CLSID\\(\{[0-9A-Fa-f-]+\})", 1, RegistryKey)
| extend IsHkcuOverride = RegistryKey has "HKCU"
| extend IsSuspiciousPayload = RegistryValueData has_any (SuspiciousComPaths)
| extend IsSystemPath = RegistryValueData has_any (
"C:\\Windows\\system32\\",
"C:\\Windows\\SysWOW64\\",
"C:\\Program Files\\",
"C:\\Program Files (x86)\\"
)
| where IsSuspiciousPayload or (IsHkcuOverride and not IsSystemPath)
| project Timestamp, DeviceName, AccountName, ActionType, RegistryKey,
ClsidGuid, RegistryValueName, RegistryValueData,
IsHkcuOverride, IsSuspiciousPayload,
InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc Data Sources
Required Tables
False Positives
- Software installations that register COM servers in HKLM\SOFTWARE\Classes\CLSID with legitimate DLL or EXE paths
- ClickOnce and XCOPY application deployments that register COM objects in HKCU for per-user installation
- Office add-ins and third-party software plugins that register COM objects in the user hive for per-user functionality
- Developer environments and test builds that register experimental or debug COM servers
References (5)
- https://attack.mitre.org/techniques/T1546/015/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1546.015/T1546.015.md
- https://www.cyberbit.com/blog/endpoint-security/com-hijacking-windows-overlooked-security-vulnerability/
- https://bohops.com/2018/08/18/abusing-the-com-registry-structure-part-2-loading-techniques-for-evasion-and-persistence/
- https://threatexpress.com/blogs/2021/02/living-off-the-com-land/
Unlock Pro Content
Get the full detection package for T1546.015 including response playbook, investigation guide, and atomic red team tests.