◁ BACK TO HOME nullsector.cc // post // elpaco

ELPACO RANSOMWARE

— MALWARE ANALYSIS

ELPACO is a sophisticated ransomware variant of another ransomware named "Mimic", what they have in common is the use of legitimate softwares other than the main ransomware.

Peculiarity about this sample is the customizable UI given to the operator and the fact that almost a year later is still effective on up to date Windows systems

The initial file is a self-extracting archive which contain the following files:

FIG.01SFX ARCHIVE — CONTENTS
File listing of the initial self-extracting archive
▚ FIG.01 INITIAL SELF-EXTRACTING ARCHIVE — BUNDLED FILES

Inside an installation of Everything.exe from voidtools

What is Everything?

This is an interesting use of legitimate tools for two reason:

Inside the archive we can find Everything64.dll, it's not an actual dll but it's another compressed zip archive, this time password protected

FIG.02ARCHIVE — PASSWORD PROTECTED
Everything64.dll revealed as a password protected archive
▚ FIG.02 EVERYTHING64.DLL — A PASSWORD PROTECTED ARCHIVE

To find the password you can simply execute the sample and monitor its activity with procmon or other tools, there will obviously be a time when it will need to extract the files inside and provide a password

FIG.03PROCMON — PASSWORD LEAK
Procmon trace revealing the archive password
▚ FIG.03 PASSWORD RECOVERED BY MONITORING THE SAMPLE

It's also a piece of advice that i give to someone when he want to reverse engineer a malware, you usually don't want to open right away inside the debugger, it can be daunting and dispersive, what you want to do is first run it inside a sandbox and observe what it does, then you can have a general idea of what you are looking for and where to start. It's a matter of defined goals to avoid losing times

Inside the extracted archive after providing the password:

FIG.04EXTRACTED ARCHIVE — CONTENTS
Contents of the extracted password protected archive
▚ FIG.04 WHAT IS INSIDE THE PASSWORD PROTECTED ARCHIVE

This is the beauty of compressed archive, you can bring whatever you want in a small size.

Inside of relevant we have:

This is session.tmp key

FIG.05SESSION.TMP — RECOVERY KEY
The session.tmp recovery key
▚ FIG.05 THE SESSION.TMP RECOVERY KEY

OPERATOR INTERFACE // 00

To make life easier for those who need to use the ransomware developer choose to create a GUI, it is as simple as it is practical. The Interface allows the operator to customize the ransomware behavior during and after the encryption, it has some spicy features that make the ransomware very sophisticated

FIG.06OPERATOR GUI — MAIN PANEL
Operator GUI customization panel
▚ FIG.06 OPERATOR INTERFACE — CUSTOMIZATION PANEL

In this panel is possible to change the number of worker threads dedicated for encryption, choose which files to skip, self-deletion, task-kill capabilities and more.

In the background the ransomware continuously print debugging messages

FIG.07OPERATOR GUI — DEBUG OUTPUT
Debugging messages printed by the ransomware in the background
▚ FIG.07 BACKGROUND DEBUGGING MESSAGES PRINTED BY THE RANSOMWARE

There is a dedicated panel for editing the ransom note

FIG.08OPERATOR GUI — START / DRIVES
Operator panel to start and stop the ransomware and choose the drives
▚ FIG.08 PANEL TO START/STOP THE RANSOMWARE AND CHOOSE DRIVES

This panel is where the operator can start/stop the ransomware and choose which drives to encrypt

WHY ELEVATED // 01

Looking at the task manager while Elpaco is running we can see that its process and sub processes are elevated without having needed to prompt the UAC, this mean that it found a way to bypass the prompt and escalate the privileges to high integrity automatically. Let see how it do that

FIG.09TASK MANAGER — ELEVATED
Task manager showing elevated Elpaco processes
▚ FIG.09 ELPACO PROCESSES RUNNING ELEVATED, NO UAC PROMPT

We can have a look inside the code of svchostss.exe

FIG.10REVERSING — COGETOBJECT
Decompiled svchostss.exe showing the CoGetObject call
▚ FIG.10 DECOMPILED SVCHOSTSS.EXE — COGETOBJECT CALL
FIG.11REVERSING — COM OBJECT
Decompiled code showing the auto elevated COM object abuse
▚ FIG.11 DECOMPILED CODE — AUTO ELEVATED COM OBJECT ABUSE

It's basically abusing a feature of Windows COM objects. This is a known technique for UAC bypass where the program abuse an auto elevated COM object like cmstplua com interface The call to CoGetObject take as an argument the entire moniker string: Elevation:Administrator!new:{3E5FC...} and return a pointer to the interface of the requested object. After this there is a call to ObjectStublessClient9, the 9 indicate the index inside the vtable of the interface ICMLuaUtil. We can do a little of reverse engineer of the vtable to understand what it does

FIG.12VTABLE — INDEX 9
Reverse engineered ICMLuaUtil vtable showing entry 9
▚ FIG.12 ICMLUAUTIL VTABLE — ENTRY 9 REVERSED
FIG.13VTABLE ENTRY — SHELLEXEC
Vtable entry calling ShellExecuteExW
▚ FIG.13 SHELLEXECUTEEXW INSIDE THE VTABLE ENTRY

We can see that inside it call ShellExecuteExW(). You can say almost with certainty that the program is creating another elevated instance of itself abusing this elevated call

So i analyzed the sample on a 24H2 Windows machine, Defender probably would have noticed the attempt to escalate privileges, but as it is now if you can get around it the technique still work on semi up to date system (not on 25H2).

You can find working POC here and in this blog

ENCRYPTION // 02

ELPACO use ChaCha20 as encryption algorithm, during the process it avoid to encrypt critical files like those in \windows\. All the files are renamed with .ELPACO-team extension. Inside the temp folder it drop session.tmp as a recovery key to use in case the program is stopped mid encryption for whatever reason

Trying to restart the machine this is the ransom note shown

FIG.14RANSOM NOTE
Ransom note shown after restarting the machine
▚ FIG.14 THE RANSOM NOTE SHOWN AFTER RESTART

CONCLUSION // 03

This one was brief but i had fun playing with the user interface and the ransomware functionalities

Links i used for researching:

CONTACT