A New Ransomware Is Targeting Network Attached Storage (NAS) Devices
A new ransomware family has been found targeting Linux-based Network Attached Storage (NAS) devices made by Taiwan-based QNAP Systems and holding users' important data hostage until a ransom is paid.
Ideal for home and small business, NAS devices are dedicated file storage units connected to a network or through the Internet, which allow users to store and share their data and backups with multiple computers.
Independently discovered by researchers at two separate security firms, Intezer and Anomali, the new ransomware family targets poorly protected or vulnerable QNAP NAS servers either by brute forcing weak SSH credentials or exploiting known vulnerabilities.
Dubbed "QNAPCrypt" by Intezer and "eCh0raix" by Anomali, the new ransomware is written in the Go programming language and encrypts files with targeted extensions using AES encryption and appends .encrypt extension to each.
However, if a compromised NAS device is located in Belarus, Ukraine, or Russia, the ransomware terminates the file encryption process and exits without doing any harm to the files.
Moreover, later in this article, we have also explained how researchers took advantage of a logical weakness in the ransomware infrastructure that allowed them to stop this malware from infecting new victims temporarily.
Upon execution, the file-encrypting ransomware first connects to its remote command-and-control server, protected behind the Tor network, using a SOCKS5 Tor proxy to notify attackers about new victims.
Based on the analysis it is clear that the proxy has been set up by the malware author to provide Tor network access to the malware without including Tor functionality in the malware.
Before encrypting files, the ransomware requests a unique bitcoin wallet address, where victims are supposed to transfer the ransom amount, from the attacker's C&C server that contains a predefined list of already created bitcoin addresses.
If the server runs out of unique bitcoin addresses, the ransomware doesn't proceed to encrypt files and wait for attackers to create and provide a new address.
Interestingly, researchers at Intezer took advantage of this mechanism and created a script that allowed them to trick the attacker's C&C server into assigning all available bitcoin addresses to hundreds of virtual victims, thereby blocking the ransomware from encrypting files for new legitimate victims.
Since the authors behind this ransomware were delivering one Bitcoin wallet per victim from a static pool of already generated wallets, we could replicate the infection packets to retrieve all of the wallets until they had no further wallets under their control," Intezer said.
If the ransomware gets its unique bitcoin wallet, it generates a 32-character random string to create an AES-256 secret key and then uses it to encrypt all the files stored on targeted NAS device with AES algorithm in Cipher Feedback Mode (CFB), removing the original files.
Since the encryption module uses math's package to generate the secret key, Anomali said it's likely possible for researchers to write a decryptor for the new ransomware family because the function is not entirely random.
"Malware initializes the math random page with the seed of the current time. Since it is using the math's package to generate the secret key, it is not cryptographically random, and it is likely possible to write a decryptor," the Anomali researchers said.
The threat actor targets QNAP NAS devices that are used for file storage and backups. It is not common for these devices to run antivirus products, and currently, the samples are only detected by 2-3 products on VirusTotal, which allows the ransomware to run uninhibited.
Researchers also noted that before encrypting files stored on targeted NAS devices, the ransomware also attempts to kill a specific list of processes, including apache2, httpd, nginx, MySQL, mysql, and PostgreSQL.
As a reminder, we urge users not to, unknowingly or unnecessarily, connect their NAS devices directly to the Internet, and also enable automatic updates to keep firmware up-to-date.
Moreover, users are always recommended to use strong passwords to secure their NAS devices in the first place and regularly backup stored information on these devices, so that in case of any disaster, the important data can be recovered without paying ransom to attackers.