Skip to main content

Hit by ransomware? Isolate affected systems now. Do not reboot or reformat.

SheMo Noransom舍末无勒

Victim Q&A · Systems & software

What should we do when a Linux server or BT Panel is hit by ransomware?

Short answer

First work out which kind of incident you have: website and database files that have genuinely been encrypted (new extensions, ransom notes in the directories), or databases that were dropped and replaced with a ransom table. The second involves no encryption, nobody can prove beforehand that the attacker kept a copy, and paying is not a recovery path. In both cases cut public access but keep the host running, do not reinstall or keep restarting the database, snapshot or image the data partition, then look for the data in backups, binlogs and disk remnants - and remove every back door before going live again.

Key points

  • File encryption and database wipe-and-ransom are different incidents: the first turns on the family and backups, the second on backups, binlogs and disk remnants.
  • With a wiped database there is no way to verify before paying that the attacker kept the data - in documented cases some crews deleted without downloading anything.
  • Entry is usually on the exposed side: web application flaws, hosting control panels, database and Redis ports, weak SSH passwords.
  • BT Panel has had an unauthorised database-management access flaw and an episode of widely reported Nginx tampering; the panel should not face the internet directly.
  • Before going live, check authorized_keys, crontabs, systemd services and web shells one by one - changing passwords does nothing against them.

In this order

What to do now

  1. Cut public access, keep the host running

    Block public inbound traffic in the cloud security group or host firewall, allowing only the responders' fixed IPs. Keep the host running: no reboot, no OS reinstall, and no reinstalling MySQL or PHP into the original directories. If SSH no longer works, get in through the cloud console's VNC terminal or out-of-band management.

  2. Stop everything that writes over the data

    Pause scheduled tasks in the panel and the system, above all backup jobs that keep a fixed number of copies - they will push the last good backup out with an empty or encrypted one. Do not upload, extract or export large files onto the data partition, and do not keep restarting mysqld: the disk blocks of deleted data files can be overwritten by any new write.

  3. Snapshot or image the data partition

    On cloud servers snapshot the system and data disks; on physical machines take a read-only disk image. Data extraction, binlog replay and disk-level recovery all happen on the copies from now on, and nothing more is written to the originals.

  4. Preserve logs and intrusion traces

    Save Nginx or Apache access logs (usually under /www/wwwlogs on BT Panel hosts), /var/log/secure or auth.log, every user's crontab and bash history, systemd units, authorized_keys files, the MySQL error log and binlogs, and the panel's operation log. Keep ransom notes as they are, export any ransom table unchanged, and copy the existing binlog files somewhere else as soon as possible.

  5. Establish the incident type and family

    Changed extensions and ransom notes in the directories mean an encryption incident - confirm the family with online identification. Intact files but missing databases or tables, plus a new ransom table or ransom database, mean wipe-and-ransom, and the work shifts to backups and binlogs. Both can happen together.

  6. Inventory every recovery source

    Go through the panel's local backup directory, backups on other hosts or in object storage, cloud disk snapshots, replicas, binlog files and older exports in development or test environments, noting the point in time of each. Local backups on the same machine as the database are often deleted or encrypted along with it, so do not assume they survived.

  7. Restore on a new host, clear back doors, then go live

    A compromised host should be rebuilt. Patch the new host fully, keep the panel, database and cache ports off the internet, change every password and key, and only then load the recovered data. Old website code needs a web shell sweep and an integrity comparison before it is deployed again.

Avoid making it worse

Do not

  • Do not reinstall the OS, reinstall MySQL into the original data directory, or let the panel's repair or reinstall functions overwrite the environment - remnants of deleted data files and the intrusion evidence are overwritten together.
  • Do not keep starting mysqld against the original data directory or step through innodb_force_recovery levels; every attempt belongs on the image.
  • Do not pay the address in a ransom table or note. With a wiped database there is no way to verify beforehand that the attacker kept the data, and documented cases include crews that deleted without downloading and crews overwriting each other's notes.
  • Do not keep writing large files to the data partition, and do not let rotating automatic backups keep running.
  • Do not go live again after only changing SSH and panel passwords - keys in authorized_keys, crontabs, systemd services and web shells are unaffected by a password change.
  • Do not restore a website backup straight over the original directory: the backup may already contain web shells, and overwriting flushes away the entry-point evidence.
  • Do not download and run a ".locked decryptor" from the internet: .locked is shared by several families, and a mismatched tool only causes further damage.

Encrypted files versus a wiped database: what is the difference?

"Ransomware" on a Linux web server comes in two forms that call for entirely different responses, so tell them apart first.

Files encryptedDatabase wiped and ransomed
What you seeWebsite files, .ibd data files and backup archives renamed with a new extension, ransom notes in the directoriesFiles intact, but databases or tables gone and a ransom table or ransom database added
Where the data isStill on the host, encryptedDeleted from the host; the attacker may or may not have taken a copy
What payment buysA key that may or may not workData that cannot be shown to exist before you pay
Main recovery pathsFamily identification, backups and snapshots, structure-level file repairBackups, binlog replay, disk-level recovery of deleted data files

Wipe-and-ransom needs no malware at all - a database logon is enough. The PLEASE_READ_ME operation disclosed by Guardicore (now part of Akamai) started in January 2020: it brute-forced internet-facing MySQL, archived and exfiltrated the data, deleted it from the server and left a ransom table named WARNING. Its dashboard listed 250,000 databases from 83,000 servers and used a leak site for pressure. The MongoDB wiping wave of early 2017 showed the other side: BleepingComputer reported rival gangs overwriting each other's ransom notes, some groups deleting data without downloading it at all, and victims who paid getting no reply.

So the question with a wiped database is not only whether to pay, but that nobody can confirm beforehand whether the attacker holds the data, or which crew holds it. Even if they did keep it, the exposure has already happened and paying does not undo the compliance consequences. Our position matches should you pay the ransom: no payment, no negotiation - spend the time finding the data. The two techniques can also appear together: in its published incidents, JadePuffer encrypted configuration fields in place and also dropped application databases, leaving a README_RANSOM table.

Where can data come from after a MySQL database is dropped?

Work down this list, most reliable first.

1. Backups and snapshots. mysqldump exports from the panel or scripts, physical backups, cloud disk snapshots, replicas. Check where each backup lives: backups on the same machine and the same disk as the database are often deleted with it, so copies on another host, in object storage or on offline media matter most.

2. Binlog replay. MySQL's documentation describes the binary log as the data source for point-in-time recovery: restore a full backup, then use mysqlbinlog to re-execute the changes made after it, stopping just before the DROP statements. Binary logging is on by default in MySQL 8.0; older versions and manually initialised instances need checking one by one. Know the limits, too. A binlog records changes, so without a full backup as a starting point it can rebuild a table on its own only if the retained binlogs cover the table's entire history since creation. An attacker with high privileges may also purge binlogs, so copy the existing files out as soon as possible.

3. Recovering deleted data files at disk level. This depends on tablespace layout. MySQL's documentation states that InnoDB creates a separate tablespace file (.ibd) per table by default, and that dropping such a table returns the disk space to the operating system. In other words the .ibd was deleted at filesystem level, but its blocks may remain on disk until something overwrites them, so the file can be recovered from the image or rows can be extracted by scanning for InnoDB page structures. A table in a shared tablespace leaves its space marked reusable inside InnoDB, and pages not yet reused can be scanned in the same way. Either way, stop all writes to the partition immediately and work only on the image. How much comes back depends on how much was written after the wipe, and we do not promise a ratio in advance.

4. Rebuilding from the business side. Payment platform statements, third-party marketplace orders, caches, logs and notification records can fill in orders, members and other critical data.

If ibdata1 or .ibd files were genuinely encrypted and renamed, page-level repair and encryption-coverage analysis are covered in MySQL encrypted by ransomware. When MongoDB, Elasticsearch or Redis is wiped the logic is the same: secure the persistence files on disk, snapshots and replica nodes first, analyse copies, and do not rush to restart the service or rebuild the instance.

How do attackers usually get into Linux web servers?

Entry to Linux web servers is almost always on the internet-facing side. Check these categories one at a time:

  • Web application and component flaws. Critical vulnerabilities in frameworks, middleware, CMS plugins and business applications are scanned for and exploited in bulk; the attacker writes a web shell, then encrypts the web root and the database directory. TellYouThePass is the best-known family on this route: in December 2021 it was deployed through Log4j, and its Linux build harvests SSH keys to move across the internal network.
  • Hosting control panels. In August 2020 BT Panel disclosed an unauthorised database-management access flaw affecting Linux 7.4.2, test build 7.5.14 and Windows 6.8, where requesting a specific URL opened the database management page directly; the fixes were 7.4.3, 7.5.15 and 6.9.0. In December 2022 a number of BT Panel users reported the Nginx binary being replaced, malicious JavaScript injected into pages and logs wiped. BT's official notice said no vulnerability had been found in the panel or Nginx so far and advised upgrading the panel, changing the security entrance and passwords, enabling two-factor authentication and tamper protection; no public conclusion on the entry point has emerged since. In February 2026 Datadog Security Labs documented attackers who, after exploiting React2Shell, used a script written specifically for BT Panel to rewrite the Nginx configurations it manages and hijack traffic. cPanel/WHM is a target as well - the Sorry ransomware spread in bulk through its authentication bypass.
  • Database and cache ports. 3306, 27017, 6379 and 9200 exposed to the internet with weak passwords or no authentication are the entry for wipe-and-ransom. Redis's own documentation advises against exposing it directly to the internet and notes that clients can use the CONFIG command to write files to arbitrary paths, which can lead to compromise of the whole host.
  • Weak and reused SSH passwords. Once one host falls, the attacker uses the same password or harvested keys to log in to other Linux hosts on the network.

The evidence for the entry point sits mainly in web access logs, panel logs and SSH authentication logs - which is exactly why reinstalling first is a mistake.

Which back doors must be removed before going live?

Most back doors on a Linux host survive a password change, which is exactly why so many servers are encrypted or wiped again after recovery. A compromised host should be rebuilt; where it genuinely has to be examined in place, check at least the following:

  • Accounts and keys: new accounts or accounts with UID 0 in /etc/passwd, unfamiliar public keys in every user's authorized_keys including root's, and changes to sudoers.
  • Scheduled jobs: every user's crontab, /etc/crontab, /etc/cron.d and the cron.hourly-style directories, plus unfamiliar entries in the panel's scheduled tasks.
  • Services and start-up hooks: new or modified systemd services and timers, /etc/rc.local, and start-up commands in /etc/profile.d and users' shell profiles.
  • Web directories: new php or jsp files in upload directories and the web root, files with odd timestamps, and anything that differs from the code repository.
  • Binary integrity: whether long-running programs such as Nginx and sshd have been replaced - in the December 2022 BT Panel episode it was precisely the Nginx binary - plus executables under /tmp and /dev/shm and unexplained processes.
  • The panel itself: whether panel accounts, the security entrance or the allowed IP list were changed, and whether the panel is on the latest version.

After the sweep, change every password and key: system accounts, SSH keys, panel accounts, database accounts, and the database connection strings and cloud AccessKeys in application configuration. For the wider root-cause picture see why ransomware keeps coming back.

Does the same apply to ESXi, NAS devices and Windows servers?

Not entirely. These cases have their own pages:

  • VMware ESXi hosts encrypted. These encryptors are often described as Linux builds, but they target virtual disks on the datastore; the shutdown, snapshot deletion and vmdk encryption behaviour and the recovery paths differ from a web server's. See virtualization platforms encrypted.
  • Synology, QNAP and other NAS devices encrypted. NAS operating systems are Linux-based too, but the work centres on storage volumes and snapshots. See servers and NAS encrypted.
  • Windows and cloud servers on the same network. Remote desktop and SQL Server entry points and shadow copies are covered in what to do when a server is hit by ransomware.

Mixed environments are common: after a web server falls, the attacker may go on to the database server, the backup server or even the hypervisor management interface on the same segment. Scope the investigation by actual network reachability and credential reuse, not by operating system.

Emergency response

Data already encrypted? Stop and let an engineer look first

We do not pay ransoms and we do not negotiate with attackers. Engineers run a free assessment first, then propose a recovery plan and a firm quote.

Related questions

Related ransomware families

Related solutions

FAQ

Follow-up questions

  • Can we keep using BT Panel?

    What matters is less the panel than how it is exposed. Do not open it directly to the internet: restrict it to allowed IPs, change the security entrance, enable two-factor authentication and keep it updated - BT's own December 2022 notice likewise advised upgrading the panel and enabling two-factor authentication and tamper protection. Keep phpMyAdmin, database and Redis ports off the internet too. If this host has already been compromised, do not harden it and carry on; redeploy the panel and environment on a new host, then load data and code that have been checked.

  • Our database was wiped and the ransom table asks for Bitcoin - will paying bring the data back?

    We advise against it. With a wiped database there is no way to confirm before paying that the attacker kept the data: in the 2017 MongoDB wave, gangs overwrote each other's notes, some deleted without downloading anything, and victims who paid got no reply. Even where the data really was exfiltrated, as with PLEASE_READ_ME, paying only buys back from criminals data that has already leaked, and the compliance obligations that follow do not go away. The more effective move is to stop writes immediately, image the data partition and look for the data through backups, binlogs and disk-level recovery, in that order. We do not pay ransoms and do not negotiate on anyone's behalf.

  • No backups and no binlog - is there any hope?

    There is a chance, but it depends on what has been written to the disk since, and sooner is better. InnoDB keeps one .ibd file per table by default, so a dropped database means files deleted at filesystem level whose blocks may remain until overwritten; pages of tables dropped from a shared tablespace may not have been reused yet either. How much comes back depends on how much was written to that disk after the wipe, the filesystem, whether TRIM is enabled, and whether the database has already been reinstalled or rebuilt. The priority now is to stop writing to the partition, take a read-only image and assess on the image. We will tell you plainly what we find and will not promise a ratio.

  • The attacker says they downloaded our data - will it be published?

    It is possible, so treat the data as potentially exposed. The PLEASE_READ_ME operation listed stolen databases for sale on its own site to apply pressure. Whether data actually left is judged from bulk queries and exports in web and database logs, the volume and direction of outbound traffic, and archive files or transfer tools on the host. Assessment methods, leak-site checks and notification duties are covered in ransomware gangs threatening to publish data.

  • SSH suddenly stopped working and every database process is down - is this ransomware?

    It may be. Some Linux ransomware stops the SSH service and kills database processes right before encrypting - Sorry is a typical example. Do not rush to reboot. Get in through the cloud console's VNC terminal or out-of-band management, check the web and data directories for new extensions and ransom notes and /tmp for unfamiliar executables, tighten inbound rules in the security group, and then preserve the scene following the steps on this page.