Chinese Hackers Weaponize Nezha Tool to Run Commands on Web Servers


Security researchers have uncovered a sophisticated cyberattack campaign where Chinese threat actors are exploiting web applications using an innovative log poisoning technique to deploy web shells and subsequently weaponize Nezha, a legitimate server monitoring tool, for malicious command execution.

Creative Attack Methodology Discovered

Beginning in August 2025, cybersecurity firm Huntress identified an intrusion where attackers employed log poisoning to plant a China Chopper web shell on vulnerable web servers.

This technique represents a creative approach to gaining initial access, allowing threat actors to control compromised systems using AntSword before deploying Nezha for persistent command execution capabilities.

The attack chain begins with exploiting vulnerable phpMyAdmin panels that lack proper authentication mechanisms.

PHP Webshell
PHP Webshell

Threat actors immediately set the language to simplified Chinese upon accessing these administrative interfaces, indicating the likely origin of the attackers.

Within 30 seconds of language configuration, attackers proceed to execute SQL commands designed to enable general query logging and deploy their web shell payload.

The log poisoning technique involves manipulating MariaDB’s general logging functionality to write malicious PHP code directly into log files with executable extensions.

By setting the log file name to include a .php extension and placing it within the web server’s accessible directory structure, attackers effectively hide their web shell among legitimate log entries while maintaining remote access capabilities.

Following successful web shell deployment, threat actors download and install Nezha agents on compromised systems.

Nezha, marketed as a lightweight open-source server monitoring and task management tool, provides legitimate functionality for system administration but has been repurposed by threat actors for malicious command execution and persistent access.

Infected VictimsInfected Victims
Infected Victims

Analysis reveals that attackers configured their Nezha dashboard in Russian language settings while managing over 100 compromised victim machines across multiple geographic regions, with Taiwan, Japan, South Korea, and Hong Kong showing the highest concentration of affected systems.

Investigation of the threat actor’s infrastructure revealed suspicious autonomous system registrations and domain generation algorithms consistent with advanced persistent threat operations.

The attackers utilized cloud-based infrastructure spanning multiple providers, including AWS-hosted IP addresses in Hong Kong and virtual private servers in Dublin, demonstrating sophisticated operational security practices.

The campaign demonstrates how threat actors increasingly abuse publicly available tools to achieve their objectives while maintaining plausible deniability compared to custom malware development.

The low research costs, reduced detection probability, and legitimate tool appearance make this approach particularly attractive for sustained operations.

Organizations should also consider implementing network segmentation and monitoring solutions capable of detecting suspicious administrative tool usage patterns.

The following table contains comprehensive indicators of compromise associated with the Chinese threat actor campaign utilizing Nezha monitoring tools for malicious command execution on web servers.

CategoryItemTypeDescription
FilesC:xampphtdocs123.phpFile PathWeb shell file location
Filesf3570bb6e0f9c695d48f89f043380b43831dd0f6fe79b16eda2a3ffd9fd7ad16SHA256 HashWeb shell file hash
Fileshttps://rism.pages[.]dev/microsoft.exeDownload URLNezha Agent download source
FilesC:WindowsCursorslive.exeFile PathDownloaded Nezha Agent executable
Files9f33095a24471bed55ce11803e4ebbed5118bfb5d3861baf1c8214efcd9e7de6SHA256 HashNezha Agent file hash
FilesC:WindowsCursorsx.exeFile PathGhost RAT payload file
Files7b2599ed54b72daec0acfd32744c7a9a77b19e6cf4e1651837175e4606dbc958SHA256 HashGhost RAT payload hash
FilesC:Windowssystem32SQLlite.exeFile PathRenamed rundll32.exe for persistence
Files82611e60a2c5de23a1b976bb3b9a32c4427cb60a002e4c27cadfa84031d87999SHA256 HashRenamed rundll32.exe hash
FilesC:Windowssystem3232138546.dllFile PathMalicious DLL component
Infrastructure54.46.50[.]255IP AddressInitial access IP address
Infrastructure45.207.220[.]12IP AddressWeb shell C2 operator IP
Infrastructurec.mid[.]alDomainNezha C2 domain
Infrastructure172.245.52[.]169IP AddressNezha C2 IP address
Infrastructuregd.bj2[.]xyzDomainBackdoor C2 domain
MiscellaneousSQLliteService NamePersistence service identifier
Miscellaneousgd.bj2[.]xyz:53762:SQLliteMutexInfect

Follow us on Google News, LinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.



Source link