
The rootkit behind the SEO spam: 22 months unnoticed
A digital agency came to us about SEO spam on its websites. The cause turned out to be the Ebury rootkit. We cleaned up a server hosting ~110 websites without taking them down, and set up monitoring that caught two real attacks in the first week.
See how it works
the projectin numbers
-
22
months the rootkit ran on the server unnoticed (December 2023 – October 2026)
-
~110
websites of the client and its customers on one server
-
8
minutes from web shell upload to the attack being shut down
-
20+
days without any sign of the rootkit returning
The client's request
Everything lived on a single dedicated server, with no security monitoring. It had to be cleaned in place without stopping dozens of client projects.
What was there
- Server: Ubuntu 22.04, ISPmanager, Docker, PostgreSQL, mail.
- Projects: ~110 websites from 2019–2026 on WordPress, Laravel and Node.js; 158 GitHub repositories.
- Access: SSH login with a password, one root password for SSH and the panel, deploys from GitHub Actions over SSH, contractors with access.
What happened
- An old Laravel app was running with debug mode enabled.
- Attackers used it to gain access to the server.
- SEO spam appeared on the agency's corporate websites.
- 8 days passed before the client noticed the breach, and only because of the visible spam.
Constraints
- Clean up in place, no migration.
- No server reboots, no stopping websites or deploys.
- Don't break the panel the agency uses to manage websites, mail and VPN.
What changed
The rootkit is removed, credentials are replaced, and the server is under monitoring. In the 20+ days since the rootkit was removed, there hasn't been a single sign of its return. The only alert during that time turned out to be false and was investigated.
Before
- The Ebury rootkit sat on the server for 22 months, and nobody knew.
- The intrusion was noticed after 8 days, because of visible spam.
- SSH login by password, root reachable from the internet.
- The hosting panel was open to the internet, with the same password as root.
- GitHub keys on the server with write access to all 158 repositories.
- 20 Laravel projects with vulnerable dependencies.
After
- The rootkit is removed, with a check for its return every 5 minutes.
- An intrusion is visible at the moment of login or within a minute of a file appearing.
- Key-only login, and every login is visible in Telegram.
- The panel is reachable only via VPN, with TOTP.
- Old keys are revoked, and deploys run under a separate user.
- Patches in all 20 projects, 7 upgraded to Laravel 11–12.
How the protection works
From investigation to monitoring: how we found the rootkit, cleaned the server and caught two real attacks. Order of work: investigation → cleanup → vulnerabilities → monitoring.
Beneath the website hack lay a rootkit from 2023
The first cleanup removed the spam and rebuilt the vulnerable website, and the conclusion was "root not affected". We didn't stop there and checked the integrity of the entire system: packages, SUID files, kernel modules, loaded libraries, network connections.
What we found
A libkeyutils library that doesn't belong to any package, with a forged modification date. It was loaded into sshd, PHP, Apache, PostgreSQL and the DNS server. The signature matched Ebury, an OpenSSH backdoor and credential stealer that, according to ESET, has infected around 400,000 servers.
What it meant for the client
Ebury steals the passwords and keys of everyone who logs in via SSH. Over 22 months, administrators, developers and CI logged in through the server, and the server itself held keys with write access to all 158 repositories. We immediately treated all of these credentials as compromised and made rotating them the first item in our recommendations.
15 seconds on the server, and an alert
The attacker came back with the root password stolen by the rootkit and restored the implant in 15 seconds. The password hadn't been changed yet. He wiped the logs on disk, but the Telegram alert had already left the server.
Two real attacks caught in the first week
We built the monitoring in one day on standard Linux mechanisms. Events go to the team's Telegram group and to a log with a year of history. Routine events such as CI deploys and our own VPN logins arrive silently so they don't drown out real alerts.
A web shell shut down in 8 minutes
A bot uploaded a web shell to an old WordPress website through a vulnerability in the Ninja Forms File Uploads plugin (CVE-2026-0740). No login required; the hack took one second. All websites of that system user share permissions, so the shell could read database passwords and tokens.
Challenges and solutions
The difficulties we ran into while solving the problem and how we solved each of them.
An invisible rootkit
The infected sshd loaded the rootkit into every SSH session, so ls, cat and ps showed a clean system.
We used a static busybox: it doesn't load shared libraries, so the rootkit couldn't fool it.
Searching blind
The first hypothesis of a kernel rootkit wasn't confirmed.
We rechecked the server from scratch and found the tampered link and the rootkit file.
Cleanup without downtime
Dozens of projects run on the server; reboots and downtime are unacceptable.
Every change was agreed with the client, with a configuration backup and a rollback plan prepared. There were two short outages on individual websites (5 and 14 minutes) and one reboot for verification.
A stolen password
The attacker came back with it 5 days later, before the password had been changed, and restored the implant in 15 seconds.
The Telegram alert went out before the logs on disk were wiped. The IP was blocked, and root password login was disabled.
A false alarm
One of the "hidden process" alerts turned out to be a mistake.
We traced it to the root cause: it was a race condition in the check, and we rewrote it.
A checklist for your server
The visible website hack wasn't the biggest problem. Five actions for anyone running dozens of websites on one server.
Website hacked: check the whole server
Cleaning up one website wouldn't have found a rootkit that sat in the system for 22 months.
Change passwords and keys immediately
The attacker came back 5 days later with a password whose change had been put off "for later".
Disable password login for SSH
Ebury feeds on intercepted passwords, and key-based login takes away its main resource.
Alerts must leave the server instantly
In 15 seconds the attacker wiped the logs on disk, but not the message in Telegram.
Update or remove old software
Both web hacks in this case went through public CVEs, and the plugin exploit took one second.
How it works for you
A good fit if
- You're an agency or studio hosting client websites on your own server.
- You have dozens of websites on one server.
- You've been through a website hack and aren't sure nobody is left on the server.
What we need from you
- Access to the server. Read-only is enough for an audit.
- The list of websites and services that can't be stopped or rebooted.
- A person who will approve changes.
What can be added next
- Rotating passwords and keys for third-party services stored on the server.
- Isolating websites from each other so that one hacked website doesn't open up the rest.
- Removing outdated software, such as PHP 7.4.
- External uptime checks for the server.
- Moving to a clean server: our recommendation after two root compromises.
Not sure nobodyis on your server?
We'll start with a read-only audit: we change nothing until you see the full picture.


