#1271712: Cerberus - A new banking Trojan from the underworld

Description: Intro
In June 2019, ThreatFabric analysts found a new Android malware, dubbed "Cerberus", being rented out on underground forums. Its authors claim that it was used for private operations for two years preceding the start of the rental. They also state that the code is written from scratch and is not using parts of other existing banking Trojans unlike many other Trojans that are either based completely on the source of another Trojan (such as the leaked Anubis source code that is now being resold) or at least borrow parts of other Trojans. After thorough analysis we can confirm that Cerberus was indeed not based on the Anubis source code.

One peculiar thing about the actor group behind this banking malware is that they have an "official" twitter account that they use to post promotional content (even videos) about the malware. Oddly enough they also use it to make fun of the AV community, sharing detection screenshots from VirusTotal (thus leaking IoC) and even engaging in discussions with malware researchers directly.

The following screenshot shows tweets from their advertisement campaign:

That unusual behavior could be explained by the combination of the need for attention and a probable lack of experience.

What is sure is that the gap in the Android banking malware rental business left open after the rental of the Anubis 2 and RedAlert 2 Trojans ended provides a good opportunity for the actors behind Cerberus to grow their business quickly.

The Android banking Trojan rental business
Rental of banking Trojans is not new. It was an existing business model when computer-based banking malware was the only form of banking malware and has shifted to the Android equivalent a few years later.

The life span of Android banking malware is limited to either the will of its author(s) to support it or the arrest of those actors. This malware-life-cycle has been observed to reoccur every few years, bringing new malware families into light. Each time a rented malware reaches the end of its life it provides the opportunity for other actors a to take over the malware rental market-share.

As visible on following chart, the lifespan of many well-known rented Android bankers is usually no more than one or two years. When the family ceases to exist a new one is already available to fill the void, proving that the demand for such malware is always present and that therefore Cerberus has a good chance to survive.

After the actor behind RedAlert 2 decided to quit the rental business, we observed a surge in Anubis samples in the wild. After the Anubis actor was allegedly arrested and the source code was leaked there was also huge increase in the number of Anubis samples found in the wild, but the new actors using Anubis have no support or updates.

Due to this Cerberus will come in handy for actors that want to focus on performing fraud without having to develop and maintain a botnet and C2 infrastructure.

Analysis of evasion techniques
Along with the standard payload and string obfuscation, Cerberus uses a rather interesting technique to prevent analysis of the Trojan.

Using the device accelerometer sensor it implements a simple pedometer that is used to measure movements of the victim. The idea is simple - if the infected device belongs to a real person, sooner or later this person will move around, increasing the step counter. The Trojan uses this counter to activate the bot - if aforementioned step counter hits the pre-configured threshold it considers running on the device to be safe. This simple measure prevents the Trojan from running and being analyzed in dynamic analysis environments (sandboxes) and on the test devices of malware analysts.

The code responsible for this verification is shown in the following snippet:

...
this.sensorService.registerListener(this, this.accelerometer, 3);
Sensor localSensor = sensorEvent.sensor;
this.sensorService.registerListener(this, localSensor, 3);
if(localSensor.getType() == 1) {
float[] values = sensorEvent.values;
float Gx = values[0];
float Gy = values[1];
float Gz = values[2];
long timestamp = System.curTimeMillis();
if(timestamp - this.previousTimestamp > 100L) {
long interval = timestamp - this.previousTimestamp;
this.previousTimestamp = timestamp;
if(Math.abs(Gx + Gy + Gz - this.curGx - this.curGy - this.curGz)
/ (((float)interval)) * 10000f > 600f) {
this.increaseStepCount();
}

this.curGx = Gx;
this.curGy = Gy;
this.curGz = Gz;
}
}
...
if(Integer.parseInt(
this.utils.readConfigString(arg7, this.constants.step)) < this.constants.limit) {
goto skip;
}
How it works
When the malware is first started on the device it will begin by hiding its icon from the application drawer. Then it will ask for the accessibility service privilege as visible in the following screenshot:

After the user grants the requested privilege, Cerberus starts to abuse it by granting itself additional permissions, such as permissions needed to send messages and make calls, without requiring any user interaction. It also disables Play Protect (Google's preinstalled antivirus solution) to prevent its discovery and deletion in the future. After conveniently granting itself additional privileges and securing its persistence on the device, Cerberus registers the infected device in the botnet and waits for commands from the C2 server while also being ready to perform overlay attacks.

The commands supported by the analyzed version of the Cerberus bot are listed below. As can be seen, the possibilities offered by the bot are pretty common.

Command

Description

push

Shows a push notification. Clicking on the notification will result in launching a specified app

startApp

Starts the specified application

getInstallApps

Gets the list of installed applications on the infected device

getContacts

Gets the contact names and phone numbers from the address book on the infected device

deleteApplication

Triggers the deletion of the specified application

forwardCall

Enables call forwarding to the specified number

sendSms

Sends a text message with specified text from the infected device to the specified phone number

startInject

Triggers the overlay attack against the specified application

startUssd

Calls the specified USSD code

openUrl

Opens the specified URL in the WebView

getSMS

Gets all text messages from the infected device

killMe

Triggers the kill switch for the bot

updateModule

Updates the payload module

Cerberus features
Cerberus malware has the same capabilities as most other Android banking Trojans such as the use of overlay attacks, SMS control and contact list harvesting. The Trojan can also leverage keylogging to broaden the attack scope. Overall, Cerberus has a pretty common feature list and although the malware seems to have been written from scratch there does not seem to be any innovative functionality at this time. For example, some of the more advanced banking Trojans now offer features such as a back-connect proxy, screen-streaming and even remote control.

Cerberus embeds the following set of features that allows itself to remain under the radar and successfully perform attacks:

Overlaying: Dynamic (Local injects obtained from C2)
Keylogging
SMS harvesting: SMS listing
SMS harvesting: SMS forwarding
Device info collection
Contact list collection
Application listing
Location collection
Overlaying: Targets list update
SMS: Sending
Calls: USSD request making
Calls: Call forwarding
Remote actions: App installing
Remote actions: App starting
Remote actions: App removal
Remote actions: Showing arbitrary web pages
Remote actions: Screen-locking
Notifications: Push notifications
C2 Resilience: Auxiliary C2 list
Self-protection: Hiding the App icon
Self-protection: Preventing removal
Self-protection: Emulation-detection
Architecture: Modular
Overlay attack
Most Android banking Trojans use overlay attacks to trick the victim into providing their personal information (such as but not limited to: credit card information, banking credentials, mail credentials) and Cerberus is no exception. In this particular case, the bot abuses the accessibility service privilege to obtain the package name of the foreground application and determine whether or not to show a phishing overlay window, as shown in the following code snippet:

this.foregroundAppPackage = accesibilityEvent.getPackageName().toString();

...

String target = this.strings.empty;
if(this.strings.CC_apps.contains(this.foregroundAppPackage)) {
target = this.strings.grabbCC;
}
else if(this.strings.MAIL_apps.contains(this.foregroundAppPackage)) {
target = this.strings.grabMails;
}

try {
Utils utils = this.utils;
String v1_10 = target.isEmpty() ? this.foregroundAppPackage : target;
if(utils.readConfigString(this, v1_10).length() > 10) {
JSONObject config = new JSONObject();
config.put(this.strings.params, this.strings.startViewInject);
config.put(this.strings.packageAppStart, this.foregroundAppPackage);
config.put(this.strings.nameInject, target);
config.put(this.strings.packageProject, this.getPackageName());
config.put(this.strings.packageView, InjectActivity.class.getCanonicalName(););
Utils utils1 = this.utils;
utils1.callModule(this, config.toString());

Read rest in the link
More info: https://www.threatfabric.com/blogs/cerberus-a-new-banking-trojan-from-the-underworld.html

Date added Aug. 14, 2019, 11:17 a.m.
Source Threat Fabric
Subjects
  • All New Malware or Attack Alerts - New Reports / IOCs in
  • Android Malware - New Reports in
  • Banking Malware - New Reports in
  • Cerberus Android Banking Malware - For Rent -