Detect Component Object Model in Microsoft Sentinel
Adversaries abuse the Windows Component Object Model (COM) to execute arbitrary code locally. COM is a binary interface standard enabling inter-process communication between software objects through defined interfaces. Threat actors leverage COM by instantiating known objects (WScript.Shell, Shell.Application, MMC20.Application, Schedule.Service) via scripting hosts, hijacking COM object registrations in HKCU to redirect execution to malicious DLLs, or using elevated COM interfaces (CMLuaUtil) to bypass User Account Control. Real-world use includes TrickBot and Latrodectus creating scheduled tasks via ITaskService, MuddyWater executing payloads via DCOM loopback, Gamaredon injecting macros via Microsoft.Office.Interop objects, and Raspberry Robin abusing CMLuaUtil for UAC bypass. Unlike DCOM (T1021.003), this technique focuses on local COM execution rather than remote lateral movement.
MITRE ATT&CK
- Tactic
- Execution
- Technique
- T1559 Inter-Process Communication
- Sub-technique
- T1559.001 Component Object Model
- Canonical reference
- https://attack.mitre.org/techniques/T1559/001/
KQL Detection Query
let SuspiciousCOMObjects = dynamic([
"MMC20.Application", "ShellWindows", "ShellBrowserWindow",
"WScript.Shell", "Shell.Application", "Schedule.Service",
"CMLuaUtil", "InternetExplorer.Application",
"Microsoft.Office.Interop",
"49B2791A-B1AE-4C90-9B8E-E860BA07F889",
"9BA05972-F6A8-11CF-A442-00A0C91F3880",
"C08AFD90-F2A1-11D1-8455-00A0C91F3880",
"6EDD6D74-C007-4E75-B76A-E5740995E24C",
"0F87369F-A4E5-4CFC-BD3E-73E6154572DD"
]);
// Branch 1: Script host COM object instantiation
let ScriptCOMAbuse = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName in~ ("powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe")
| where ProcessCommandLine has_any (SuspiciousCOMObjects)
or ProcessCommandLine has "-ComObject"
or ProcessCommandLine has "CreateObject("
or ProcessCommandLine has "GetTypeFromCLSID"
or (ProcessCommandLine has "activator" and ProcessCommandLine has "CreateInstance")
| extend DetectionSource = "ScriptCOMAbuse"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionSource;
// Branch 2: COM surrogate (dllhost.exe) spawning unexpected child processes
let DllHostChildren = DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName =~ "dllhost.exe"
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe",
"mshta.exe", "rundll32.exe", "regsvr32.exe", "certutil.exe",
"net.exe", "net1.exe", "whoami.exe", "ipconfig.exe",
"curl.exe", "wget.exe", "bitsadmin.exe")
| extend DetectionSource = "DllHostSurrogate"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
InitiatingProcessFileName, InitiatingProcessCommandLine, DetectionSource;
// Branch 3: COM hijacking via HKCU CLSID registry modification
let COMHijacking = DeviceRegistryEvents
| where Timestamp > ago(24h)
| where RegistryKey contains @"HKEY_CURRENT_USER\Software\Classes\CLSID"
| where RegistryValueName in~ ("InProcServer32", "LocalServer32", "InProcServer")
| where RegistryValueData !has @"C:\Windows\System32"
and RegistryValueData !has @"C:\Program Files"
and RegistryValueData !has @"C:\Program Files (x86)"
| extend DetectionSource = "COMHijacking"
| project Timestamp, DeviceName,
AccountName = InitiatingProcessAccountName,
FileName = InitiatingProcessFileName,
ProcessCommandLine = strcat("Registry: ", RegistryKey, " -> ", RegistryValueData),
InitiatingProcessFileName,
InitiatingProcessCommandLine,
DetectionSource;
// Union all detection branches
ScriptCOMAbuse
| union DllHostChildren
| union COMHijacking
| sort by Timestamp desc Detects COM abuse via three vectors: (1) scripting host COM object instantiation in PowerShell, WScript, CScript, and MSHTA using suspicious COM ProgIDs or CLSIDs (MMC20.Application, ShellWindows, WScript.Shell, Schedule.Service, CMLuaUtil); (2) COM surrogate dllhost.exe spawning unexpected child processes that are commonly used in post-exploitation; (3) COM hijacking via HKCU\Software\Classes\CLSID registry modifications pointing to non-standard DLL paths. Covers TrickBot/Latrodectus scheduled task persistence via ITaskService, Raspberry Robin CMLuaUtil UAC bypass, MuddyWater DCOM loopback execution, and opportunistic COM hijacking.
Data Sources
Required Tables
False Positives & Tuning
- IT administration scripts using New-Object -ComObject Shell.Application or WScript.Shell for legitimate file operations and system management
- Software installers and MSI packages that use COM objects during installation (WScript.Shell to write registry keys, Shell.Application to extract files)
- Legitimate user-space COM registration by applications such as Python pywin32, LibreOffice, or other third-party software that registers DLLs under HKCU\Software\Classes\CLSID
- Monitoring agents and RMM tools (SolarWinds, ConnectWise, Datto) that use COM interfaces for system inventory or remote management
- Development environments (Visual Studio, Python, Node.js) that routinely invoke COM interfaces for IDE features or build automation
Other platforms for T1559.001
Testing Methodology
Validate this detection against 4 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Scheduled Task Creation via ITaskService COM Interface
Expected signal: Sysmon Event ID 1: Process Create with Image=powershell.exe, CommandLine containing 'Schedule.Service' and 'ITaskService'. Windows Task Scheduler Operational log Event ID 106 (task registered) for 'df00tech-COM-test'. Security Event ID 4698 (scheduled task created) if task auditing is enabled. PowerShell Script Block Log Event ID 4104 with the full COM invocation code.
- Test 2Shell.Application COM Object Code Execution
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'Shell.Application' and 'ShellExecute'. Second Sysmon Event ID 1 for calc.exe with ParentImage=explorer.exe or svchost.exe (the COM process host — ShellExecute routes through explorer.exe's COM server). Security Event ID 4688 for calc.exe process creation. PowerShell Script Block Log Event ID 4104.
- Test 3WScript.Shell COM Execution with Run Method
Expected signal: Sysmon Event ID 1: powershell.exe with 'WScript.Shell' in CommandLine. Sysmon Event ID 1: cmd.exe spawned (parent will be wscript.exe or svchost.exe depending on activation context, NOT powershell.exe). Sysmon Event ID 11: file create for df00tech-com-test.txt. PowerShell Script Block Log Event ID 4104.
- Test 4COM Hijacking via HKCU CLSID Registration
Expected signal: Sysmon Event ID 12 (Registry Object Create): TargetObject=HKCU\Software\Classes\CLSID\{DF000001-...}\InProcServer32. Sysmon Event ID 13 (Registry Value Set): TargetObject containing InProcServer32 with Details=%APPDATA%\df00tech-evil.dll. Security Event ID 4657 (registry value modified) if object access auditing is enabled. The ThreadingModel value is a hallmark of legitimate InProcServer32 registrations that malware mimics.
References (10)
- https://attack.mitre.org/techniques/T1559/001/
- https://www.fireeye.com/blog/threat-research/2019/06/hunting-com-objects.html
- https://msdn.microsoft.com/library/windows/desktop/ms680573.aspx
- https://enigma0x3.net/2017/01/05/lateral-movement-using-the-mmc20-application-com-object/
- https://googleprojectzero.blogspot.com/2018/04/windows-exploitation-tricks-exploiting.html
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1559.001/T1559.001.md
- https://learn.microsoft.com/en-us/windows/win32/com/com-technical-overview
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-deviceregistryevents-table
- https://www.elastic.co/security-labs/exploring-the-latrodectus-payload
- https://www.welivesecurity.com/2020/10/02/eset-discovers-trickbot-new-module-targeting/
Unlock Pro Content
Get the full detection package for T1559.001 including response playbook, investigation guide, and atomic red team tests.