Tuesday, February 27, 2024

Hackers Using Legitimate Windows Tools for Hiding Malware and Evade the Detection

Malware Authors are always using many sophisticated techniques to spreading advance persistent threats and Hiding Malware to evade the current defense mechanism such as hiding advance Malware in a legitimate process.

In this case, malware using some trusted system process to inject the malicious code into the victim’s machine without being caught by security tools.

A new malware variant discovered from Microsoft .NET that use trusted application  InstallUtil.exe which is a .NET framework ( Installer tool is a command-line utility that allows you to install and uninstall server resources by executing the installer components in specified assemblies.)

This process abuses the console utility InstallUtil.exe and runs a malicious .NET assembly and bypass the assembly entry point later it can able to Hiding Malware to an inside of the trusted process.

It uses the familiar file format such as pdf and images to Hiding Malware with password protection and sends it across to the victim and users are misled by executable file icons.

Also Read:   Beware!! Dangerous Locky Ransomware Now Spreading through Microsoft Office Word Documents

How Does They Hiding Malware

Initially, it takes place in %temp% folder where it starts to execute the process later on and performing the Further Infection Process.

Discovered Malicious files are highly obfusticated which is very Difficult to analyze its functions until and unless to deobfuscate its string, methods, and its structure.

The .NET Assembly not a right entry point to execute the file from InstallUtil.exe. Entrypoint has begun from an inherited class known as System.Configuration.Install.Installer.

According to Kaspersky “Dropper code in static class constructors is known to execute first when the assembly is loaded into memory, a feature utilized by the authors of this piece of malware”

Sample before deobfuscation

Sample after deobfuscation

In this Malicious file execution method, we could see that FirstMainClass using with keyword called “static” where assembly execution will begin.

CheckSandboxieEnvironment()- Checking the sandbox environment whether the file attempting to load the SbieDll.dll library. if its loaded then the malicious process will be terminated

CheckVirtualBoxEnvironment()– checking the vboxmrxnp.dll library in Virtualbox environment .if its found then malicious process will be terminated.

AddResourceResolver() – It helps to load the resource event that is a method of unpacking the assembly.

UnpackAllAssemblies()–  This method is used to unpack the assembly later it helps to load the malicious file into the legitimate libraries.

RemoveZoneIdentifier() – it deletes the NTFS alternate stream Zone.Identifier through the command line to prevent a warning at startup if the file was downloaded from the Internet.

ElevatePrivilegesProxy()  – This constrution method helps to UAC bypass technique .

Later, control will pass into  traditional entry point – Main() 

The traditional entry point is the Main() method

Here we can see that there is the Visual basic script used to run the Executable file from a Form5 class that runs the current assembly using InstallUtil.exe later current process is closed (Exit(0)).

Later Static class constructor called by InstallUtil.exe and he malicious object is run using the InstallUtil tool.

The static class constructor called by InstallUtil.exe

Finally, it Copying the malicious file to %APPDATA%\program\msexcel.EXE, setting the Hidden+System attributes for the “program” folder, running msexcel.EXE, and terminating the current process.

Until this case, things were described for an elevation of privileges, a startup from a trusted application.

Here Malicious process starts the inherit Process that contains 5 class.it has several interfaces but it uses IDisposable.

The overridden Dispose() method of the Form5 class

According to Kaspersky, It Executes various cycle to execute the malicious Utility. please have a deep look at it.

  • At the first iteration, the full path to the RegAsm.exe utility from .NET Framework is retrieved;
  • A chain of nested methods is called with a view to decoding strings from Base64 that are stored in another class and unpacking the resulting array using the SevenZipExtractor library. As a result, we get an array that is the remote administration tool NanoCore Client;
  • The PERun.dll library is loaded from the assembly that was previously unpacked from the resource into memory;
  • A class with the name “RunPE” and the Run method of this class are sought in this library;
  • At the final iteration, the parameters are transferred and the Run method is called.

Here Run() method employs the technique of hiding malicious code in the address space of the trusted process RunPE and Run() method, a legitimate utility process is created in CREATE_SUSPENDED state .see the below image.

Creating a legitimate program process in CREATE_SUSPENDED state

Finally, RegAsm.exe process is loaded into the address space and starts to execute the payload: the remote administration tool NanoCore Client. Only trusted processes remain in the list of running processes, and even an experienced user might not realize that the system is compromised Kaspersky said.

Only legitimate utilities can be seen in the list of running processes
Here this sample contains NanoCore Client, which can be used to control the victim’s computer, take screenshots, record keystrokes, download files, and much more. It should be noted that the payload here can be anything: from “fashionable” encrypters and miners to advanced Trojans.


payload: EF8AF3D457DBE875FF4E3982B34F1DE9

payload: 82709B139634D74DED404A516B7952F

payload: D1A9879FFCB14DF70A430E59BFF5EF0

payload: D8652841C19D619D2E3B5D7F78827B6E

payload: BF4A3F4B31E68B3DE4FB1F046253F2D0


Latest articles

ThreatHunter.ai Stops Hundreds of Attacks in 48 Hours: Fighting Ransomware and Nation-State Cyber Threats

The current large surge in cyber threats has left many organizations grappling for security...

WordPress Plugin Flaw Exposes 200,000+ Websites for Hacking

A critical security flaw has been identified in the Ultimate Member plugin for WordPress,...

Hackers Actively Hijacking ConnectWise ScreenConnect server

ConnectWise, a prominent software company, issued an urgent security bulletin on February 19, 2024,...

Heavily Obfuscated PIKABOT Evades EDR Protection

PIKABOT is a polymorphic malware that constantly modifies its code, making it hard to...

Anonymous Sudan Promoting New DDoS Botnet: Beware

It has come to light that a group known as Anonymous Sudan is actively...

Scattered Spider: Advanced Techniques for Launching High-Profile Attacks

Scattered Spider is a threat group responsible for attacking several organizations since May 2022...

8220 Hacker Group Attacking Linux & Windows Users to Mine Crypto

In a significant escalation of cyber threats, the 8220 Gang, a notorious Chinese-based hacker group, has intensified its attacks...
BALAJI is an Ex-Security Researcher (Threat Research Labs) at Comodo Cybersecurity. Editor-in-Chief & Co-Founder - Cyber Security News & GBHackers On Security.

Live Account Takeover Attack Simulation

Live Account Take Over Attack

Live Webinar on How do hackers bypass 2FA ,Detecting ATO attacks, A demo of credential stuffing, brute force and session jacking-based ATO attacks, Identifying attacks with behaviour-based analysis and Building custom protection for applications and APIs.

Related Articles