Open-Source Stealer Widely Abused by Threat Actors
The threat of InfoStealers is widespread and has been frequently employed by various Threat Actors (TA)s to launch attacks and make financial gains. Until now, the primary use of stealers by TAs has been to sell logs or to gain initial entry into a corporate network.
Recently, however, TAs have started exploiting this type of malware to disseminate crypto scams through YouTube channels. TAs successfully hacked a YouTube channel that had over 10 million subscribers and removed the original content of the channel, replacing it with two videos promoting cryptocurrency scams. According to reports, the TAs gained access to the YouTube account by stealing session cookies. It is believed that stealer malware might have been involved in the attack.
Recently Cyble Research and Intelligence Labs (CRIL) discovered a phishing site mimicking a Cryptocurrency mining platform that was spreading Creal Stealer.
The figure below shows the phishing site.
This site was hosting the stealer payload on Dropbox at hxxps[:]//www[.]dropbox[.]com/s/dl/x4vgcaac6hcdgla/kryptex-setup-4.25.7[.]zip.
The stealer binary (SHA 256: f3197e998822bc45cb9f42c8b153c59573aad409da01ac139b7edd8877600511) is compiled using PyInstaller indicating that the stealer is coded in Python.
After extracting the contents of the PyInstaller compiled file, we spotted a PYC file dubbed ‘Creal’.
The figure below shows the extracted files.
Further investigation revealed that this stealer’s source code and builder were also available on a GitHub repository.
The figure below shows the Creal Stealer GitHub repository.
We have also observed nearly 50 samples in the wild, indicating that the TAs were actively utilizing the Open-Source code to infect unsuspecting users.
During the initial execution, the stealer identifies whether it is being run in a controlled environment. It checks if the victim’s username (obtained via the getpass.getuser() function) is present in a list called ‘blacklistUsers’.
The table below contains the blacklisted usernames. If a username is found in this list, then the stealer will immediately terminate its execution using the os._exit(0) function.
The table below contains the blacklisted usernames.
After this, the stealer defines a list named “blacklistUsername” and then gets the hostname of the victim’s machine using the socket.gethostname() method. The script proceeds to verify if the obtained hostname matches any of the names in the “blacklistUsername” list.
If a match is discovered, the script promptly terminates itself by executing the os._exit(0) function.
The table below shows the hardcoded blacklisted hostnames present in the stealer binary.
Now the stealer checks if the MAC address of the victim’s machine is present in the blacklist of MAC addresses defined in a list named BLACKLIST1. It initially retrieves the machine’s MAC address using the getnode() function from the uuid module and then checks whether the victim’s MAC address is present in BLACKLIST1.
If it is present, the os._exit(0) function is called, which immediately exits the stealer.
The table below contains the MAC addresses present in BLACKLIST1.
Afterward, the stealer checks if the victim’s public IP address is present in a blacklist called “sblacklist”. It first uses the subprocess module to run a curl command to retrieve the device’s public IP address. It then checks if this IP address is present in the blacklist. The stealer exits the program if the IP is found in the blacklist.
The table below contains the IP addresses in “sblacklist”.
Now, the stealer checks if certain Python modules are installed, and if they are not, it attempts to install them using pip. The modules to be checked and installed are defined in a nested list named “requirements”.
This list contains two strings: the name of the module to be checked and the name of the package that provides the module. Then it loops through each item in the requirements list and tries to import the module using the __import__ function.
If the import fails (which means the module is not installed), the code launches a subprocess to install the package using pip by running the command executable -m pip install <package_name>.
After launching the subprocess to install the package, the code sleeps for 3 seconds before moving on to the next item in the requirements list. The purpose of this sleep period is to give the pip enough time to complete the installation before moving on to the next package.
The stealer achieves persistence by copying itself to
AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\ directory using the shutil.copyfileobj() function.
The figure below shows the persistence technique used in this stealer.
The stealer defines and assigns values to global variables such as keyword, cookiWords, paswWords, CookiCount, P4sswCount, WalletsZip, GamingZip, and OtherZip.
The keyword variable contains certain names and their respective domain names that the stealer targets. Now, the stealer retrieves login credentials and cookies from the browsers based on the list of names mentioned in the table below.
Now, the stealer creates multiple threads using the threading module in Python and initiates the data-stealing functionality in parallel.
As shown in the figure below, the malware iterates through a list of application paths, starts a thread for each path it encounters, and executes a specific function responsible for stealing data from the victim’s machine.
This stealer targets Chromium-based browsers, chat and gaming applications, cold crypto wallets, and browser extensions.
The figure below shows the applications targeted by Creal Stealer.
Creal stealer makes a GET request to hxxps[:]//api.ipify.org/ to identify the victim’s IP. Now it appends the IP address to hxxps[:]//geolocation-db.com/jsonp/ and makes a GET request to fetch the victim’s geolocation details.
As shown in the figure below, these geolocation details are added to the variables and will be later sent to the TA’s Discord channel.
To store the stolen data, including cookies and passwords, this stealer employs a commonly used function called wr1tef0rf1l3 that writes the information into files for exfiltration. The wr1tef0rf1l3 function requires two arguments, “data” and “name”.
The “data” argument holds the stolen data that is to be saved, while the “name” argument specifies the desired filename. These files are saved in the %temp% directory, and the file names are prefixed with the string “cr”, as shown below.
Creal Stealer is capable of exfiltrating data using Discord Webhooks and multiple file-hosting & sharing platforms such as Anonfiles and Gofile. Prior to exfiltration, this stealer removes the file extensions of .txt files containing the stolen data and compresses these files using the zip file module.
The figure below shows Creal stealer’s file upload code.
Finally, Creal Stealer makes a POST request using the urlopen() function to exfiltrate data using a Discord webhook. This stealer uses a dictionary object containing HTTP request headers, as shown in the figure below.
The figure below shows the data exfiltration using Discord webhooks.
Creal Stealer’s builder and source code are available on GitHub, which enables TAs to modify the code to suit their requirements. This can result in the emergence of various stealers from Creal Stealer’s source code, posing a significant threat to users. The trend of using open-source code in malware is increasing among cybercriminals, since it allows them to create sophisticated and customized attacks with minimal expenses.
- Avoid downloading applications from unknown sources.
- Use a reputed anti-virus and internet security software package on your connected devices, including PC, laptop, and mobile.
- Use strong passwords and enforce multi-factor authentication wherever possible.
- Update your passwords periodically.
- Refrain from opening untrusted links and email attachments without first verifying their authenticity.
- Block URLs that could be used to spread the malware, e.g., Torrent/Warez.
- Monitor the beacon on the network level to block data exfiltration by malware or TAs.
- Enable Data Loss Prevention (DLP) Solutions on employees’ systems.
MITRE ATT&CK® Techniques
|Tactic||Technique ID||Technique Name|
|Persistence||T1547.001||Boot or Logon Autostart Execution: Registry Run Keys / Startup Folder|
|Credential Access||T1555 |
|Credentials from Password Stores |
Steal Web Session Cookie
Steal Application Access Token
|Account Discovery |
System Time Discovery
System Service Discovery
System Location Discovery
|Command and Control||T1071 |
|Application Layer Protocol |
|Exfiltration||T1041||Exfiltration Over C&C Channel|
Indicators of Compromise (IoCs):
|Malicious Zip Archive|