
New Ransomware-as-a-Service Tool ‘Thanos’ Shows Connections to ‘Hakbit’

®, membre du groupe Insikt de Recorded Future, a développé de nouvelles méthodes de détection pour Thanos. ransomware dans le cadre d'une enquête approfondie. Les sources de données comprenaient la plateforme Recorded Future®, des référentiels multiscanners en ligne et divers Outils OSINT.
The target audience for this research includes security practitioners, network defenders, and threat intelligence professionals who are interested in novel ransomware threats.
Executive Summary
In January 2020, while using the Recorded Future® Platform to monitor the weaponization of the RIPlace technique, Insikt Group uncovered a new family of ransomware for sale on Exploit Forum called Thanos, developed by a threat actor with the alias “Nosophoros.”
Nosophoros offered Thanos as a private ransomware builder with the ability to generate new Thanos ransomware clients based on 43 different configuration options. Recorded Future analyzed the Thanos ransomware builder to detect, understand, and exercise the breadth of functionality that the Thanos ransomware can support. The Thanos client is simple in its overall structure and functionality. It is written in C# and is straightforward to understand even with obfuscation, though it does incorporate some more advanced features such as the RIPlace technique.
During this research, we observed an overlap between our detections and a ransomware family called Hakbit. Based on code similarity, string reuse, and core functionality, Insikt Group assesses with high confidence that ransomware samples tracked as Hakbit are built using the Thanos ransomware builder developed by Nosophoros.
Thanos’s ease of use has been an asset to its creator, as Recorded Future has observed the rising popularity of the malware on multiple underground forums. We believe this is indicative of the continuing trend of threat actors looking for ready-to-use ransomware. Nosophoros has continued to develop Thanos over at least the past six months, with regular updates and new features. Thanos is advertised as a “Ransomware Affiliate Program,” similar to a ransomware-as-a-service (RaaS) model. Thanos will continue to be weaponized by threat actors either individually and collectively as part of the affiliate program.
Key Judgments
- Thanos was the first ransomware family to advertise use of the RIPlace technique, demonstrating a real instance of underground actors weaponizing proofs of concept originating from security research.
- The Thanos ransomware does not incorporate any novel functionality or techniques, with the exception of its use of RIPlace. With information security best practices such as prohibiting external FTP connections and blacklisting downloads of known-offensive security tools, the risks associated with the two key components of Thanos — Data Stealer and Lateral Movement — can be averted.
- Based on code similarity, string reuse, and core functionality, Recorded Future assesses with high confidence that the Thanos ransomware is the commodity ransomware that has been identified as Hakbit by other security researchers.
- By default, Thanos uses a random, 32-byte string generated at runtime as a password for the AES file encryption. The string is then encrypted with the ransomware operator’s public key and added to the ransom note. Without the corresponding private key, recovering encrypted files is impossible.
- The Thanos builder includes the option to use a static password for the AES file encryption. If this option is selected, the clients generated by Thanos will contain the AES password used to encrypt files. Analyzing the client could allow data recovery without paying the demanded ransom.
- During Thanos client execution, the encryption and decryption keys can be recovered from memory, which should prevent loss of data without paying the demanded ransom.
Background
En novembre 2019, la société de sécurité Nyotron a publié une preuve de concept pour une technique de ransomware baptisée RIPlace. Au moment de sa publication, RIPlace contournait la plupart des méthodes anti-ransomware existantes, échappait aux produits antivirus (AV) testés et échappait à la détection par les produits de détection et de réponse aux incidents au niveau des terminaux (EDR). Nyotron a signalé la faille aux fournisseurs concernés, y compris Microsoft. Toutefois, selon la déclaration de Microsoft à BleepingComputer, étant donné que RIPlace n'avait pas encore été observé dans un ransomware au moment de la rédaction de cet article, « cette technique n'est pas considérée comme une vulnérabilité et, comme CFA est une fonctionnalité de défense en profondeur, elle ne répond pas à nos critères de sécurité ». Selon BleepingComputer, seuls Kaspersky et Carbon Black ont modifié leur logiciel afin d'empêcher l'exécution de cette technique, comme indiqué dans le dernier rapport publié en novembre 2019. Cependant, dès janvier 2020, Insikt Group a observé des membres de forums clandestins et du dark web mettre en œuvre la technique RIPlace.

Insikt Group first observed Thanos ransomware in February 2020 being advertised by threat actor Nosophoros on XSS Forum due to a feature update including the RIPlace technique. Nosophoros offered either a monthly “light” or lifetime “company” subscription to the Thanos builder. The company version includes additional features as compared with the light version, such as RootKit, RIPlace technology, client expiration settings for affiliate programs, and spread on LAN. This report is based on analysis of the lifetime “company” version, which covers the full capabilities of Thanos ransomware.
Threat Analysis
Builder Analysis
The Thanos ransomware builder gives operators of the ransomware the ability to create the ransomware clients with many different options. The full builder user interface can be seen in Figure 2. The builder provides some default options, but requires operators to configure others, such as the Bitcoin address that will be included in the ransom note. Other options can be enabled at the operator’s discretion.

Once the operator has completed the configuration stage, the builder generates a .NET executable file in the directory of the operator’s choosing. The binaries generated appear to be the result of replacing strings in a template binary based on the configuration options selected, and based on the configuration options using string values “YES” and “NO” rather than actual boolean values. An example of an unobfuscated sample with the configuration options can be seen in Figure 3. In the builder, hovering over each of these options would reveal a help message for the option. The full list of options and their help messages can be found in Appendix A.

Le développeur est également responsable de la gestion de l'obfuscation des binaires finaux. Lorsque l'obfuscation n'est pas activée, les exécutables .NET générés contiennent des chaînes de texte en clair, mais les noms des variables, méthodes, classes et espaces de noms restent aléatoires. Le constructeur propose deux méthodes d'obfuscation. La méthode principale consiste à utiliser une version piratée de l'outil commercial de dissimulation appelé SmartAssembly, développé par la société Redgate. La méthode secondaire est une option de configuration qui crée un fichier d'installation Inno Setup avec le client en tant que fichier de ressources intégré.
Ransomware Client Overview
The Thanos client is written in C#. The clients generated all had randomized strings for the method names, variable names, and class names.
The Thanos client will contain 12 to 17 classes depending on the options and settings selected during the building phase. Some of the classes, such as Program and Crypto, are included in every build. Others, such as NetworkSpreading and Wake on LAN, are only included in the final binary, if the related option is selected. The table below covers the core classes and our description of their intended purpose.
Insikt has provided additional analysis on some of the more interesting classes in the Thanos Client Feature Analysis section.
Thanos Client Execution Flow
The general execution path of Thanos contains three main activities shown below and depicted in Figure 4.
- Advanced Options: Performs actions related to the configuration settings
- Prevent Termination and Recovery: Stops services and processes that prevent its ability to run and delete backup files and shadow copies
- Encrypt and Upload: Encrypt files and upload to FTP if configured to do so at build time and show the ransom note

Advanced Options
The first phase consists mostly of executing the advanced options set during the build. These would include actions such as Kill Defender, Anti-VM, and AMSI Bypass. Within the client itself, the configuration settings can be determined by a list of variables and string arrays at the end of the Program Class. Figure 5 depicts how the configuration settings are set to “yes” or “no” within the client.

Prevent Termination and Recovery
After the client performs the configuration actions, the client will next perform a series of tasks to ensure it runs successfully as well as delete backups and shadow copies. These tasks cause multiple child processes, each with different arguments to net.exe, taskkill.exe, del.exe, and vssadmin.exe. Appendix B addresses these actions in more detail.
Encrypt and Upload
Finally, the Thanos client will traverse the attached storage drives, and will attempt to discover and encrypt files with the file extensions configured in the builder (the default extensions can be found in Appendix C). If the option to upload files to an FTP server is enabled (called “datastealer” in the builder), then files with extensions that match a list configured at build time will be uploaded before encryption. The default extensions to upload are “.docx,” “.pdf,” “.xlsx,” and “.csv.” Encrypted files have their extensions changed to a value set at build type, with a default value of “.crypted.”
After encryption of the files, the ransom note (seen in Figure 6) will be saved to the desktop as well as any folder that has had files encrypted. The default ransom filename is “HELP_ME_RECOVER_MY_FILES.txt.“ The Thanos client also has the ability to change the wallpaper to an image that is downloaded from an HTTP server set by the threat actor.

The Thanos client can be configured to create a log of the encryption process that completed and upload that log to a threat actor’s FTP server. Besides the FTP functionality and the ability to download a wallpaper from a web server, the Thanos client does not have any built-in functionality for command and control (C2) communication.
If configured to do so, after the completion of all previous steps, the Thanos client will delete itself.
Thanos Client Feature Analysis
To understand the capabilities of Thanos ransomware, Recorded Future generated over 80 clients with different configuration options enabled. This section highlights six of the key features of the ransomware.
Encryption Process
Le client Thanos utilise le cryptage AES-256 en mode CBC pour crypter les fichiers utilisateur. La clé utilisée pour le chiffrement AES est dérivée d'un mot de passe et d'un sel à l'aide de l'appel de fonction Windows rfc2898DeriveBytes. Une fois que le client a utilisé cette clé pour chiffrer tous les fichiers qu'il a détectés, il utilise une clé publique RSA 2048 intégrée pour chiffrer le mot de passe AES qui a été utilisé. La chaîne base64 de ce mot de passe chiffré est ajoutée à la demande de rançon, invitant la victime à envoyer la chaîne de caractères chiffrée aux auteurs de la menace afin de déchiffrer ses fichiers. La clé privée associée à la clé publique utilisée pour crypter le mot de passe est nécessaire pour décrypter le mot de passe AES. Seul l'opérateur qui a créé le client Thanos doit avoir accès à la clé privée.
That password is either statically included in the binary or dynamically created at runtime. The choice is decided by a builder option to use a static password. The help text for this option reads: “All computers in the same network will be encrypted using the same encryption password.” If a dynamic key is chosen, then before starting the encryption process the Thanos client uses the Windows RNGCryptoServiceProvider to generate a random, 32-byte base64 string that will be used as the AES password. If the Thanos client is configured to use a static password, then the password is stored in the binary itself. This means that if a Thanos client is recovered after encryption has occurred, there is a chance that the victims may be able to recover their files without paying the ransom.
Le client Thanos prend également en charge un mode de chiffrement « rapide » dans lequel seule une partie de chaque fichier est chiffrée. La taille de la partie cryptée est définie lors de la compilation. Lorsque ce mode est activé, le client crypte une quantité de données configurée à partir du fichier, remplace le fichier par le contenu crypté en commençant par le début du fichier, et ajoute une chaîne au début du fichier au format « Thanos-- ». Le code responsable de cela est visible dans la figure 7.

RIPlace
One of the “company” tier features is the ability to change the Thanos client encryption process to use the RIPlace technique. As mentioned earlier, RIPlace is a technique disclosed by security company Nyotron in November 2019 to evade certain anti-ransomware mitigations.
Vous trouverez une description détaillée de cette technique sur le site Web de Nyotron. À un niveau élevé, cette technique décrit un processus permettant de chiffrer un fichier cible en utilisant des liens symboliques via un nom de périphérique MS-DOS afin de copier une version chiffrée du fichier à l'emplacement d'origine.
When enabled in the Thanos builder, generated clients will have an extra class and a modification of the encryption workflow to use the RIPlace technique.

Le flux de travail modifié est relativement simple. La fonction responsable du flux de travail RIPlace est illustrée à la figure 8. Tout d'abord, le client Thanos copie le contenu du fichier cible dans un répertoire temporaire, crypte le contenu du fichier, puis enregistre le contenu crypté dans le fichier du répertoire temporaire. Ensuite, le client exécute le code illustré à la figure 9, où un nom de périphérique MS-DOS est créé avec le chemin d'accès au fichier cible et le nom de périphérique « Resolve ». MoveFileExW est appelé pour déplacer le fichier crypté du répertoire temporaire vers le nouveau périphérique MS-DOS, qui agit comme un pointeur symbolique vers le chemin d'accès du fichier cible. Le résultat final est que le fichier cible est remplacé par la copie cryptée du fichier.

Lateral Movement
La fonctionnalité de déplacement latéral du client Thanos est principalement assurée par l'outil SharpExec, un outil de sécurité offensif spécialement conçu pour les déplacements latéraux. Le client télécharge les outils SharpExec depuis le référentiel GitHub (les URL de téléchargement sont fournies dans la section Détection et atténuation).
First, the Thanos client will scan the local network to get a list of online hosts. Then Thanos uses the PSEXEC-like functionality of the SharpExec, which allows it to execute the Thanos client on remote computers.

Wake on LAN (WoL)
To spread laterally across a victim’s local network, Thanos takes advantage of a hardware feature in some computers known as “Wake on LAN” (WoL) that causes the host to turn on. It does so by sending a WoL “magic packet” of the format described in Appendix D.
To achieve this, the client will first use the Address Resolution Protocol (ARP) to collect a mapping of IP addresses and Media Access Control (MAC) addresses. This information is contained in an ARP table.
With the IP addresses and MAC addresses, the client can create and send the “magic packet” to the remote hosts. The Thanos client will then try to connect to the remote hosts drive using the usernames “Administrator” or “Admin.” If the connection is successful, the remote drive will be added to the list of drives to be encrypted.

La fonctionnalité WoL est similaire à celle observée dans Ryuk.
Data Stealing
Following a common trend in ransomware operations of extorting victims by threatening to publicly distribute sensitive files, the Thanos client integrates the ability to exfiltrate all files with a specified set of extensions. The default extensions to upload are “.docx,” “.pdf,” “.xlsx,” and “.csv,” but these can be changed at build time. The exfiltration is done via an FTP webclient. The default parameters for the FTP URL, username, and password can all be seen in final clients, even after some obfuscation operations. The code that manages this can be seen in Figure 12.

Outlook
Recorded Future a publié un rapport en février 2020 prévoyant un certain nombre de tendances en matière de ransomware pour l'année, notamment :
- The ransomware-as-a-service market will continue to flourish
- There will be a continued separation between the ransomware “haves” and “have-nots”
We believe these predictions are representative of the path forward for Thanos. The RaaS model has been widely successful for other operators as the quickest means of payout outsourcing their operations to threat actors. Insikt Group has observed that Nosophoros titled the original post on Exploit Forum “Thanos Ransomware Affiliate Program.” As previously mentioned, those who choose to purchase or acquire a “light” build of Thanos can opt into the affiliate program, though qualifications of becoming an affiliate are unknown. Others, however, can choose to purchase the full “company” version of Thanos and have the ability to start their own affiliate or RaaS operation. At the time of publication, Insikt Group has observed that Nosophoros has received positive endorsements from the community, with claims that the tool “works flawlessly” and requests to “keep the updates coming.” Thanos is under active development by Nosophoros. Recorded Future assesses with high likelihood that Thanos will continue to be weaponized by threat actors either individually and collectively as part of the affiliate program.
Lastly, with the identification of Hakbit samples as belonging to the Thanos ransomware family, it’s clear that Thanos has been deployed consistently over the past six months. As previously discussed, each new sample observed has incorporated additional features over time, suggesting that Nosophoros is actively developing the ransomware, a trend that is not likely to stop soon.
Note de la rédaction : Cet article est un extrait d'un rapport complet. Pour lire l'analyse complète, click here to download the report as a PDF.