QNAP NAS Encrypted by Ransomware: Data Recovery and First Steps

Ransomware Reverse Editorial TeamLast technical review:

In short

QNAP NAS devices have been hit by several ransomware campaigns built specifically for them, including eCh0raix, Qlocker, DeadBolt and CheckMate, and each leaves a different footprint, from password-protected 7z archives to a hijacked login page. Whether data comes back depends on the campaign, on snapshots, on the storage stack (QTS with ext4 or QuTS hero with ZFS) and on what was changed on the device after the attack. Image every drive before any firmware update, Malware Remover run, factory reset or pool repair.

The first minutes: what matters now

Files on your QNAP suddenly end in .7z, .encrypt, .deadbolt or .checkmate? The login screen has been replaced by a ransom demand? First rule: stay calm and do not try to fix anything.

  • Take the NAS off the network: pull the cable and disable port forwarding on the router.
  • Do not rush to power it off. During Qlocker, QNAP explicitly advised against shutting down a NAS whose data was being or had been encrypted.[1][4]
  • Take screenshots or photos: ransom page, Storage & Snapshots, shared folders, system logs.
  • Copy the ransom note and two or three encrypted sample files to a separate drive.
  • Write down and photograph the drive order before any disk leaves its bay.
  • No firmware update, no factory reset, no pool repair until the data is secured.

If the attack is still spreading through the network or other systems are hit, containment comes first. General first-response steps are on the ransomware emergency page. This page covers the QNAP-specific questions. For an overview across vendors, see NAS data recovery after ransomware.

Why QNAP: the known campaigns

QNAP devices are often reachable from the internet, directly or through port forwarding, they run for years, and they hold most of a small company's data. Several ransomware groups have therefore built malware specifically for QNAP NAS. That matters for recovery, because each campaign leaves a distinct, fairly recognisable footprint.

eCh0raix / QNAPCrypt (from 2019)

Anomali described eCh0raix in July 2019; Intezer tracked the same family as QNAPCrypt. Written in Go, it got in through guessed credentials and known vulnerabilities, encrypted files with AES, appended .encrypt and then removed the original file. An encrypted key value is written into the note README_FOR_DECRYPT.txt.[6] In 2021 Unit 42 documented a variant that targets QNAP and Synology devices alike and, on QNAP, exploited the flaw in Hybrid Backup Sync (HBS 3).[5][7] Anomali considered a decryptor possible because early samples generated keys weakly.[6] Whether that applies to a specific variant has to be checked. More on the eCh0raix profile page.

Qlocker (2021)

Qlocker started on 19 April 2021. Strictly speaking, it did not encrypt anything itself: the attackers used the 7-Zip command-line tool to move files into password-protected archives. The result: files ending in .7z and a !!!READ_ME.txt note in every folder.[2][4] QNAP said affected devices were exposed to the internet directly or via port forwarding and UPnP on default ports. The malware gained elevated privileges and deleted snapshots.[2] Vulnerabilities in Multimedia Console, Media Streaming Add-on and HBS 3 were discussed as entry points.[4][5]

Victims had several documented options:

  • Security researcher Jack Cable found a flaw in the payment site that let victims obtain passwords without paying. The operators closed it about an hour later.[4]
  • On some devices the archive password could be read from a log file, but only if the NAS had not been rebooted, and not always even then.[4]
  • QNAP released QRescue. It combines the open-source recovery tool PhotoRec with a QNAP script that rebuilds the folder structure from the .7z files and the PhotoRec output. The target is an external ext4-formatted drive with 1.5 to 2 times the used capacity of the NAS.[3]

The third route only works as long as the space once occupied by the deleted originals has not been overwritten. Every further write to the volume reduces the odds. More on the Qlocker profile page.

DeadBolt (2022 onwards)

DeadBolt appeared on 25 January 2022. It encrypts files with AES-128, appends .deadbolt and replaces the NAS login page with a ransom page. Victims were asked for 0.03 bitcoin per device; from QNAP itself the attackers demanded 50 bitcoin for a master key.[8] Because the defaced web interface was publicly visible, Censys was able to count infected devices on the internet.[15] According to Dutch police, around 20,000 QNAP and Asustor devices were hit worldwide.[12]

QNAP's response had consequences for victims. The company pushed firmware 5.0.0.1891 as a forced update, according to users even onto devices with automatic updates disabled. The update removed the ransomware executable and the ransom page used to start decryption, so victims who had already paid and were mid-decryption could not continue.[9] QNAP support said DeadBolt had been quarantined, and the helpdesk could remove the block page on request.[10] Emsisoft released its own decryptor, but it still needs a key obtained after paying.[11]

In October 2022 Dutch police, working with Responders.NU, obtained 155 keys by making payments that were cancelled before confirmation. Responders.NU set up a lookup page for victims who had not filed a police report.[12] Later DeadBolt waves exploited a vulnerability in Photo Station, among others.[14] More on the DeadBolt profile page.

CheckMate (2022)

CheckMate was first seen at the end of May 2022. QNAP found no new vulnerability: the attackers looked for SMB services exposed to the internet, guessed weak passwords in dictionary attacks and then encrypted the files in shared folders. Files get the .checkmate extension, and the note is called !CHECKMATE_DECRYPTION_README.[16] Because the attack runs through shares and user accounts, snapshots deserve a close look: they are managed at volume level and often survive, provided they existed and the compromised account had no administrator rights. More on the CheckMate profile page.

Damage pattern and recovery path at a glance

CampaignTypical damage patternTypical recovery approach
eCh0raix / QNAPCrypt.encrypt files, README_FOR_DECRYPT.txt note, originals deleted after encryption[6]Identify the variant and check decryptor status; image the drives, then look for deleted originals in the ext4 volume
QlockerPassword-protected .7z archives, !!!READ_ME.txt, snapshots deleted[2]No reboot before the logs are checked; recover deleted originals (the QRescue/PhotoRec principle), preferably from images rather than the live system
DeadBolt.deadbolt, ransom page instead of login, possibly no ransom page after the forced update[8][9]Capture the current state before any update; check key availability; review existing snapshots; otherwise analyse the volumes
CheckMate.checkmate files in shares, !CHECKMATE_DECRYPTION_README[16]Check volume-level snapshots and copy data out; file system analysis on images
Other ransomware via a Windows clientShares encrypted, NAS system itself intactSnapshots, earlier file versions, analysis of file system structures
Physical fault on topPool degraded or no longer detectedStabilise and image each drive, reconstruct the RAID virtually

Whether a decryptor exists for a family is covered on the ransomware decryption page. Whether paying is an option at all is discussed in Should you pay the ransom?.

QTS or QuTS hero: why the storage stack decides the recovery path

QNAP ships two operating systems with very different storage designs. Which one the device ran is one of the first questions in any analysis.

QTS organises drives into RAID groups. On top sits either a static volume directly on the RAID group, or a storage pool holding thick and thin volumes. Static volumes do not support snapshots; thick and thin volumes do.[17] Under the hood QTS uses Linux software RAID, a volume layer for pools and thin provisioning, and usually ext4 as the file system. For reconstruction that means: RAID parameters first, then pool and volume mapping, then ext4. Thin volumes in particular are not stored contiguously but allocated from the pool on demand, so without the pool metadata a rebuild becomes much harder.

QuTS hero is built on ZFS with copy-on-write.[19] Changed data is written to new locations, so older block versions and snapshot structures may still exist even when the visible files are encrypted. At the same time, ZFS is sensitive to forced imports and repairs that commit newer structures.

Typical QNAP-specific questions in an analysis:

  • How many drives, which RAID type, which slot order?
  • Static, thick or thin volume? Were there snapshots, and were they deleted?
  • Was an SSD cache or Qtier in use?
  • Was QNAP volume encryption enabled? If so, your own key or password is required.
  • Which firmware was running at the time of the attack, and has it been updated since?

How ext4, Btrfs and ZFS differ in recovery is also explained in Ransomware on servers, NAS, RAID and VMware. Synology usually relies on Btrfs and therefore has a different profile; see Synology NAS after ransomware.

Snapshots, Hybrid Backup Sync and myQNAPcloud

Using snapshots safely

On QNAP systems, snapshots are often the fastest way back. QNAP says it changed snapshots in 2021 so that ransomware cannot delete them, and that since QTS 5.0.0 they are enabled by default on thin and thick volumes. According to QNAP, users who take regular snapshots can restore their data to an earlier point in time.[14]

Mind the how: reverting a whole volume deletes all changes made after the snapshot, and the volume is inaccessible while the revert runs.[18] It is safer to document the state first, take a new snapshot before reverting if needed (QTS offers this option) and copy important data out of the snapshot to a separate target.[18] Before any of that, establish whether the snapshot predates the compromise.

Hybrid Backup Sync

HBS 3 is QNAP's backup tool and was itself an attack surface: the flaw covered in QSA-21-13 allowed remote attackers to log in to the device and was linked to eCh0raix and to Qlocker.[4][5][7] For recovery this means checking whether HBS targets (USB drive, second NAS, cloud) were writable from the compromised device. A backup target the NAS can freely write to may have been encrypted or deleted as well. How to vet backups before restoring is covered in Ransomware backup recovery.

myQNAPcloud, UPnP and port forwarding

Nearly every major wave hit devices whose admin interface or services were reachable from the internet. QNAP itself names direct exposure, port forwarding and automatic UPnP configuration as risks, and recommends disabling auto router configuration in myQNAPcloud and using myQNAPcloud Link or a VPN for remote access.[2][13][14]

What not to do

Many QNAP data losses are caused not by the ransomware but by well-meant steps afterwards:

  • No firmware update before the data is secured. The DeadBolt forced update showed that an update can remove the component needed to decrypt with a key.[9] Every update also writes to the system areas of the drives.
  • No re-initialisation and no factory reset. Depending on the option, configuration, pool mapping or volumes get recreated.
  • Do not run Malware Remover carelessly against the originals. It is a clean-up tool and can delete or quarantine files, including ones needed for later decryption.[10] Secure first, clean second.
  • Do not repair a pool, start a rebuild or run a volume check-and-repair. All of these rewrite metadata.
  • Do not shuffle drives or move them into another NAS. A different unit may treat them as new and offer to initialise them.
  • Do not roll back snapshots without a copy. A revert discards every later change.[18]
  • Do not install recovery software on the NAS that writes to the same volumes. Even QRescue deliberately writes to an external target.[3]
  • Do not delete encrypted files. They are needed for analysis, mapping and any later decryption.

What to do

  • Disconnect the NAS from the network; disable router port forwarding and UPnP
  • Capture the ransom page, storage overview, snapshot list and system log as photos or screenshots
  • Note model, firmware version, operating system (QTS or QuTS hero) and RAID type
  • Label drives with their slot numbers and photograph the order
  • Copy the ransom note and sample files to a separate drive
  • Have sector-level images made of every drive before anything is repaired
  • Check which backups and HBS targets exist independently of the NAS
  • Change every credential stored on or used with the NAS

If images may be needed for an insurer or a criminal complaint, document how they were made. See Forensic evidence preservation. If the NAS was attacked from a compromised corporate network, establishing the attack path is a job for incident response.

How a professional QNAP analysis works

  1. Intake: model, operating system, campaign (based on extension and note), steps taken so far, available backups.
  2. Imaging: every drive is copied read-only; failing drives are stabilised first.
  3. Rebuilding the storage stack: RAID group, pool and volumes on QTS, or the ZFS pool and datasets on QuTS hero, are reconstructed virtually from the images.
  4. Analysis: search for snapshots, deleted originals, unencrypted regions and older versions. With Qlocker, for example, for the originals deleted when files were moved into archives.
  5. Assessment and recovery: which data is fully, partly or not recoverable? Delivery on new media.

Recovered data belongs on a freshly installed, up-to-date system that is not exposed to the internet. DATA REVERSE lists supported models and failure scenarios on its QNAP data recovery page (in German) (external link).[20] General information on other NAS vendors is on NAS data recovery at DATA REVERSE (in German) (external link), and background on ext4 and other file systems on operating and file system recovery (in German) (external link).

Afterwards: do not leave the NAS exposed again

Recovery is only half the job. Without changes, the next wave will hit the same device.

  • Keep the admin interface and services off the open internet. Disable port forwarding and UPnP on the router and in myQNAPcloud; use a VPN for remote access.[13][14]
  • Use Security Counselor to check whether system administration is reachable from outside.[13]
  • Keep firmware and apps such as HBS 3, Photo Station and Multimedia Console up to date, and remove apps you do not need.[1][14]
  • Disable SMB 1 (QNAP recommends "SMB 2 or higher") and enforce strong passwords on every account.[16]
  • Take regular snapshots and keep a backup the NAS cannot delete. How to set that up is covered in Immutable backup.

The broader framework is on the cyber resilience page; the general principles of recovery are on ransomware data recovery.

Data recovery by system

Frequently asked questions

Can I just factory-reset my QNAP NAS after a ransomware attack?

Not until the data has been secured. A factory reset or re-initialisation can overwrite configuration, volumes and storage structures that a reconstruction depends on. Image all drives first and take photos and notes of the current state.

Are files with a .7z extension lost after Qlocker?

Not necessarily. Qlocker moved files into password-protected 7z archives. QNAP published QRescue for this case, a tool that uses PhotoRec to recover files and then rebuilds the folder structure. How much it recovers depends on what has been written to the NAS since.

Is there a free decryptor for DeadBolt?

Not for victims without a key, as far as is publicly known. The Emsisoft tool requires a key that was delivered after a ransom payment. In 2022 the Dutch police and Responders.NU also obtained 155 keys; whether that matters for a given case can only be checked individually.

Should I update the firmware immediately after a DeadBolt attack?

Only after the data is secured and the decision has been made deliberately. The update QNAP pushed in 2022 removed the DeadBolt ransom page together with the component needed to decrypt with a key. If decryption is still on the table, capture the current state first.

Do QNAP snapshots help against ransomware?

Often, provided they exist and were not deleted. Qlocker deliberately removed snapshots; QNAP says it hardened snapshots against deletion in 2021. Reverting a whole volume discards every later change, though, so browse the snapshots first and copy data out rather than rolling back blindly.

Is recovery different on QuTS hero than on QTS?

Yes. QTS typically uses Linux software RAID, a volume layer and ext4, while QuTS hero uses ZFS. On ZFS, copy-on-write remnants and snapshot structures matter; on QTS, the RAID, pool and ext4 layers have to be reconstructed. In both cases, analysis belongs on images, not on the live system.

Related ransomware profiles

Read next

Sources and further reading

  1. [1]QNAP – Response to Qlocker Ransomware Attacks: Take Actions to Secure QNAP NAS (22 April 2021) qnap.com
  2. [2]QNAP – Response to Qlocker: Q&A qnap.com
  3. [3]QNAP – Manually Install QRescue to recover Qlocker-encrypted files on QNAP NAS qnap.com
  4. [4]BleepingComputer – Massive Qlocker ransomware attack uses 7zip to encrypt QNAP devices (21 April 2021) bleepingcomputer.com
  5. [5]QNAP Security Advisory QSA-21-13 – Improper Authorization Vulnerability in HBS 3 qnap.com
  6. [6]Anomali – The eCh0raix Ransomware (10 July 2019) anomali.com
  7. [7]Palo Alto Networks Unit 42 – New eCh0raix Ransomware Variant Targets QNAP and Synology NAS Devices (10 August 2021) unit42.paloaltonetworks.com
  8. [8]BleepingComputer – New DeadBolt ransomware targets QNAP devices, asks 50 BTC for master key bleepingcomputer.com
  9. [9]BleepingComputer – QNAP force-installs update after DeadBolt ransomware hits 3,600 devices (28 January 2022) bleepingcomputer.com
  10. [10]ITPro – QNAP ransomware victims dealt double blow as firmware update hampers decryption (1 February 2022) itpro.com
  11. [11]Emsisoft – DeadBolt Decryptor emsisoft.com
  12. [12]BleepingComputer – Police tricks DeadBolt ransomware out of 155 decryption keys (14 October 2022) bleepingcomputer.com
  13. [13]QNAP – Take Immediate Actions to Stop Your NAS from Exposing to the Internet (26 January 2022) qnap.com
  14. [14]QNAP – Response Action and Statement to Recent DeadBolt Attacks (12 September 2022) qnap.com
  15. [15]Censys – Deadbolt Ransomware is Back (22 March 2022) censys.com
  16. [16]BleepingComputer – QNAP warns of new Checkmate ransomware targeting NAS devices (7 July 2022) bleepingcomputer.com
  17. [17]QNAP QTS 5.1 – Thick, thin, and static volumes docs.qnap.com
  18. [18]QNAP QTS 5.1 – Reverting a volume docs.qnap.com
  19. [19]QNAP – QuTS hero (ZFS-based operating system) qnap.com
  20. [20]DATA REVERSE – QNAP data recovery (German) datareverse-datenrettung.de