In December 2022, researchers discovered a version of the Clop ransomware that targets Linux servers. However, there was a vulnerability in the encryption scheme of this variant of the malware, thanks to which the victims could restore their files for free.
Clop for Linux was first spotted by SentinelLabs after attackers used it to attack a university in Colombia, along with the Windows variant. Although the new malware is very similar to the Windows version (because they use the same encryption method and almost identical process logic), it is still in development. In addition, there are still some differences between these Clop variants, mainly related to API call restrictions and features not yet implemented.
Experts say that when launched, the malware executable file (ELF) creates a new process that tries to elevate the rights to a level that allows you to encrypt data.
The files and folders targeted by Clop include the user’s /home directory, which contains all personal files, /root, /opt directories, and Oracle directories (/u01 – /u04) used to store database files or as mount points for Oracle software. The researchers note that this is rather unusual, as Linux ransomware typically does not target specific Oracle database folders and is more focused on encrypting ESXi virtual machines.
In addition, it is noted that the Linux version of Clop does not yet support the hashing algorithm used in the Windows version to exclude certain types of files and folders from the encryption process. Also, the Linux version does not yet have a mechanism for handling files of different sizes in different ways.
In their report, the experts talk in detail about the vulnerability they found in the malware encryption system. For example, the current version of Clop for Linux does not encrypt the RC4 keys used to encrypt files with an RSA-based asymmetric algorithm, as Windows does.
Instead, the Linux malware uses hardcoded encoded RC4 master key to generate encryption keys, and then uses the same key to encrypt them, and stores the keys locally in a separate file. Also, the RC4 key is not verified at all, although on Windows it is always verified before encryption starts.
But the lack of key protection is not the only disadvantage of Clop for Linux. In addition, when the encryption key is written to a file, the malware writes a number of additional data there, including information about the file (its size and encryption time). Researchers say that such data should have been hidden, because it can help cybercriminologists decrypt specific files.
Experts explain that in fact, such a scheme does not protect the keys from free extraction, and the encryption can be “rolled back”, which was eventually done. A special Python script created by the researchers for this purpose has already been published on GitHub.
SentinelLabs said that they have already provided their decryptor to law enforcement agencies, and helped victims of the ransomware recover data for free.