Malware analysis - Sharpil RAT (Infostealer Series)
Background
The Russian-speaking cybercrime underworld has been on the rise for several years now. This multi-million-dollar market attracts hundreds of individuals with varying levels of malware development skills.
As shown by Anna Lvova on gdata.pt this early stage Remote Access Trojan sample with Infostealer capabilities was first reported on April 17, 2024 by Yogesh Londhe on X. It features a limited set of functionalities and virtually no obfuscation. According to Cybersecsentinel, it has been distributed via phishing emails, deceptive Ads and through CVE exploitation.
It seems to be linked to the Sharpil Stealer, which we were unable to analyze due to the sample being unavailable.
Static Analysis
Strings
As a C#/.NET binary, we can try our luck and search for deobfuscated URLs/domains. Grepping for “http”, we immediately find a telegram “bot” URL, an API URL for a minecraft server provider (vimeworld) and multiple IP retrieval APIs.
Imports
On the Import table, besides the http related functions, we also find process enumeration methods, cookie, VPN and social networks related functions, among others.
Code Analysis
On the main function, we can see it is downloading a string from a Telegram bot (C&C), which represents the actual commands being received from the operator.
Commands
Let’s analyze the RAT’s functionalities based on the commands it can receive and process: Browser, System, Return, Exit, Show Command
- Browser
It verifies if multiple browser folders exist on the LocalData or AppData. If they exist, it sends a message to the operator. It is not exfiltrating any file, credential or data from these directories.
- System
Fetches System info (OS version, host name, username, processor id, cpu name, gpu name, mac address, bios caption, and more) plus clipboard data.
That data is written to a file called “Information.txt”, which will be sent to the Telegram C2.
- Return
It resets/restarts the RAT.
- Exit
Terminates the process.
- Show command
It functions as the --help
flag, listing all the commands that the RAT accepts.
Exilftration
Two methods allow the RAT to exfiltrate data.
- SendMessage method’s purpose is to exfiltrate “string” data to the Telegram bot.
- SenderAPI.POST is used when it needs to exfiltrate actual file data.
Indications of Further Feature Development
This particular version is extremely simple and in an early stage. However, as we mentioned earlier, the developer clearly intended to continue its development. This is evident from the presence of the “Counting” class, which references potential future targets such as cookies, passwords, credit cards, bookmarks, Steam cookies, wallets, and many others.
Basic Dynamic Analysis
Observing the network traffic and the process activity, there is the call - multiple calls actually, given it is in a loop - to the Telegram API (https)
IoCs
URLs:
hxxps://api.telegram[.]org/bot7057429288:AAHYl5_27YU1Yjmuj33WKOqLVSgYtq3n-8k/getUpdates
SHA256:
1aae7dcfcb679f01938f1bfff990a87ccaaa9b9bed05ff85d64cdc7e925b83ef