Use COM Object hijacking to maintain persistence——Hijack explorer.exe

Onedaysec
4 min read
1 views
docx image 1770017955941 0 7f24e98198

0x00 Preface

---

Previous articles introduced two backdoors implemented using COM object hijacking, with some differences in approach:

The first method: hijacking .Net programs via CLR

Normal usage of CLR:

Set the registry key value HKEY_CURRENT_USER\Software\Classes\CLSID\

Enter in cmd:

SET COR_ENABLE_PROFILING=1
SET COR_PROFILER={11111111-1111-1111-1111-111111111111}

CLR can hijack the startup of all .Net programs under the current cmd

Backdoor exploitation approach:

I attempted to modify environment variables via WMI to make CLR effective globally, thereby hijacking the startup of all .Net programs

Practical testing confirmed this method is effective; after system startup, .Net programs are called by default, loading CLR and triggering the backdoor

The second method: hijacking CAccPropServicesClass and MMDeviceEnumerator

This method was previously used by the COMpfun Trojan, so the approach was learned from COMpfun.

Setting the registry key HKEY_CURRENT_USER\Software\Classes\CLSID\ can specify the DLLs loaded by the instances CAccPropServicesClass and MMDeviceEnumerator.

When the IE browser process iexplore.exe starts, it calls the above two instances.

Therefore, by setting the DLLs loaded by CAccPropServicesClass and MMDeviceEnumerator via the registry, the startup of the IE browser can be hijacked to trigger the backdoor.

Of course, this method can only be considered a passive backdoor, as it only triggers when the user starts the IE browser.

However, among the many COM objects, the hijackable objects are not unique, and there are even methods to hijack the desktop process explorer.exe, which is equivalent to an active backdoor.

For example: hijacking MruPidlList.

Note:

This method has been used by multiple known malware.

Based on the principle of studying all publicly disclosed COM object backdoor exploitation methods to summarize defense strategies against COM hijacking, this article will introduce two other COM hijacking backdoor exploitation methods.

Previous articles:

"Use CLR to maintain persistence"

"Use COM Object hijacking to maintain persistence——Hijack CAccPropServicesClass and MMDeviceEnumerator"

0x01 Introduction

---

This article will cover the following content

  • Backdoor approach via hijacking MruPidlList
  • Malicious exploitation examples
  • Summary of defense methods against COM hijacking

0x02 Backdoor approach via hijacking MruPidlList

---

Registry location: HKCU\Software\Classes\CLSID\

Create key {42aedc87-2188-41fd-b9a3-0c966feabec1}

Create subkey InprocServer32

Default value is the absolute path of the test DLL: C:\test\calc.dll

Create value: ThreadingModel REG_SZ Apartment

As shown in the figure below

0x02 Backdoor approach via hijacking MruPidlList — technical illustration 1

This registry location corresponds to the COM object MruPidlList, which operates on shell32.dll

And shell32.dll is a Windows 32-bit shell dynamic link library file, used for opening web pages and files, setting default filenames when creating files, and many other functions

Intuitively, explorer.exe calls shell32.dll to load the COM object MruPidlList.

The system launches the process explorer.exe by default at startup. If the COM object MruPidlList is hijacked, the process explorer.exe can be hijacked, enabling a backdoor to start with the system, effectively making it an active backdoor.

Of course, for testing convenience, there's no need to reboot the system; simply terminate the explorer.exe process and create a new one.

After creating the new process, load calc.dll to pop up the calculator, as shown in the figure below.

0x02 Backdoor approach via hijacking MruPidlList — technical illustration 2

Testing on a 64-bit system, the registry location remains unchanged, but a 64-bit DLL must be used. The backdoor triggers upon reboot, launching calc.exe, as shown in the figure below.

0x02 Backdoor approach via hijacking MruPidlList — technical illustration 3

Also applicable to Win8 systems, as shown in the figure below.

0x02 Backdoor approach via hijacking MruPidlList — technical illustration 4

0x03 Malicious Exploitation Examples

---

1. COMRAT

Suspected to share origins with Uroburos and Agent.BTZ.

Uroburos: One of the most advanced rootkit malware discovered to date.

Agent.BTZ: Malware used to infiltrate the Pentagon in 2008.

Detailed information:

https://www.nsec.io/wp-content/uploads/2015/05/uroburos-actors-tools-1.1.pdf

2. ZeroAccess rootkit

ZeroAccess rootkit: Infected approximately over 9 million computers

Detailed information:

https://nakedsecurity.sophos.com/2012/06/06/zeroaccess-rootkit-usermode/

https://www.sophos.com/en-us/threat-center/technical-papers/zeroaccess-botnet.aspx

Note:

ZeroAccess rootkit also utilized another COM hijacking location

Registry location: HKCU\Software\Classes\clsid\{fbeb8a05-beee-4442-804e-409d6c4515e9}

Using the same method, it can also hijack explorer.exe

3. BBSRAT

Detailed information:

https://researchcenter.paloaltonetworks.com/2015/12/bbsrat-attacks-targeting-russian-organizations-linked-to-roaming-tiger/

http://2014.zeronights.org/assets/files/slides/roaming_tiger_zeronights_2014.pdf

0x04 Defense

---

Since COM objects are normal functions of the operating system, disabling COM objects is not very practical

The DLL paths pointed to by the following key values should be given special attention:

  • HKCU\Software\Classes\CLSID\{42aedc87-2188-41fd-b9a3-0c966feabec1}
  • HKCU\Software\Classes\CLSID\{fbeb8a05-beee-4442-804e-409d6c4515e9}
  • HKCU\Software\Classes\CLSID{b5f8350b-0548-48b1-a6ee-88bd00b4a5e7}
  • HKCU\Software\Classes\Wow6432Node\CLSID{BCDE0395-E52F-467C-8E3D-C4579291692E}

Defense methods:

1. Use application whitelisting rules to prohibit loading third-party DLLs

2. Record and investigate write and modify operations to the registry HKCU\Software\Classes\CLSID\

For more information on COM object hijacking, refer to:

https://attack.mitre.org/wiki/Technique/T1122

0x05 Summary

---

This article introduces two backdoor methods achieved through COM hijacking, combined with the two exploitation methods from previous articles, to comprehensively analyze defense strategies against COM hijacking.

It is particularly noteworthy that COM hijacking backdoors can bypass Autoruns' detection of startup items, and this detail should be taken into account in practical defense.

Related Questions & Answers

How does the explorer.exe hijacking technique compare to other COM hijacking methods like CLR hijacking or CAccPropServicesClass hijacking?

CLR hijacking uses environment variables to intercept all .Net program startups, while CAccPropServicesClass hijacking only triggers when Internet Explorer is launched (a passive backdoor). Explorer.exe hijacking via MruPidlList is active because the desktop process starts automatically, making it reliable for system-wide persistence. Each method targets different COM objects but ultimately abuses same-class registry entries. For deeper details on CLR and CAccPropServicesClass methods, refer to the previous articles referenced in [Use COM Object hijacking to maintain persistence——Hijack explorer.exe](/news/use-com-object-hijacking-to-maintain-persistence-hijack-explorer-exe).

What defense strategies does the article recommend against COM object hijacking?

Defense focuses on monitoring registry modifications under `HKCU\Software\Classes\CLSID\` and specific keys like `{42aedc87-2188-41fd-b9a3-0c966feabec1}` and `{fbeb8a05-beee-4442-804e-409d6c4515e9}`. The article recommends using application whitelisting rules to block unauthorized DLLs and investigating write operations to these registry locations. Since COM hijacking can bypass Autoruns' startup item detection, these proactive measures are essential. For a broader view, see [Use COM Object hijacking to maintain persistence——Hijack CAccPropServicesClass and MMDeviceEnumerator](/news/use-com-object-hijacking-to-maintain-persistence-hijack-caccpropservicesclass-and-mmdeviceenumerator).

Which known malware families have exploited COM hijacking via MruPidlList or similar CLSIDs, according to the article?

The article mentions COMRAT (suspected to share origins with the advanced rootkits Uroburos and Agent.BTZ), the ZeroAccess rootkit (which infected over 9 million computers using CLSID `{fbeb8a05-beee-4442-804e-409d6c4515e9}`), and BBSRAT (linked to the Roaming Tiger campaign targeting Russian organizations). These examples demonstrate how real-world threats leverage COM hijacking for persistence, as discussed in [Use COM Object hijacking to maintain persistence——Hijack explorer.exe](/news/use-com-object-hijacking-to-maintain-persistence-hijack-explorer-exe).

What registry keys are commonly used for COM hijacking targeting explorer.exe, and why is this considered an active backdoor compared to other methods?

The primary keys are `HKCU\Software\Classes\CLSID\{42aedc87-2188-41fd-b9a3-0c966feabec1}` (MruPidlList) and `HKCU\Software\Classes\clsid\{fbeb8a05-beee-4442-804e-409d6c4515e9}` (used by ZeroAccess). Unlike passive backdoors such as hijacking CAccPropServicesClass (which only triggers when IE starts), hijacking explorer.exe is active because explorer.exe runs automatically at system boot, ensuring the backdoor executes on every startup. This method is covered in [Use COM Object hijacking to maintain persistence——Hijack CAccPropServicesClass and MMDeviceEnumerator](/news/use-com-object-hijacking-to-maintain-persistence-hijack-caccpropservicesclass-and-mmdeviceenumerator).

How does hijacking the MruPidlList COM object allow an attacker to maintain persistence?

The MruPidlList COM object is loaded by shell32.dll, which is called by explorer.exe at system startup. By setting the registry key `HKCU\Software\Classes\CLSID\{42aedc87-2188-41fd-b9a3-0c966feabec1}` to point to a malicious DLL, an attacker can force explorer.exe to load that DLL every time the user logs in, creating an active backdoor that triggers without user interaction. This technique is detailed in [Use COM Object hijacking to maintain persistence——Hijack explorer.exe](/news/use-com-object-hijacking-to-maintain-persistence-hijack-explorer-exe).

Continue Reading