Predecitive malware analysis Around May 2020 ThreatFabric analysts have uncovered a new strain of banking malware dubbed BlackRock that looked pretty familiar. After investigation, it became clear that this newcomer is derived from the code of the Xerxes banking malware, which itself is a strain of the LokiBot Android banking Trojan. The source code of the Xerxes malware was made public by its author around May 2019, which means that it is accessible to any threat actor.
When source code of malware is leaked or made publicly accessible it is pretty common to see the threat landscape being supplemented with new malware variants or families based on the said code. We have observed similar events in the past, as for example the infamous Bankbot Trojan code made available by its author, leading to new Trojans like CometBot, Razdel and Anubis. When Anubis itself was leaked the actor(s) behind the Ginp Trojan reused small portions of its code.
However, when Xerxes' source code was leaked, no new malware based on, or using portions of, such code was observed. BlackRock seems to be the only Android banking Trojan based on the source code of the Trojan at the moment.
Although LokiBot has been considered dead and inactive for a while, we have observed attempts from some actors to get the Trojan working several times in the last years. Looking at the number of samples built for each of those campaigns and the duration of those, the actors didn't seem to have been very successful. Therefore, we believe that those campaigns were probably driven by new actors trying out the publicly available source code. BlackRock campaigns - on the other hand - are not alike, not only did the Trojan undergo changes in its code, but also comes with an increased target list (containing many non-financial apps) and have been ongoing for a longer period.
Technical aspects aside, one of the interesting differentiators of BlackRock is its target list; it contains an important number of social, networking, communication and dating applications. So far, many of those applications haven't been observed in target lists for other existing banking Trojans. It therefore seems that the actors behind BlackRock are trying to abuse the grow in online socializing that increased rapidly in the last months due to the pandemic situation.
The LokiBot malware family As BlackRock is based on the Xerxes banking Trojan, it is part of the LokiBot descendance which has several variants, as shown hereafter.
LokiBot itself was first observed between end 2016 and beginning 2017 as rented malware. Sometime after the author of the Trojan got banned from underground forums, the source code of the Trojan was leaked. During first half of 2018 MysteryBot was observed to be active. Although it was based on LokiBot it contained upgrades in order to work properly on newer Android versions and used new techniques to steal personal information. In the second half of 2018, Parasite appeared on the threat landscape as direct successor of MysteryBot. It was enhanced with accessibility features and some automated scripts (such as PayPal automated transfer scripts). In May 2019 the Xerxes Trojan first appeared, it was based on Parasite and after some unsuccessful attempts in offering the Trojan in underground forums, the actor made it publicly available. After being used by several actors, it faded away from the threat landscape. In May 2020 BlackRock was first spotted.
LokiBot malware family How it works When the malware is first launched on the device, it will start by hiding its icon from the app drawer, making it invisible to the end-user. As second step it asks the victim for the Accessibility Service privileges. As visible in following screenshot, the Trojan's largest campaigns are posing as fake Google updates:
Enable accesibilityEnable accesibility Once the user grants the requested Accessibility Service privilege, BlackRock starts by granting itself additional permissions. Those additional permissions are required for the bot to fully function without having to interact any further with the victim. When done, the bot is functional and ready to receive commands from the C2 server and perform the overlay attacks.
The commands supported by the actual version of the bot are listed below. It gives a good overview of what the actor(s) can do on the infected device.
Command Description Send_SMS Sends an SMS Flood_SMS Sends an SMS to a specific number every 5 seconds Download_SMS Sends a copy of SMS messages to C2 Spam_on_contacts Sends an SMS to each of the contacts present on the infected device Change_SMS_Manager Set malware as default SMS manager (command is repeated every 30 seconds until action is achieved) Run_App Starts a specific app on the bot StartKeyLogs Logs text content shown on the screen from targets and sends it to the C2 StopKeyLogs Stops logging the accessibility events from targets StartPush Send a copy of all notifications content to the C2 StopPush Stops sending a copy of all notifications content to the C2 Hide_Screen_Lock Keeps the device on the HOME screen Unlock_Hide_Screen Unlocks the device from the HOME screen Admin Makes the both request admin privileges Profile Adds a managed admin profile for the malware on the device Start_clean_Push Dismisses (hiding) all push notifications Stop_clean_Push Stops dismissing push notifications Features BlackRock offers a quite common set of capabilities compared to average Android banking Trojans. It can perform the infamous overlay attacks, send, spam and steal SMS messages, lock the victim in the launcher activity (HOME screen of the device), steal and hide notifications, deflect usage of Antivirus software on the device and act as a keylogger. Interestingly, the Xerxes Trojan itself offers more features, but it seems that actors have removed some of them in order to only keep those that they consider useful to steal personal information.
The keylogger logs the text content from apps shown on the screen and will do so for applications included in the targets lists only.
The Trojan will redirect the victim to the HOME screen of the device if the victims tries to start or use antivirus software as per a specific list including Avast, AVG, BitDefender, Eset, Symantec, TrendMicro, Kaspersky, McAfee, Avira, and even applications to clean Android devices, such as TotalCommander, SD Maid or Superb Cleaner. By doing so, the Trojan tries to avoid letting the victim remove it from the device and establish some form of persistency.
BlackRock embeds following set of features, allowing it to remain under the radar and successfully harvest personal information:
Overlaying: Dynamic (Local injects obtained from C2) Keylogging SMS harvesting: SMS listing SMS harvesting: SMS forwarding Device info collection SMS: Sending Remote actions: Screen-locking Self-protection: Hiding the App icon Self-protection: Preventing removal Notifications collection Grant permissions AV detection Profiling One functionality that is so far unique to BlackRock is that it makes usage of the Android work profiles. This Android feature is usually used by companies to define a device policy controller (DPC) in order to control and apply policies on their mobile fleet. It allows to control various aspects of a device without per se having complete administration rights on all aspects of the device.
BlackRock abuses this feature to gain admin privileges. It simply creates and attributes itself a profile which has the admin privileges.
The following code snippet show how the profile is created:
private void createProfile() {
try {
Intent intent = new Intent("android.app.action.PROVISION_MANAGED_PROFILE");
if(Build.VERSION.SDK_INT < 23) {
intent.putExtra("android.app.extra.", this.getApplicationContext().getPackageName());
}
else {
intent.putExtra("android.app.extra.PROVISIONING_DEVICE_ADMIN_COMPONENT_NAME", new ComponentName(this, Admins.class.getName()));
}
if(intent.resolveActivity(this.getPackageManager()) != null) {
this.startActivityForResult(intent, 101);
return;
}
}
catch(Exception e) {
e.printStackTrace();
return;
}
}
BlackRock abuses the Accessibility Service to check which application runs in the foreground. Like the Ginp Android banking Trojan, BlackRock has two types of overlay screens, one is a generic card grabber view and the other is specific per targeted app - credential phishing overlay. Both target lists can be found in the appendix of this blog.
The following code snippet shows how the overlay WebView is created:
protected void onStart() {
super.onStart();
SharedPreferences.Editor editor = PreferenceManager.getDefaultSharedPreferences(this).edit();
editor.putBoolean("injActive", true);
editor.commit();
String packageName = this.getIntent().getStringExtra("str");
String injURL = this.getFilesDir().getAbsolutePath() + File.separator;
try {
this.webView = new WebView(this);
this.webView.getSettings().setJavaScriptEnabled(true);
this.webView.setScrollBarStyle(0);
this.webView.setWebChromeClient(new WebChromeClient());
this.webView.addJavascriptInterface(new JSInterface(this, packageName), "Android");
this.webView.setWebViewClient(new Inject.a(this));
this.webView.loadUrl("file:///" + injURL + packageName + "/index.html");
this.setContentView(this.webView);
this.webView.setWebViewClient(new Inject.b(this, packageName));
}
catch(Exception e) {
e.printStackTrace();
}
}
As shown in the previous code snippet, the URL of the overlay points to local files rather than a web location. This is a feature that is inherited from Xerxes, which downloads an archive with all the targets overlays files on the infected device. BlackRock does it somehow differently by downloading a separate archive for each targeted app installed on the device.
Following screenshots show some of the credential phishing overlays:
Westpac overlayN26 overlayRBS overlay Following screenshot shows the generic card grabber overlay:
Interestingly, of the 337 unique applications in BlackRock's target lists, many applications haven't been observed to be targeted by banking malware before. Those "new" targets are mostly not related to financial institutions and are overlayed in order to steal credit card details. As shown in the following chart, most of the non-financial apps are Social, Communication, Lifestyle and Dating apps. Most of the trending social and dating apps are included, the actors' choice might have been driven by the pandemic situation, pushing people to socialized more online. It also seems that actors have made a particular effort on including dating apps, which wasn't something common in targets list so far.
Credit card targets per category When it comes to the targets of the credential-stealing overlays, the majority of the most targeted apps are related to banks operating in Europe, followed by Australia, the United States of America and Canada. But financial apps are not the only ones included in the list; shopping, communication and business apps seem to have a certain interest for the actors. Among others, we found some applications related to German online car selling services, Polish online shopping sites and well-known email services. The following chart shows the ratio of targeted apps per app category.
Credentials targets per category As visible in following chart, the BlackRock Trojan's target list includes applications operating in a variety of different countries. The chart shows the number of occurrences of financial apps per countries of operation for all BlackRock samples observed so far.
Conclusion Although we've observed a steady increase in the number of new banking Trojans since 2014, 2020 shows an interesting increase again after a quite calm 2019. As stated in our blog 2020 - Year of the RAT not only are there more new Android banking Trojans, but some of them also bring innovative new features. Most of them start embedding features, allowing the criminals to take remote control of the infected device (RAT) and sometimes even to automatically perform the fraud from the infected device (ATS). In the case of BlackRock, the features are not very innovative but the target list has a large international coverage and it contains quite a lot of new targets which haven't been seen being targeted before.
Although BlackRock poses a new Trojan with an exhaustive target list, looking at previous unsuccessful attempts of actors to revive LokiBot through new variants, we can't yet predict how long BlackRock will be active on the threat landscape. What can be considered as true is that the number of new banking Trojans will continue to grow, bringing new functionalities to increase the success rate of fraud while fraud becomes a growing risk even for consumers not using mobile banking - as we can see with BlackRock targeting 3rd party apps.
The second half of 2020 will come with its surprises, after Alien, Eventbot and BlackRock we can expect that financially motivated threat actors will build new banking Trojans and continue improving the existing ones. With the changes that we expect to be made to mobile banking Trojans, the line between banking malware and spyware becomes thinner, banking malware will pose a threat for more organizations and their infrastructure, an organic change that we observed on windows banking malware years ago.
The most important aspect to take care of is securing the online banking channels, making fraud hard to perform, therefore discouraging criminals to make more malware.
Our threat intelligence solution – MTI, provides the context and in-depth knowledge of the past and present malware-powered threats in order to understand the future of the threat landscape. Such intelligence, includes both the strategic overview on trends and the operational indicators to discern early signals of upcoming threats and build a future-proof security strategy.
Our online fraud detection solution – CSD, presents financial institutions with the real-time overview on the risk status of their online channels and related devices. This overview provides all the relevant information and context to act upon threats before they turn into fraud. The connectivity with existing risk or fraud engines allows for automated and orchestrated, round the clock fraud mitigation.