The CWPdoor backdoor lets attackers run commands on Linux servers through a modified copy of cwpsrv, the web server behind Control Web Panel (CWP). Researchers at XLab discovered the malware on June 29 when they captured a script that posed as an updater and replaced the legitimate server software.

Fake updater conceals the file change

Hosting administrators use CWP, formerly CentOS Web Panel, to manage websites, email, DNS and databases. XLab counted more than 340,000 publicly accessible CWP instances over the month preceding its report. The number of servers running the malicious binary remains unknown.

The fake updater targets cwpsrv versions 1.15.10 and 1.24.0. After replacing the binary, the script restores the original file and directory timestamps. It also deletes temporary files and clears the command history. As a result, an administrator checking modification dates could miss the switch.

A signed HTTP request activates the backdoor

The CWPdoor backdoor waits for an incoming HTTP request that carries an encrypted command, a timestamp and a digital signature in three separate headers. Before it decrypts the command, the malware checks the RSA signature and verifies that the timestamp falls within five minutes of the server’s current time.

Because the signature covers both the timestamp and the encrypted command, changing either value invalidates the request. The time check also prevents someone from reusing a captured request after it expires. Once both checks pass, the backdoor decrypts the command and sends it to a helper process for execution. It uses AES-256-CBC encryption for both commands and their output.

The malware also interferes with the web server’s logging module. Consequently, the request that activates the backdoor leaves no entry in the server’s access log.

What administrators can check on a CWP server

On September 30, XLab spotted a VirusTotal upload that contained both the modified cwpsrv binary and Ebury, a Linux backdoor that steals credentials. At the time, none of the scanning engines flagged the malicious cwpsrv file. XLab saw the upload as evidence of a real-world infection, although the connection between the two malware families remains unclear.

XLab recommends checking for a Unix socket named ngx_http_integrity_helper and examining unexpected cwpsrv helper processes. Administrators can also inspect the server binary for strings beginning with X-Ngx-Integrity. If they confirm a compromise, XLab advises replacing the malicious binary with a legitimate copy, upgrading to the latest version, rotating all control panel credentials and checking the host for additional malware.


0 responses to “CWPdoor backdoor hides in Linux hosting panel web server”