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

LegionLoader Abusing Chrome Extensions To Deliver Infostealer Malware

LegionLoader, a C/C++ downloader malware, first seen in 2019, delivers payloads like malicious Chrome extensions,…

19 hours ago

ASUS Critical Vulnerabilities Let Attackers Execute Arbitrary Commands

In a recent security advisory, ASUS has alerted users to critical vulnerabilities affecting several of…

23 hours ago

NTT Docomo Hit by DDoS Attack, Services Disrupted for 11 Hours

NTT Docomo, one of Japan’s leading telecommunications and IT service providers, experienced a massive disruption…

1 day ago

Apple Agrees to $95M Settlement Over Siri Privacy Lawsuit

Apple Inc. has agreed to pay $95 million to settle a proposed class-action lawsuit alleging…

1 day ago

iTerm2 Emulator Vulnerability Let Attackers Access Sensitive User Data

 A critical vulnerability discovered in the popular macOS terminal emulator iTerm2 has raised concerns among…

1 day ago

PoC Exploit Released For Critical Windows LDAP RCE Vulnerability

The CVE-2024-49112 vulnerability in Windows LDAP allows remote code execution on unpatched Domain Controllers, as…

2 days ago