Skip to content
RCE Disclosed report Intermediate

DLL Hijacking when creating Rescue Media Builder leading to Privilege Escalation

The Rescue Media Builder binary loads a missing DLL called tcmalloc.dll from a user-writable folder in the user's PATH, so a local attacker can plant a malicious DLL that runs with Administrator rights. The attacker can then use a scheduled task to escalate from Administrator to SYSTEM.

z3ron3 Follow

Originally disclosed on HackerOne

Bounty$250 Medium 6.7 View original
  • Triaged in 2 days
  • Fixed in 4 months
  • Paid in 3 days
  • Disclosed after 3.9 years

Summary

Acronis True Image 2021 provides a Rescue Media Builder tool which lets the user create a bootable media to recover system if it becomes unbootable.

MediaBuilder.exe is the binary which manages such functionalities. The application is vulnerable to DLL hijacking attack because it searches for a non-existing DLL file named tcmalloc.dll (Google's custom implementation of dynamic memory allocation) in locations which can be controlled by the attacker or normal user thus placing a malicious DLL in one of the folder will result it getting loaded by MediaBuilder.exe with Administrator privileges which can be escalated to SYSTEM privileges thus resulting in Privilege Escalation.

Every Windows system contains %USERPROFILE%\AppData\Local\Microsoft\WindowsApps folder as a value in the User PATH environment variable where MediaBuilder.exe will search for the DLL if not found in the preceding Search order folders. The malicious DLL file can be placed in this folder as normal user has Full control over this folder.

1.png
1.png From the original on HackerOne

Even if %USERPROFILE%\AppData\Local\Microsoft\WindowsApps folder is not in User PATH environment variable, attacker can add any folder of his choice to the User PATH environment variable as this does not require Administrative permissions.

Steps To Reproduce

I created a DLL file which when loaded spawns cmd.exe while giving information as to which application loaded the DLL, path from where the file was loaded, and user privilege. I have attached the DLL file as well as the C++ code to build the DLL below if any necessary changes are to be made.

[ 1 ] - Copy or write the DLL file named tcmalloc.dll which is to be executed in %USERPROFILE%\AppData\Local\Microsoft\WindowsApps folder.

2.png
2.png From the original on HackerOne

[ 2 ] - Got to Tools tab of True Image and open Rescue Media Builder.

3.png
3.png From the original on HackerOne

A cmd.exe window will open when MediaBuilder.exe loads the DLL file. We can see in the title of the cmd.exe window that it was started with Administrator privileges. To confirm, I ran net session command which gives There are no entries in this list output if executed with Administrator privileges and Access denied if executed as a normal user.

4.png
4.png From the original on HackerOne

Escalating from Administrator privileges to NT AUTHORITY\SYSTEM

[ 1 ] - From the Command Prompt that was executed after the DLL was loaded, create a scheduled task by using the Windows built-in schtasks.exe utility.

schtasks /create /SC WEEKLY /RU "NT AUTHORITY\SYSTEM" /TN EOP /TR C:\Windows\System32\winver.exe /IT /RL HIGHEST

5.png
5.png From the original on HackerOne

[ 2 ] - Run the task created in above step from the elevated Command Prompt.

schtasks /run /I /TN EOP

6.png
6.png From the original on HackerOne

winver.exe can be seen executed as NT AUTHORITY\SYSTEM resulting in SYSTEM privileged code execution.

Impact

Attackers gaining privilege to execute commands as Administrator or NT AUTHORITY\SYSTEM.

The original report as published on HackerOne, by z3ron3. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Impact

An attacker who can write to the user's profile could execute code as Administrator and then as NT AUTHORITY\SYSTEM.

What the attacker needed

Local access to the user account; ability to write to the user profile folder; user launches Rescue Media Builder

How it was found

  1. Place a malicious DLL named tcmalloc.dll in the user's WindowsApps folder.
  2. Open the Tools tab in True Image and launch Rescue Media Builder.
  3. The DLL loads and a command prompt opens with Administrator privileges.
  4. Create a scheduled task that runs as SYSTEM from that prompt.
  5. Run the scheduled task to execute code as SYSTEM.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a program starts, Windows looks for supporting library files (DLLs) in a set order of folders. If a program asks for a DLL that is not there, an attacker can put a fake one in a folder the program checks, and the program will run the attacker's code. Here the program runs with high privileges, so the fake DLL runs with those privileges too.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More by z3ron3

View all

7 more disclosed reports, best first.

More from Acronis

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.