Saturday, January 11, 2025
HomeCyber AttackWinnti Hackers' New UNAPIMON Tool Hijacks DLL And Unhook API Calls

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

Published on

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 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.

Latest articles

QSC: Multi-Plugin Malware Framework Installs Backdoor on Windows

The QSC Loader service DLL named "loader.dll" leverages two distinct methods to obtain the...

Weaponized LDAP Exploit Deploys Information-Stealing Malware

Cybercriminals are exploiting the recent critical LDAP vulnerabilities (CVE-2024-49112 and CVE-2024-49113) by distributing fake...

New NonEuclid RAT Evades Antivirus and Encrypts Critical Files

A NonEuclid sophisticated C# Remote Access Trojan (RAT) designed for the.NET Framework 4.8 has...

Hackers Targeting Users Who Lodged Complaints On Government portal To Steal Credit Card Data

Fraudsters in the Middle East are exploiting a vulnerability in the government services portal....

API Security Webinar

72 Hours to Audit-Ready API Security

APIs present a unique challenge in this landscape, as risk assessment and mitigation are often hindered by incomplete API inventories and insufficient documentation.

Join Vivek Gopalan, VP of Products at Indusface, in this insightful webinar as he unveils a practical framework for discovering, assessing, and addressing open API vulnerabilities within just 72 hours.

Discussion points

API Discovery: Techniques to identify and map your public APIs comprehensively.
Vulnerability Scanning: Best practices for API vulnerability analysis and penetration testing.
Clean Reporting: Steps to generate a clean, audit-ready vulnerability report within 72 hours.

More like this

QSC: Multi-Plugin Malware Framework Installs Backdoor on Windows

The QSC Loader service DLL named "loader.dll" leverages two distinct methods to obtain the...

Weaponized LDAP Exploit Deploys Information-Stealing Malware

Cybercriminals are exploiting the recent critical LDAP vulnerabilities (CVE-2024-49112 and CVE-2024-49113) by distributing fake...

New NonEuclid RAT Evades Antivirus and Encrypts Critical Files

A NonEuclid sophisticated C# Remote Access Trojan (RAT) designed for the.NET Framework 4.8 has...