Component Object Model Hijacking
| Component Object Model Hijacking | |
|---|---|
| Technique | |
| ID | T1122 |
| Tactic | Defense Evasion, Persistence |
| Platform | Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP, Windows 7, Windows 8, Windows Server 2003 R2, Windows Server 2008 R2, Windows Server 2012 R2, Windows Vista, Windows 8.1, Windows 10 |
| Permissions Required | User |
| Data Sources | Windows Registry, DLL monitoring, Loaded DLLs |
| Defense Bypassed | Autoruns Analysis |
| Contributors | ENDGAME |
The Microsoft Component Object Model (COM) is a system within Windows to enable interaction between software components through the operating system.1 Adversaries can use this 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 that component to not work when executed. When that system component is executed through normal system operation the adversary's code will be executed instead.2 An adversary is likely to hijack objects that are used frequently enough to maintain a consistent level of persistence, but are unlikely to break noticeable functionality within the system as to avoid system instability that could lead to detection.
Contents
Examples
- APT28 has used COM hijacking for persistence by replacing the legitimate
MMDeviceEnumeratorobject with a payload.3 - Some variants of ADVSTORESHELL achieve persistence by registering the payload as a Shell Icon Overlay handler COM object.4
- BBSRAT has been seen persisting via COM hijacking through replacement of the COM object for MruPidlList
{42aedc87-2188-41fd-b9a3-0c966feabec1}or Microsoft WBEM New Event Subsystem{F3130CDB-AA52-4C3A-AB32-85FFC23AF9C1}depending on the system's CPU architecture.5 - ComRAT samples have been seen which hijack COM objects for persistence by replacing the path to shell32.dll in registry location
HKCU\Software\Classes\CLSID\{42aedc87-2188-41fd-b9a3-0c966feabec1}\InprocServer32.6 - JHUHUGIT has used COM hijacking to establish persistence by hijacking a class named MMDeviceEnumerator and also by registering the payload as a Shell Icon Overlay handler COM object ({3543619C-D563-43f7-95EA-4DA7E1CC396A}).3
Mitigation
Direct mitigation of this technique may not be recommended for a particular environment since COM objects are a legitimate part of the operating system and installed software. Blocking COM object changes may have unforeseen side effects to legitimate functionality.
Instead, identify and block potentially malicious software that may execute, or be executed by, this technique using whitelisting7 tools, like AppLocker,89 or Software Restriction Policies10 where appropriate.11
Detection
There are opportunities to detect COM hijacking by searching for Registry references that have been replaced and through Registry operations replacing know binary paths with unknown paths. Even though some third party applications define user COM objects, the presence of objects within HKEY_CURRENT_USER\Software\Classes\CLSID\ may be anomalous and should be investigated since user objects will be loaded prior to machine objects in HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\.12 Registry entries for existing COM objects may change infrequently. When an entry with a known good path and binary is replaced or changed to an unusual value to point to an unknown binary in a new location, then it may indicate suspicious behavior and should be investigated. Likewise, if software DLL loads are collected and analyzed, any unusual DLL load that can be correlated with a COM object Registry modification may indicate COM hijacking has been performed.
References
- ^ ↑ Microsoft. (n.d.). The Component Object Model. Retrieved August 18, 2016.
- ^ ↑ G DATA. (2014, October). COM Object hijacking: the discreet way of persistence. Retrieved August 13, 2016.
- a b ↑ ESET. (2016, October). En Route with Sednit - Part 1: Approaching the Target. Retrieved November 8, 2016.
- ^ ↑ ESET. (2016, October). En Route with Sednit - Part 2: Observing the Comings and Goings. Retrieved November 21, 2016.
- ^ ↑ Lee, B. Grunzweig, J. (2015, December 22). BBSRAT Attacks Targeting Russian Organizations Linked to Roaming Tiger. Retrieved August 19, 2016.
- ^ ↑ Rascagneres, P. (2015, May). Tools used by the Uroburos actors. Retrieved August 18, 2016.
- ^ ↑ Beechey, J. (2010, December). Application Whitelisting: Panacea or Propaganda?. Retrieved November 18, 2014.
- ^ ↑ Tomonaga, S. (2016, January 26). Windows Commands Abused by Attackers. Retrieved February 2, 2016.
- ^ ↑ NSA Information Assurance Directorate. (2014, August). Application Whitelisting Using Microsoft AppLocker. Retrieved March 31, 2016.
- ^ ↑ Corio, C., & Sayana, D. P. (2008, June). Application Lockdown with Software Restriction Policies. Retrieved November 18, 2014.
- ^ ↑ Microsoft. (2012, June 27). Using Software Restriction Policies and AppLocker Policies. Retrieved April 7, 2016.
- ^ ↑ Ewing, P. Strom, B. (2016, September 15). How to Hunt: Detecting Persistence & Evasion with the COM. Retrieved September 15, 2016.