Detection of Malicious COM Object Instantiation via PowerShell
This brief covers the detection of adversarial abuse of PowerShell COM object instantiation via GetTypeFromCLSID, a technique used for UAC bypass and privilege escalation by threat actors including ransomware operators.
Adversaries and ransomware groups, including those linked to Conti, frequently leverage the instantiation of Component Object Model (COM) objects through PowerShell to execute arbitrary code. By using the [type]::GetTypeFromCLSID method, attackers can interact with system-level COM components, often to achieve privilege escalation or bypass User Account Control (UAC) protections. This technique provides a mechanism for persistence and unauthorized system manipulation. Security operations teams should monitor PowerShell Script Block Logging (EventID 4104) for instances of this method, as it serves as a high-fidelity indicator of potentially malicious script execution that bypasses traditional file-based detection.
Attack Chain
- Attacker establishes initial access through social engineering or exploitation of a separate vulnerability.
- Attacker executes a PowerShell script on the target endpoint.
- The script calls
[type]::GetTypeFromCLSIDto identify and load a specific COM object. - The script creates an instance of the targeted COM object using
CreateInstance. - The instantiated COM object is used to interact with privileged system APIs or administrative interfaces.
- Attacker performs UAC bypass or privilege escalation to elevate the current process context.
- Attacker achieves persistence or executes further malicious payloads, such as ransomware binaries or data wipers.
Impact
Successful exploitation of this technique can result in complete system compromise, including privilege escalation and the disabling of security features. It has been observed in campaigns involving ransomware and data destruction tools, posing risks of significant operational downtime, data loss, and unauthorized access to sensitive environments.
Recommendation
- Enable and ingest Windows PowerShell Script Block Logging (Event ID 4104) to monitor for the specific CLSID instantiation pattern.
- Deploy the provided Sigma rule to detect
[type]::GetTypeFromCLSIDusage in script blocks. - Investigate alerts generated by this logic to distinguish between legitimate administrative tool usage and adversarial activity.
- Restrict PowerShell execution policies and enforce Constrained Language Mode (CLM) in sensitive environments to limit COM object access.
Immediate actions
Enable PowerShell Script Block Logging (Event ID 4104) across all Windows endpoints.
Threat Hunt
Search historic Event ID 4104 logs for instances of [type]::GetTypeFromCLSID.
Data: Event ID 4104 logs
Detection coverage 1
Detect PowerShell COM Object Instantiation via GetTypeFromCLSID
mediumDetects the creation of COM objects through PowerShell by searching for the GetTypeFromCLSID method in script blocks, which is often used for UAC bypass or privilege escalation.
Detection queries are available on the platform. Get full rules →