Skip to main content

Cerberus - A new banking Trojan from the underworld

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 a 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:
Twitter 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 the light. Each time a rented malware reaches the end of its life it provides the opportunity for other actors to take over the malware rental market-share.
As visible in the 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.
Rental business evolution
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 a 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:
Cerberus Accessibility request
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());
        }
    }
    catch(Exception e) {
        ...
    }

    Targets

    Some examples of phishing overlays are shown below. They exist in two types: the credentials stealers (first 2 screenshots) and the credit card grabbers (last screenshot).
    Overlay screenshot BNPOverlay screenshot GmailOverlay screenshot Card GP
    The only active target list observed in the wild is available in the appendix and contains a total of 30 unique targets.
    It is interesting to observe that the actual target list contains:
  • 7 French banking apps
  • 7 U.S. banking apps
  • 1 Japanese banking app
  • 15 non-banking apps
  • This uncommon target list might either be the result of specific customer demand or due to some actors having partially reused an existing target list.

    Conclusion

    Although not yet mature enough to provide the equivalent of a full-blown set of Android banking malware features (such as RAT, RAT with ATS (Automated Transaction Script), back-connect proxy, media streaming), or providing an exhaustive target list, Cerberus should not be taken lightly.
    Due to the current absence of maintained and supported Android banking Malware-as-a-Service in the underground community, there is a certain demand for a new service. Cerberus is already capable to fulfill this demand. In addition to the feature base it already possesses and the money that can be made from the rental, it could evolve to compete with the mightiest Android banking Trojans. Next, to the features, we expect the target list to be expanded to contain additional (banking) apps in the near future.
    Knowledge of the threat landscape and implementation of the right detection tools remains crucial to be able to protect yourself from fraud; Cerberus is yet a new Trojan active in the wild!

    Mobile Threat Intelligence

    The right intelligence makes the difference! Be aware of the threat landscape and know your risk exposure using MTI.
    MTI is real-time and relevant indicators to empower operational teams combined with strategic intelligence to have the right overview to plan your next steps.

    Client-Side Detection

    Mitigating the mobile malware threat starts with awareness, but also requires detection and protection to prevent the malware from being successful.
    CSD is the solution to detect the malware on devices, giving you insight into the threat and enabling you to fight it and defeat fraud.

    Comments

    Popular posts from this blog

    10 Best Forum Software For Webmasters

    10 Best Forum Software For Webmasters Do you want to create your online discussion forum or online community where people can discuss about their favorite topics? In this article, you can see 10 best forum software (scripts for setting up discussion forums) that can be used free of cost. Although some scripts are paid but rest of these forum scripts are free to use.You only need to buy hosting space and domain name for your website and after then you can install any of these forum scripts to start your own discussion forums on the internet. Online discussion forums generate huge page views because thousands of people want to join online discussion forums to ask questions or share knowledge. Some of online marketers join forums to discuss about their products with community members. You don't need to acquire any kind of technical skill to run a professional discussion forums because these days, almost all web hosting providers offer one click script installer which h...

    |Bypass Symlink on 2013 Server With Different .htaccess and Methods by Sen Haxor |

    Hi, Guys,  Please a wonderfull tutorial provided bt Sem;\  Today I gonna Explain how to bypass Symlink on 2013 Server With Different .htaccess and Methods. So let's Get Started :) Note: This method is not applicable for Godaddy, Bluehost, Hostgator and Hostmonstor Servers. For This First You Need the Following Files : 1 -> Sen Haxor CGI Shell 2 -> sen.zip 3 -> passwd-bypass.php 4 -> Turbo Brute force Cpanel 5 - > Port.py First Before Starting to symlink we need to create php.ini and ini.php to Disable Safe mode and Disabled Functions on the server . Use the Following Code : Make a php.ini with the following code safe_mode=Off And ini.php with <? echo ini_get("safe_mode"); echo ini_get("open_basedir"); include($_GET["file"]); ini_restore("safe_mode"); ini_restore("open_basedir"); echo ini_get("safe_mode"); echo...

    How to Hack WhatsApp using just a GIF

    A picture is worth a thousand words, but a GIF is worth a thousand pictures. Today, the short looping clips, GIFs are everywhere—on your social media, on your message boards, on your chats, helping users perfectly express their emotions, making people laugh, and reliving a highlight. But what if an innocent-looking GIF greeting with Good morning, Happy Birthday, or Merry Christmas message hacks your smartphone? Well, not a theoretical idea anymore. WhatsApp has recently patched a critical security vulnerability in its app for Android, which remained unpatched for at least 3 months after being discovered, and if exploited, could have allowed remote hackers to compromise Android devices and potentially steal files and chat messages. WhatsApp Remote Code Execution Vulnerability The vulnerability, tracked as  CVE-2019-11932 , is a double-free memory corruption bug that doesn't actually reside in the WhatsApp code itself, but in an open-source GIF image parsing library that What...