CWP Security Audit flagged /usr/local/cwpsrv/bin/cwpsrv as tampered on our server
(AlmaLinux 9, cwpsrv-1.30.6-1.el9.x86_64). Findings:
- rpm -V: S.5 on the binary; mtime reset to the package value.
- Clean binary from the repo: 4,582,304 bytes, SHA256 b1e3c0450f14bc807d1d253b5fef2bf38c4255005bb8eb79c863df2d68a8e34e
- Installed binary: 4,767,368 bytes, SHA256 62758f2a68d92ad6d8022f1f1fcdab87161a6336c96697dbd73eadfc9d6bc506
- Not stripped. Contains a hidden module "ngx_http_log_digest" (functions ngx_http_lgd_hdr_sig/_ts/_data,
log_digest_sig_check, aes_encrypt/decrypt, execute_privileged, helper_run, disable_access_log).
Extra imports: RSA_verify, PEM_read_bio_RSA_PUBKEY, EVP_Encrypt/Decrypt*, BIO_f_base64, popen, pipe.
Header names are encoded, so the published CWPdoor IOCs (X-Ngx-Integrity, ngx_http_integrity_helper)
do NOT match this variant.
- Built from upstream nginx: it logs "nginx: the configuration file ... syntax is ok" instead of "cwpsrv:".
This gives a simple check in /var/log/messages for when the trojan was first started.
Timeline: an admin ran a routine OS update (glibc only) from Yum Manager. 23 seconds after dnf finished,
cwpsrv was stopped, the binary replaced, restarted, and timestamps reset (ctime shows the real time).
The admin session shows no file manager or terminal use at that moment, so the swap was done by
something server-side, possibly triggered by the update.
Questions:
1. Is this variant known to you?
2. Could a CWP component (Yum Manager or a post-update script) have been modified to run the installer?
Which files should we compare against originals?
3. Is there an official integrity check for the CWP PHP files and /scripts?
We have replaced the binary with the clean one from the repo, restricted the panel ports and are
planning a full rebuild.
BR
Venty