Linux.Encoder
Linux.Encoder is considered to be the first ransomware trojan targeting computers running Linux. There are additional variants of this Trojan that target other Unix and Unix-like systems. Discovered on November 5, 2015, by Dr. Web, this malware affected at least tens of Linux users.
Linux.Encoder.1 is remotely executed on the victim's computer by using a flaw in Magento, a popular content management system app. When activated, the malware encrypts certain types of files stored on mounted local and network drives using AES and RSA public-key cryptography, with the private key stored only on the malware's control servers. The malware then stores a file called "readme_to_decrypt.txt" in every directory, containing a message, which offers to decrypt the data if a payment is made. Compared to other ransomware such as CryptoLocker, the malware does not state a deadline to pay and the ransom does not increase over time.
Discovery
On November 5, 2015, Dr. Web, a Russian anti-malware company, added Linux.Encoder.1 to its virus database. The company then published the malware description the day after. This ransomware is written in C using the PolarSSL library.Operation
Propagation
According to Bitdefender Labs, the most common infection vector is through a flaw in Magento, a shopping cart software. CheckPoint, reported this vulnerability in April 2015. After this report, Magento issued a fix. However, a lot of small e-commerce sites did not apply this critical update. Linux hosts may also be attacked using other exploits.File encryption
Encrypted files
When run as root, the program loads two files into memory containing the attackers' demands:- ./readme.crypto
- ./index.crypto
The malicious program encrypts files with the aforementioned extensions in the following directories:
- /home
- /root
- /var/lib/mysql
- /var/www
- /etc/nginx
- /etc/apache2
- /var/log
- public_html
- www
- webapp
- backup
- .git
- .svn
- /
- /root/
- .ssh
- /usr/bin
- /bin
- /etc/ssh
Encryption method
Like other ransomware, Linux.Encoder.1 uses mixed-encryption algorithms to encrypt data. It starts by generating an AES key on the victim's device and encrypts all of the previous files using AES-CBC-128. Then the RSA-encrypted AES key is prepended to the beginning of every encrypted file, with the original file permissions and the IV used by the AES algorithm. All the encrypted files have ".encrypted" added at the end of their file name.The program uses the libc rand() function with the timestamp at the moment of encryption as a seed to generate the IV and the keys.