Warning / Findings: Ebury (libkeyutils.so.1.6.2) Infection
via CWP Remote API (Port 2304) + Docker/CSF Firewall Bypass
Hi everyone,
Sharing a quick heads-up and forensic summary from a compromised CWP server
so others can check their logs and lock down port 2304.
1. Detection & Rootkit Cloaking
cwp_security_audit flagged:
[!!! CRITICAL ALERT !!!] Ebury libkeyutils trojan detected: /usr/lib64/libkeyutils.so.1.6.2 (setuid=4755)
Standard ls -la /usr/lib64/libkeyutils* hid the file and spoofed the symlink target (libkeyutils.so.1 -> libkeyutils.so.1.6). Tracing with strace bypassed the userland hook and revealed the real symlink pointing to libkeyutils.so.1.6.2.
2. Entry Vector (Port 2304 Command Injection)
Even though port 2304 was not listed in TCP_IN in /etc/csf/csf.conf, running Docker alongside CSF caused iptables chain conflicts, leaving 0.0.0.0:2304 exposed to the internet.
Logs confirmed unauthenticated RCE attempts via /v1/backup and /v1/endtransf:
• /usr/local/cwpsrv/logs/2304_access_log: POST /v1/endtransf HTTP/1.1 (followed 3 seconds later by binary creation in /usr/bin/ and /usr/lib64/).
• /var/log/cwp/cwp_api.log: Start backup ; <injected payload>
3. Emergency Cleanup (Before Full OS Reinstall)
strace -o /dev/null rm -fv /usr/lib64/libkeyutils.so.1.6.2
cd /usr/lib64/ && rm -fv libkeyutils.so.1 && ln -s libkeyutils.so.1.6 libkeyutils.so.1 && ldconfig
unset LD_PRELOAD
dnf reinstall -y keyutils-libs openssh-server openssh-clients
reboot
(Note: Always rotate all root/panel/DB/SSH credentials after rebooting and plan a clean OS reinstall, as Ebury logs credentials and drops secondary binaries.)
4. Hardening / Mitigation
• Disable /usr/local/cwpsrv/conf.d/api.conf (or bind listen 127.0.0.1:2304 ssl;) and restart cwpsrv.
• Do not rely solely on CSF if Docker is installed—block port 2304 at the hosting provider's external firewall level.
5. Decide yourself to keep "security first" CWP ;D
If security is done right, Port 2304 should be firewalled with allowing only trusted IP's to access it.
By Default that port is not open in CSF.
Quote from: Starburst on <strong>Today</strong> at 04:15:12 PMIf security is done right, Port 2304 should be firewalled with allowing only trusted IP's to access it.
By Default that port is not open in CSF.
Did you read this?
Quote2. Entry Vector (Port 2304 Command Injection)
Even though port 2304 was not listed in TCP_IN in /etc/csf/csf.conf, running Docker alongside CSF caused iptables chain conflicts, leaving 0.0.0.0:2304 exposed to the internet.
Logs confirmed unauthenticated RCE attempts via /v1/backup and /v1/endtransf:
Docker is not part of CWP.
If Docker leaks a port somehow, sounds like a Docker mis-configuration problem.
It should not be accessing iptables without permission.
Edit the iptables configuration manually, and remove all ALLOW entries that are there at the top.