QNAP : A new ransomware family has been found targeting Linux-based Network Attached Storage (NAS)

0
1053

A newly uncovered ransomware family was found targeting QNAP network-attached storage (NAS) devices.

Named eCh0raix (detected by Trend Micro as Ransom.Linux.ECHORAIX.A) by security researchers at Anomali, the malware was reportedly designed for targeted ransomware attacks similar to how Ryuk or LockerGoga were used.

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.

eCh0raix’s Routines

eCh0raix is written in Go/Golang, a programming language increasingly abused to develop malware. eCh0raix performs language checks to determine an affected NAS device’s location, and terminates itself if it is in certain countries in the Commonwealth of Independent States (CIS) like Belarus, Ukraine, and Russia. eCh0raix encrypts documents and text files, PDFs, archives and databases, and multimedia files among others. 

While the exact infection vector is still unclear as of this writing, forum posts in BleepingComputer noted that the infected NAS devices do not have the latest patches and protected by weak passwords.

This indicates that eCh0raix’s operators could be brute-forcing or exploiting vulnerabilities in their targeted NAS devices.

The researchers also noted that eCh0raix, unlike typical ransomware families, appears to be designed for targeted attacks. For instance, eCh0raix’s offline version is embedded with hardcoded encryption keys compiled for specific targets, and unique decryption keys are associated with each. 

The ransomware demands a ransom of 0.05 – 0.06 bitcoin (around US$567 as of July 11, 2019), paid via a site hosted in Tor, in exchange for the necessary decrypt key.

BleepingComputer has reported that the decryptors seem to be available for Windows and macOS. Affected QNAP NAS devices include QNAP TS-251, QNAP TS-451, QNAP TS-459 Pro II, and QNAP TS 253B. 

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.

nas ransomware malware

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,” the Anomali researchers say.

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.

nas ransomware malware

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.

“We were able to collect a total of 1,091 unique wallets meant to be delivered to new victims distributed among 15 different campaigns.”

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.

ransomware malware payment

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.

Securing NAS Devices

QNAP Systems, the manufacturer of the NAS devices targeted by eCh0raix, has published recommendations on ransomware mitigation, such as enabling QNAP’s snapshot feature, which can help in backing up and restoring files.

To further reduce the NAS device’s attack surface, users and businesses are recommended to adopt best practices including:

  • Changing default credentials or considering adding authentication and authorization mechanisms used to access NAS devices
  • Updating the NAS device’s firmware to patch exploitable vulnerabilities
  • Ensuring that other systems or devices — particularly routers, which are connected to or built into NAS devices — are also updated
  • Enforcing the principle of least privilege: enable features or components only when necessary (e.g., opening a port on the router) or use a VPN when accessing NAS devices over the internet
  • Enabling the NAS device’s built-in security features; QNAP’s network access protection, for instance, helps thwart brute-force attacks or similar intrusions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Questo sito usa Akismet per ridurre lo spam. Scopri come i tuoi dati vengono elaborati.