XLab researchers have disclosed CWPdoor, malicious code embedded in the server that powers Control Web Panel (CWP). Their analysis, published on November 5, describes a command execution mechanism that stays dormant during normal operation and removes traces of its own requests from the access log.
What the researchers found
CWP is used to manage servers, including websites, email and DNS. The attackers replace cwpsrv, the executable responsible for the panel’s interface. The script the researchers examined poses as an update and requires root privileges. The report does not establish how the attackers gain initial access.
The modified server responds to a specially crafted request containing an encrypted command and a signature, while still handling regular traffic normally. The installation script restores file timestamps and covers some of its tracks, so a quick check of modification dates may not reveal that the file was swapped.
XLab also points to a sample found in an archive uploaded to VirusTotal as evidence that infections exist outside the lab. However, the number of publicly exposed panels should not be read as the number of victims. The researchers have not published a confirmed count of infected servers.
What to check on your servers
The report includes specific indicators that administrators can use during an inspection:
- Check for the
ngx_http_integrity_helper socket and any unusual helper processes associated with cwpsrv.
- Search the
/usr/local/cwpsrv/bin/cwpsrv file for X-Ngx-Integrity strings.
- Verify where the executable came from and compare it against a trusted release.
- If an infection is confirmed, preserve evidence for analysis, restrict access to the host and start incident response.
- Rotate the panel’s credentials and check the system for other persistence mechanisms.
Replacing a single file should not close the investigation. Since the installation required elevated privileges, you need to determine what the attacker did beforehand and how far their access to services hosted on the server may have extended.
SecurHUB commentary
A lack of suspicious requests in the log does not rule out a breach if the malicious code tampers with event logging. Incident response should include analysis of files, processes and how the attacker gained initial access.
Sources: QiAnXin XLab, BleepingComputer