The Lie of the "Retis" ransomware - How to decrypt

Its two days to christmas and there is no petrol to move around and I have been grounded by my wife for staying out late (10pm), so i stay at home and play with my daughter (Nicole). At the exact point she slept off, i got a threat intelligence report about a new ransomware dubbed "Retis Ransomware". Bored at home, i decided to have a look at this new toy. I got a sample of it from hybrid-analysis and just threw it into "dnSpy" - my favorite .NET decompiler.
To my surprise, the code was not obfuscated as most malwares are usually obfuscated to prevent reverse-engineering.
I also noticed it was very selective of the type of files to encrypt and focused on documents and pictures.
I ran it within my test system and it encrypted some files and added ".crypted" extension. Unlike most disastrous ransomwares (wannacry, notpetya, badrabbit) this was a bit lax on the range of files to encrypt, and also it did not seem to delete shadow files which could be used to retrieve deleted/encrypted files.
It also displayed the ransom note below (translated to English from French)
A look at the encrypt file function (EncryptFile) shows that it makes use of a secretKey and an intialisation key (IV), which is not out of the norm, but i then noticed that these keys are actually hardcoded within the program itself at the main() function.
This alludes to the fact that a Decryption function should be somewhere within the code. There it was, and it also made use of the same keys used for encryption.
It meant that the ransomware could somehow decrypt itself. Lets look further.
A closer look at the main() function showed that the ransomware checks if there is a second argument and if that argument was same as "/dechiffre" (french meaning for "/decrypt").
Could this be how to decrypt encrypted files? I checked it out and it worked.
i have read so many "false" reports on the malware and how to remove it from systems by downloading a "special" tool to remove it. Vendors exploiting the situation to sell something.
Blogs copying other blogs "verbatim" in their reporting without validating. The ransomware lacks sophistication and does not even provide a bitcoin address to make payment.
I hope we have learnt something today. :)
Merry Xmas and a Wonderful New Year :)

Comments

Popular posts from this blog

Red Teaming with Covenant and Donut

Pentesting Android applications

Covenant Task 101 - PPID Spoof Example