Summary
Ousaban (a.k.a. Javali) is a banking malware that emerged between 2017 and 2018, with the primary goal of stealing sensitive data from financial institutions in Brazil. This malware is developed in Delphi and it comes from a stream of LATAM banking trojans sourced from Brazil, sharing similarities with other families like Guildma, Casbaneiro, and Grandoreiro. Furthermore, the threat often abuses cloud services, such as Amazon S3 to download second stage payloads, and Google Docs to retrieve the C2 configuration.
Netskope Threat Labs came across recent Ousaban samples that are abusing multiple cloud services throughout the attack flow, such as Amazon or Azure to download its payloads and log the victim’s IP, and Pastebin to retrieve the C2 configuration. The malware is downloaded through MSI files either by a JavaScript or a Delphi DLL, and is targeting more than 50 financial institutions in Brazil. Furthermore, we also found Telegram abuse in the malware code, likely used for C2 communication via Webhooks.
In this blog post, we will analyze Ousaban, showing its delivery methods, obfuscation techniques, and C2 communication.
Delivery methods
Ousaban is delivered through malicious MSI files spread in phishing emails. In this campaign, we found that the MSI file downloads and executes the second stage either through JavaScript or a PE file.
Delivery by JavaScript
In the first scenario, the JavaScript is executed via CustomAction.
The JavaScript code is obfuscated, likely in an attempt to slow down analysis.
Looking at the deobfuscated code, these are the steps executed by the malware:
- Creates an empty file to be used as a flag in case the MSI is executed twice (similar concept as Mutex usage);
- Downloads the second stage from the cloud, either from Amazon or Azure;
- Decompress the ZIP file downloaded from the cloud and renames the main executable;
- Sends a simple GET request to another URL (Azure or another attacker-controlled server), alerting the attacker and logging the victim’s IP;
- Executes the main file via WMIC.
Delivery by File
We also found Ousaban being delivered without JavaScript. In this case, we can see a file named “avisoProtesto.exe” being executed via MSI CustomAction.