Winnti Hackers’ New UNAPIMON Tool Hijacks DLL And Unhook API Calls

Hackers commonly employ dynamic-link library (DLL) hijacking and unhooking of APIs to damage security measures and authorize harmful activities on breached systems.

In this regard, DLL hijacking permits them to load malicious code by utilizing flaws in the way applications load external libraries.

On the other hand, API unhooking helps bypass some monitoring mechanisms by modifying processes’ interaction with system APIs.

APT41 (aka Winnti) ‘s most recent attack on an organization was just traced back to Earth Freybug, a cyber threat group that has been active since 2012 and has been actively targeting firms in different sectors and countries.

Document
Run Free ThreatScan on Your Mailbox

AI-Powered Protection for Business Email Security

Trustifi’s Advanced threat protection prevents the widest spectrum of sophisticated attacks before they reach a user’s mailbox. Try Trustifi Free Threat Scan with Sophisticated AI-Powered Email Protection .

Earth Freybug uses two mechanisms, “DLL hijacking and API unhooking,” to evade child process monitoring. It utilizes a new unknown malware called UNAPIMON. 

Winnti Hackers’ New UNAPIMON Tool

This case was about exploiting genuine Windows utilities (schtasks.exe, vmtoolsd.exe) to implant malware.

It began by injecting codes into vmtoolsd.exe to create a scheduled task from the remote that started a batch script pre-staged.

This script gathered wide details about the system and created another scheduled task that ran a second script.

Earth Freybug attack chain (Source – Trend Micro)

The second script used DLL side-loading in order to load malicious DLLs into SessionEnv service and a new cmd.exe process which turned the machine into a backdoor for the attacker.

Experts observed using a strange malware dubbed UNAPIMON, a straightforward C++ DLL that hooks the CreateProcessW API. 

Its hooking mechanism launches new suspended processes, loads a local copy of each loaded DLL, creates an in-memory copy in the suspended process, and verifies that the two copies match before resuming the new process. 

This obfuscates monitoring of loaded DLLs in child processes as a defense evasion technique.

UNAPIMON verifies the in-memory copy matches the local copy by comparing headers and exported function details for each loaded DLL in the suspended child process. 

It analyzes the first few bytes of code to check if any exported functions were modified (hooked). Any hooked functions are then “unpatched” by overwriting the modified code with the original bytes from the local DLL copy. 

This removes any hooks/patches applied to the child process’s loaded DLLs before allowing execution, evading monitoring.

When unloaded, UNAPIMON removes its CreateProcessW hook.

UNAPIMON aims to unhook monitored API functions in child processes, evading detection from sandboxes and other API hooking-based monitoring. 

Its originality lies in creatively using existing tools like Microsoft Detours—instead of the malware doing the hooking, it un-hooks any hooked functions before execution. 

This simple yet effective technique showcases the malware author’s coding skills in repurposing ordinary libraries maliciously.

By removing API hooks, UNAPIMON allows unmonitored execution of malicious child processes.

Limiting administrative privileges follows the principle of least privilege, which limits attack possibilities.

Earth Freybug evolves its strategies over time by applying simple yet effective methods to old patterns, making detection difficult.

Is Your Network Under Attack? - Read CISO’s Guide to Avoiding the Next Breach - Download Free Guide
Tushar Subhra

Tushar is a Cyber security content editor with a passion for creating captivating and informative content. With years of experience under his belt in Cyber Security, he is covering Cyber Security News, technology and other news.

Recent Posts

Evasive Panda Attacking Cloud Services To Steal Data Using New Toolkit

The Evasive Panda group deployed a new C# framework named CloudScout to target a Taiwanese…

5 hours ago

Massive Midnight Blizzard Phishing Attack Using Weaponized RDP Files

Researchers warn of ongoing spear-phishing attacks by Russian threat actor Midnight Blizzard targeting individuals in…

6 hours ago

Sophisticated Phishing Attack Targeting Ukraine Military Sectors

The Ukrainian Cyber Emergency Response Team discovered a targeted phishing campaign launched by UAC-0215 against…

6 hours ago

Chinese Hackers Attacking Microsoft Customers With Sophisticated Password Spray Attacks

Researchers have identified a network of compromised devices, CovertNetwork-1658, used by Chinese threat actors to…

6 hours ago

New Windows Zero-Day Vulnerability Let Attackers Steal Credentials From Victim’s Machine

A security researcher discovered a vulnerability in Windows theme files in the previous year, which…

6 hours ago

SYS01 InfoStealer Malware Attacking Meta Business Page To Steal Logins

The ongoing Meta malvertising campaign, active for over a month, employs an evolving strategy to…

6 hours ago