A thorough technical analysis of BlackCat ransomware, which has been causing havoc for organizations across the world. ALPHV, also known as BlackCat, is a ransomware family first seen in late 2021 and has been targeting multiple firms across industries.
In recent years, ransomware attacks have become increasingly common, with new strains being discovered all the time. One such strain is BlackCat ransomware, which has been causing havoc for organizations across the world. ALPHV, also known as BlackCat, is a ransomware family first seen in late 2021 and has been targeting multiple firms across industries. The operators of the ransomware are seen employing double extortion techniques, which involve not only encrypting the system but also stealing sensitive files from their victims. Reportedly, another tool is used with the ransomware for stealing data.
BlackCat ransomware is written in Rust and comes in the form of a command-line tool, which can be run with different arguments. It is capable of killing multiple processes and services. One of its key features is its ability to escalate privileges and bypass User Account Control (UAC). This sophisticated malware uses either AES or ChaCha20 encryption (depending on its configuration) to encrypt all the files on a victim's system. Additionally, it has sandbox evasion capabilities, making it hard to analyze the sample. The ransomware requires arguments to run, making it impossible to analyze by a sandbox. In this blog, we'll take a closer look at the characteristics and technicalities of this Rust-written ransomware.
Historical Campaign Overview
It has been witnessed that attackers that use the BlackCat ransomware also reportedly use a .NET stealer tool named ExMatter, developed by the same APT group, in order to download files from the victim machine. This is what makes this attack even more formidable since this gives attackers the leverage to use a technique known as double extortion, which involves the added pressure of leaking stolen files possibly containing sensitive data. (Refer to the Appendixfor a YARA rule that helps with hunting BlackCat.)
Technical Analysis
The BlackCat binary comes in the form of a command-line tool that can be run using different arguments. For example:
By using –verbose, the logs created by BlackCat will be displayed on the console.
The –uioption displays a GUI-like display in the terminal window, showing the progress and information related to the files being encrypted on the system.
Screenshot of the GUI-like displayed shown upon using the UI option
Out of these arguments, only one of them is essential to the execution of the binary, which is the access-token argument.
List of the arguments that can be used while running the binary
Pre-Encryption Operations
As mentioned earlier, the binary will only run if it is supplied with a 32-character long access token. It uses the GetCommandLineW API in order to check whether the access token is correctly supplied.
Using GetCommandLineW to check whether the access token is correctly supplied
Depending on the version of the Ransomware, this token can either be random (like in this sample), or as seen in the latest versions, this access token is a 32-character key used to encrypt the configuration of the Ransomware embedded within the binary. Latest versions do this in order to stop security researchers from extracting the configuration.This also serves as an anti-sandboxing measure, since automated analysis tools will not be able to execute the sample unless they are configured to supply the access token.
Ransom Note
Once the access token is supplied to the binary, the Ransomware proceeds by decrypting the ransom note embedded within the binary and storing it for later use. It also sets the ransom note as the Desktop wallpaper.
Decrypted ransom note stored for later use
After this, the Ransomware prepares itself to escalate privileges by creating a new thread using the CreateThread API.
Privilege Escalation & UAC Bypass
BlackCat ransomware performs a UAC bypass by abusing Microsoft COM (component object model). This attack involves using COM objects of a binary known as Microsoft CMSTP (Connection Manager Profile Installer), particularly the CMSTPLUA interface {3E5FC7F9-9A51-4367-9063-A120244FBEC7}.
The ransomware uses CoGetObject to register itself with the CLSID {3E5FC7F9-9A51-4367-9063-A120244FBEC7}, which is legitimately used to execute applications with elevated privileges. This technique allows it to bypass the UAC prompt and perform its malicious actions without being detected or blocked by the system's security measures.
Using CoGetObject to register itself with {3E5FC7F9-9A51-4367-9063-A120244FBEC7} in order to gain elevated privileges
Once the ransomware elevates privileges, it executes within the newly created thread and carries its arguments forward from its previous instance.
BlackCat executes itself within the new thread with elevated privileges using the same arguments as before
After this, BlackCat uses the LookupPrivilegeValueW API in order to look for local identifiers for a list of privileges. Each of these privileges enables the running process to run system-level operations. (Refer to the Appendix for a complete list and description of each privilege). The binary then uses AdjustTokenPriveleges in order to grant itself those privileges.
List of privileges sought out by BlackCat
Using LookupPrivilegeValueW and AdjustTokenPrivileges in order to grant itself privileges
Finally, BlackCat ends its preparation for encryption by doing the following:
Deleting all volume shadow copies using vssadmin and wmic commads, thus making data recovery much harder.
Disabling Automatic Repair using bcdedit, in order to prevent the recovery of system-related files.
Clearing event logs.
Terminating all active services and processes.
Note: BlackCat has its configuration embedded within itself and decrypts it at runtime. The configuration contains information about the public key to be used in order to encrypt the key, any specific services to terminate, an exception list, etc.
Screenshot displaying the BlackCat configuration
Data Encryption
The sample of BlackCat utilized for this analysis employs AES for encryption. The steps involved in encrypting are as follows:
BlackCat first traverses the system by using a loop of FindFirstFile and FindNextFIle in order to find all the files on the system.
The ransom note is written to each directory using WriteFile.
Screenshot of the ransom note left by BlackCat
Using BCryptGenRandom, the ransomware calculates a random AES key.
A JSON block is created for each file, which contains the AES key that is used to encrypt the file, and information about the file.
JSON block containing information about the key and file
The AES key is further encrypted using the RSA public key stored in the BlackCat configuration.
The file is encrypted using AES, and the contents are written to the file using ReadFile and WriteFile. The new extension of the file is mentioned in the BlackCat configuration.
Using AES to encrypt the file
Post-Encryption Operations
Once BlackCat is done encrypting all files on the system, the Desktop wallpaper is changed, instructing the user to refer to the ransom note.
Changed Desktop background
The .onion URL specified in the ransom note is unique to each victim, as each sample uses a different access token, supplied to the URL as a parameter. The onion URL contains information about the files encrypted/stolen and instructions on how to pay the ransom.
CloudSEK’s TRIAD team created this report based on an analysis of the increasing trend of cryptocurrency counterfeiting, in which tokens impersonate government organizations to provide some legitimacy to their “rug pull” scams. An example of this scam is covered in this report where threat actors have created a counterfeit token named “BRICS”. This token is aimed at exploiting the focus on the BRICS Summit held in Kazan, Russia, and the increased interest in investments and expansion of the BRICS government organization which comprises different countries (Brazil, Russia, India, China, South Africa, Egypt, Ethiopia, Iran, and the United Arab Emirates)
CloudSEK's threat research team has uncovered a ransomware attack disrupting India's banking system, targeting banks and payment providers. Initiated through a misconfigured Jenkins server at Brontoo Technology Solutions, the attack is linked to the RansomEXX group.
Explore the escalating wave of cyber threats on platforms like Google Groups and Usenet, uncovering the pivotal role of cybersecurity in safeguarding online discussion forums.
Join 10,000+ subscribers
Keep up with the latest news about strains of Malware, Phishing Lures, Indicators of Compromise, and Data Leaks.
Take action now
Secure your organisation with our Award winning Products
CloudSEK Platform is a no-code platform that powers our products with predictive threat analytic capabilities.
A thorough technical analysis of BlackCat ransomware, which has been causing havoc for organizations across the world. ALPHV, also known as BlackCat, is a ransomware family first seen in late 2021 and has been targeting multiple firms across industries.
Get the latest industry news, threats and resources.
In recent years, ransomware attacks have become increasingly common, with new strains being discovered all the time. One such strain is BlackCat ransomware, which has been causing havoc for organizations across the world. ALPHV, also known as BlackCat, is a ransomware family first seen in late 2021 and has been targeting multiple firms across industries. The operators of the ransomware are seen employing double extortion techniques, which involve not only encrypting the system but also stealing sensitive files from their victims. Reportedly, another tool is used with the ransomware for stealing data.
BlackCat ransomware is written in Rust and comes in the form of a command-line tool, which can be run with different arguments. It is capable of killing multiple processes and services. One of its key features is its ability to escalate privileges and bypass User Account Control (UAC). This sophisticated malware uses either AES or ChaCha20 encryption (depending on its configuration) to encrypt all the files on a victim's system. Additionally, it has sandbox evasion capabilities, making it hard to analyze the sample. The ransomware requires arguments to run, making it impossible to analyze by a sandbox. In this blog, we'll take a closer look at the characteristics and technicalities of this Rust-written ransomware.
Historical Campaign Overview
It has been witnessed that attackers that use the BlackCat ransomware also reportedly use a .NET stealer tool named ExMatter, developed by the same APT group, in order to download files from the victim machine. This is what makes this attack even more formidable since this gives attackers the leverage to use a technique known as double extortion, which involves the added pressure of leaking stolen files possibly containing sensitive data. (Refer to the Appendixfor a YARA rule that helps with hunting BlackCat.)
Technical Analysis
The BlackCat binary comes in the form of a command-line tool that can be run using different arguments. For example:
By using –verbose, the logs created by BlackCat will be displayed on the console.
The –uioption displays a GUI-like display in the terminal window, showing the progress and information related to the files being encrypted on the system.
Screenshot of the GUI-like displayed shown upon using the UI option
Out of these arguments, only one of them is essential to the execution of the binary, which is the access-token argument.
List of the arguments that can be used while running the binary
Pre-Encryption Operations
As mentioned earlier, the binary will only run if it is supplied with a 32-character long access token. It uses the GetCommandLineW API in order to check whether the access token is correctly supplied.
Using GetCommandLineW to check whether the access token is correctly supplied
Depending on the version of the Ransomware, this token can either be random (like in this sample), or as seen in the latest versions, this access token is a 32-character key used to encrypt the configuration of the Ransomware embedded within the binary. Latest versions do this in order to stop security researchers from extracting the configuration.This also serves as an anti-sandboxing measure, since automated analysis tools will not be able to execute the sample unless they are configured to supply the access token.
Ransom Note
Once the access token is supplied to the binary, the Ransomware proceeds by decrypting the ransom note embedded within the binary and storing it for later use. It also sets the ransom note as the Desktop wallpaper.
Decrypted ransom note stored for later use
After this, the Ransomware prepares itself to escalate privileges by creating a new thread using the CreateThread API.
Privilege Escalation & UAC Bypass
BlackCat ransomware performs a UAC bypass by abusing Microsoft COM (component object model). This attack involves using COM objects of a binary known as Microsoft CMSTP (Connection Manager Profile Installer), particularly the CMSTPLUA interface {3E5FC7F9-9A51-4367-9063-A120244FBEC7}.
The ransomware uses CoGetObject to register itself with the CLSID {3E5FC7F9-9A51-4367-9063-A120244FBEC7}, which is legitimately used to execute applications with elevated privileges. This technique allows it to bypass the UAC prompt and perform its malicious actions without being detected or blocked by the system's security measures.
Using CoGetObject to register itself with {3E5FC7F9-9A51-4367-9063-A120244FBEC7} in order to gain elevated privileges
Once the ransomware elevates privileges, it executes within the newly created thread and carries its arguments forward from its previous instance.
BlackCat executes itself within the new thread with elevated privileges using the same arguments as before
After this, BlackCat uses the LookupPrivilegeValueW API in order to look for local identifiers for a list of privileges. Each of these privileges enables the running process to run system-level operations. (Refer to the Appendix for a complete list and description of each privilege). The binary then uses AdjustTokenPriveleges in order to grant itself those privileges.
List of privileges sought out by BlackCat
Using LookupPrivilegeValueW and AdjustTokenPrivileges in order to grant itself privileges
Finally, BlackCat ends its preparation for encryption by doing the following:
Deleting all volume shadow copies using vssadmin and wmic commads, thus making data recovery much harder.
Disabling Automatic Repair using bcdedit, in order to prevent the recovery of system-related files.
Clearing event logs.
Terminating all active services and processes.
Note: BlackCat has its configuration embedded within itself and decrypts it at runtime. The configuration contains information about the public key to be used in order to encrypt the key, any specific services to terminate, an exception list, etc.
Screenshot displaying the BlackCat configuration
Data Encryption
The sample of BlackCat utilized for this analysis employs AES for encryption. The steps involved in encrypting are as follows:
BlackCat first traverses the system by using a loop of FindFirstFile and FindNextFIle in order to find all the files on the system.
The ransom note is written to each directory using WriteFile.
Screenshot of the ransom note left by BlackCat
Using BCryptGenRandom, the ransomware calculates a random AES key.
A JSON block is created for each file, which contains the AES key that is used to encrypt the file, and information about the file.
JSON block containing information about the key and file
The AES key is further encrypted using the RSA public key stored in the BlackCat configuration.
The file is encrypted using AES, and the contents are written to the file using ReadFile and WriteFile. The new extension of the file is mentioned in the BlackCat configuration.
Using AES to encrypt the file
Post-Encryption Operations
Once BlackCat is done encrypting all files on the system, the Desktop wallpaper is changed, instructing the user to refer to the ransom note.
Changed Desktop background
The .onion URL specified in the ransom note is unique to each victim, as each sample uses a different access token, supplied to the URL as a parameter. The onion URL contains information about the files encrypted/stolen and instructions on how to pay the ransom.