Hello there,
I’ve been using HestiaCP on multiple servers for many years, and so far, so good.
However, at the moment I’m dealing with a critical situation. One of the servers (luckily, just one!) with a pretty much default installation (MySQL + PHP-FPM, etc.) got compromised. There are over 50 Magento 2 shops hosted there, mostly in dev/test versions. They have all been compromised as well.
You might think: “Yeah, dev sites, shitty developers, outdated Magento” - yes, that’s all true. However, with PHP-FPM running separately for each user, it’s a bit weird that ALL sites were compromised, and looks like not only sites.
Did they all have viruses? Were they all attacked at exactly 6:59 AM? Is it possible? I guess not really.
There is a common point.
I started digging deeper and noticed that every index.php file had been replaced with a WordPress maintenance page. Also, many (but not all, and not everywhere) directories now contain an index.html file with exactly the same content as these “new” index.php files.
And when I say every index.php, I mean EVERY one. Yes, thats right. Including HestiaCP files.
All of them, across all sites and users, had the correct ownership. There were also HestiaCP files owned by root whose contents had been replaced. So I started wondering… what the f*** happened here?
I dug even deeper. Most of the logs had been cleaned up. There were no suspicious scripts running in the background. Nothing really suspicious that I could find.
I’m not accusing anyone or demanding anything. I’m just wondering: am I the only one who has experienced something like this, or has anyone else seen a similar situation?
Everything had been working fine for several years, including before the latest upgrade. But maybe the upgrade isn’t the actual cause - perhaps it’s just a coincidence?
You might ask whether anyone else had root/admin access to the server. No. Just me. And access was via SSH key only.
The auth logs were clean (or cleaned..). According to the logs, nobody had logged in for days.
At this point, I’m completely out of ideas.
Any help would be really appreciated.
Best!