Exploring Android Malware

[Español] Sin duda el carácter open source de Android lo ha convertido en el terreno favorito de los atacantes entre todas las plataformas móviles. Hoy en día existe una buena cantidad de exploits y troyanos los cuales estudiaremos en este artículo.

[English] No doubt the open source character of Android has become the favorite target of attackers across all mobile platforms. Nowadays there are plenty of exploits and trojans which we will learn in this article.

Hemos analizado nueve conocidos troyanos para Android, que son:

  1. ADRD
  2. Basebridge
  3. DroidDream
  4. DroidKungFu
  5. Geinimi
  6.  jSMSHider
  7. Plankton
  8. TrojanSMS
  9.  Crusewind

We have analyzed nine trojans known to Android, which are:

  1. ADRD
  2. Basebridge
  3. DroidDream
  4. DroidKungFu
  5. Geinimi
  6.  jSMSHider
  7. Plankton
  8. TrojanSMS
  9. Crusewind

Para este ejercicio de análisis simplemente hemos estudiado los permisos que la aplicación solicita y hemos visualizado su código con el fin de entender la complejidad del troyano.
Nota: algunos troyanos contienen código real de una aplicación, por eso la visualización puede parecer más compleja de lo que realmente es.

For this analysis we have only studied the permissions that the application requests and we have visualized its code in order to understand the complexity of the trojan.
Note: some trojans contain real application code so the display may seem more complex than it really is.

ADRD

El ADRD es un troyano de complejidad media descubierto en febrero de 2011 que roba información del teléfono (IMEI, wifi, hardware, etc.). Esta información es cifrada mediante DES y enviada a una serie de páginas web.

The ADRD is a trojan with a moderate complexity uncovered in February 2011 that steals information from the phone (IMEI, Wi-Fi, hardware, etc.). This information is encrypted using DES and sent to a series of web pages.

Otras características de este troyano son que puede recibir parámetros de búsqueda que luego utiliza en Baidu.com, el conocido buscador chino, para aumentar las visitas (ranking) a una determinada página web. También puede recibir actualizaciones del propio troyano que instala silenciosamente en el teléfono. 

Other characteristics of this Trojan are that it can receive search parameters to use in a well-known Chinese search engine, Baidu.com, to increase the (ranking) visits of a particular web page. It can also receive updates of the Trojan to install silently on the phone.

En la Fig. 1 podremos encontrar los permisos que este troyano requiere para su funcionamiento. Algunos de estos permisos son un poco sospechosos, como la necesidad de  leer contactos (READ_CONTACTS), recibir mensajes del sistema (RECEIVE_BOOT_COMPLETED) o modificar parámetros del teléfono (MODIFY_PHONE_STATE) aunque ninguno de estos permisos tiene un riesgo elevado por lo que lo hace más efectivo para pasar desapercibido.

In figure 1 we can see the permissions this trojan requires for its operations. Some of these permissions are somewhat suspicious as the need to read contacts (READ_CONTACTS), receive messages from the system (RECEIVE_BOOT_COMPLETED), or modify parameters of the phone (MODIFY_PHONE_STATE) but none of these permissions have a high risk for which makes it more effective to go unnoticed.

 
Fig. 1 – ADRD permisos / ADRD permissions

También hemos analizado la complejidad del código (app real + troyano) y como se puede apreciar en la Fig. 2 es un troyano bastante simple de analizar. El apk contiene  dos paquetes principales (tat y xx.yyy). Tat se divide en dos paquetes más (cascadeswallpaper.android y livewallpaper.dandelion) y contiene la aplicación real, mientras que xx.yyy contiene el código del troyano. 

We have also looked into code complexity (real app + trojan) and as shown in Fig. 2 is a Trojan rather simple to analyze. The apk contains two main packages (tat and xx.yyy). Tat is divided into two packages more (cascadeswallpaper.android and livewallpaper.dandelion) and contains the actual app code, while xx.yyy contains the trojan code.

 
Fig. 2 – ADRD visualización de código / ADRD code visualization

BaseBridge

Troyano descubierto en junio de 2011 con una sofisticación elevada  y que actúa en dos fases. En la primera fase el troyano utiliza un exploit conocido (CVE-2009-1185) para elevar sus privilegios a root.

Trojan discovered in June 2011 with a high sophistication which operates in two phases. In the first phase the trojan uses a well-known exploit (CVE-2009-1185) to elevate its privileges to root.

Una vez conseguido el objetivo de ser root comienza la segunda fase con la instalación de una aplicación maliciosa, SMSapp.apk, en el teléfono. Esta aplicación permite al troyano comunicarse con los servidores de centro de mando (C&C) utilizando http,  y al igual que otros troyanos roba información del teléfono (IMSI, hardware, versión SO, etc.) que es enviada a páginas web maliciosas.

Once achieved the goal of being root begins the second phase with the installation of a malicious application, SMSapp.apk, on the phone. This application enables the trojan to communicate with the command and control servers (C&C) using HTTP, and like other trojans steals phone information (IMSI, hardware, OS, etc.) that is sent to malicious web pages.

Además el troyano envía y elimina SMS y también realiza llamadas telefónicas a números de pago (Premium).

Moreover the trojan sends and removes SMS and also makes telephone calls to payment numbers (Premium).

Al analizar los permisos (ver Fig. 3) podemos apreciar que algunos son peligrosos como enviar SMS (SEND_SMS) y escribir SMS (WRITE_SMS). Otros permisos menos sospechosos pero interesantes que la aplicación requiere son grabar audio (RECORD_AUDIO), escribir contactos (WRITE_CONTACTS) o leer SMS (READ_SMS).

Analyzing the permissions (see Fig. 3) we can appreciate that some of them are dangerous as send SMS (SEND_SMS) and write SMS (WRITE_SMS). Other permissions are less suspicious but interesting nevertheless as record audio (RECORD_AUDIO), write contacts (WRITE_CONTACTS) or read SMS (READ_SMS).
 

Fig. 3 – Basebridge permisos / Basebridge permissions

Al visualizar la aplicación infectada con el troyano en la Fig. 4 podemos ver una complejidad elevada. Una serie de paquetes (com, jackpal.androidterm, javax, myjava.awt.datatransfer y org.apache.harmony) así como una cantidad de ficheros sueltos (clases sueltas) forman el código del troyano.

When we visualize the application infected with the Trojan in Fig. 4 we can see a high complexity. A number of packages (com, jackpal.androidterm, javax, myjava.awt.datatransfer and org.apache.harmony) as well as a number of loose files (standalone classes) form the trojan code.
 

Fig. 4 – Basebridge visualización de código / Basebridge code visualization

DroidDream

Troyano descubierto en marzo de 2011 con diferentes variantes. Este troyano también utiliza diferentes fases siendo la primera la ejecución de exploits para obtener root. La versión analizada no contiene estos exploits.

Trojan discovered in March 2011 with different variants. This Trojan also uses different phases be the first phase the execution of exploits to gain root. The analyzed version does not contain these exploits.

La segunda fase de este troyano consiste en instalar otra aplicación, a.apk, que sirve para robar información del teléfono (IMEI e ISMI) que es enviada a páginas web que actúan como centros de mando (C&C). Otras características del troyano son el envío y lectura de SMS y la capacidad de recibir actualizaciones de sí mismo.

The second phase of this Trojan consists on installing another application, a.apk, which is used to steal information from the phone (IMEI and ISMI) that is sent to web pages that act as command centers (C&C). Other features of the Trojan are sending and reading SMS and the ability to receive updates of itself.

En el análisis de permisos (Fig. 5) vemos algunos permisos peligrosos como el envío de SMS (SEND_SMS) y la instalación de paquetes (INSTALL_PACKAGES). Otros permisos de interés para el troyano son grabación de audio (RECORD_AUDIO), lectura y escritura del historial del navegador (READ_HISTORY_BOOKMARKS / WRITE_HISTORY_BOOKMARKS) y recibir eventos del sistema (RECEIVE_BOOT_COMPLETED).

In the permissions analysis (Fig. 5) we see some hazardous permissions as sending SMS (SEND_SMS) and installation of packages (INSTALL_PACKAGES). Other permissions of interest for the Trojan are recording audio (RECORD_AUDIO), reading and writing browser history (READ_HISTORY_BOOKMARKS / WRITE_HISTORY_BOOKMARKS) and receive events from the system (RECEIVE_BOOT_COMPLETED).

 
Fig. 5 – DroidDream permisos / DroidDream permissions

Analizando el código vemos una complejidad moderada (ver Fig. 6). El código del troyano está dividido en 5 paquetes (admob, cmn, com, steam y vw).

Analyzing the code we can see a moderate complexity (see Fig. 6). The code of the Trojan is divided into 5 packages (admob, cmn, com, steam and vw).


Fig. 6 – DroidDream visualización de código / DroidDream code visualization

DroidKungFu

Troyano descubierto entre mayo y junio de 2011, similar a otros troyanos estudiados anteriormente ya que divide su funcionamiento en fases. En primer lugar el troyano utiliza dos exploits (CVE-2009-1185 y CVE-2010-EASY), encriptados mediante AES, para obtener privilegios root en el teléfono, aunque a diferencia de los otros troyanos utiliza hasta tres métodos diferentes para obtener root.

Trojan discovered between May and June 2011, similar to other trojans formerly studied dividing its operation into phases. At first the Trojan uses two exploits (CVE-2009-1185 and CVE-2010-EASY), encrypted with AES, to obtain root privileges on the phone, but unlike other trojans uses up to three different methods to get root.

Una vez obtenido root el teléfono, el troyano roba información sobre IMEI, hardware, SO y Wifi que se envía a una página web.  Con los permisos de root el troyano puede instalar paquetes y en este caso instala otro troyano llamado “legacy” que convierte al teléfono en parte de una botnet.

Once obtained root on the phone, the trojan steals information such as IMEI, hardware, OS, and Wi-Fi which is sent to a web page. With root permissions the trojan can install packages and in this case it also installs another trojan called “legacy” which makes the phone part of a botnet.

Analizando los permisos requeridos por DroidKungFu (ver Fig. 7) algunos deberían hacer saltar las alarmas como instalar paquetes (INSTALL_PACKAGES) y resetear paquetes (RESTART_PACKAGES). Otros permisos de interés son el leer el estado del teléfono (READ_PHONE_STATE) o cambiar el estado de la wifi (CHANGE_WIFI_STATE).

Looking at the permissions required by DroidKungFu (see Fig. 7) some should sound the alarm such as installing packages (INSTALL_PACKAGES), and resetting packages (RESTART_PACKAGES). Other interesting permissions are reading phone status (READ_PHONE_STATE) or changing the state of the Wi-Fi (CHANGE_WIFI_STATE).
 

Fig. 7 – DroidKungFu permisos / DroidKungFu permissions

Al analizar el código de este complejo troyano (Fig. 8 ) podemos identificar tres paquetes principales (com, org y uk.co.lilhermit.android.core). El paquete com contiene el código del troyano que se divide en otros dos paquetes, google.ssearch y sansec.

Analyzing the code complexity of this Trojan (Fig. 8 ) we can identify three main packages (com, org, and uk.co.lilhermit.android.core). The com package contains the code for the trojan that is divided into two packages, google.ssearch and sansec.
 

Fig. 8 – DroidKungFu visualización de código / DroidKungFu code visualization

Geinimi

El Geinimi es un sofisticado troyano descubierto en diciembre de 2010 que aunque no utiliza exploits como otros troyanos es peligroso ya que roba información del teléfono como el IMEI y el IMSI. Otras características son el envío de información de posicionamiento (geo-localización), recibir actualizaciones de sí mismo y el envío de SMS.

The Geinimi is a sophisticated trojan uncovered in December 2010 that although it does not use exploits like other trojans is dangerous because it steals phone IMSI and IMEI information. Other features are sending localization information (geo-location), receive updates for itself and sending SMS.

Los teléfonos infectados con Geinimi forman parte de una botnet y el troyano ofusca las direcciones web de los centros de control para dificultar su análisis.

Phones infected with Geinimi are part of a botnet and the trojan obfuscates the web addresses of its control centers (C&C) to make the analysis harder.

Al analizar los permisos requeridos por Geinimi (ver Fig. 9) podemos observar una extensiva lista de permisos necesarios para su funcionamiento. Los permisos que nos tienen que llamar la atención son el envío de SMS (SEND_SMS), resetear paquetes (RESTART_PACKAGES) y escribir SMS (WRITE_SMS). Otros permisos de interés para nuestro análisis son acceso al posicionamiento del teléfono (ACCESS_COARSE_LOCATION), leer contactos (READ_CONTACTS), leer SMS (READ_SMS), escribir contactos (WRITE_CONTACTS) y recibir SMS (RECEIVE_SMS).

Analyzing the permissions required by Geinimi (see Fig. 9) we can see an extensive list of necessary permissions for its operation. The permissions we have to draw attention to are sending SMS (SEND_SMS), resetting packages (RESTART_PACKAGES) and writing SMS (WRITE_SMS). Other permissions of interest to our analysis are access to the location of the phone (ACCESS_COARSE_LOCATION), read contacts (READ_CONTACTS), read SMS (READ_SMS), write contacts (WRITE_CONTACTS) and receive SMS (RECEIVE_SMS).
 

Fig. 9 – Geinimi permisos / Geinimi permissions

A pesar de la sofisticación de Geinimi lo cierto es que es un código bastante simple de analizar (ver Fig. 10) repartido en dos paquetes: admob.android.ads y dseffects.MonkeyJump2. El paquete dseffects.MonkeyJump2 contiene otro paquete, jump2, y ficheros sueltos. Es aquí donde encontramos el código del troyano.

Despite the sophistication of Geinimi the truth is that is a fairly simple code analysis (see Fig. 10) distributed in two packages: admob.android.ads and dseffects.MonkeyJump2. Package dseffects.MonkeyJump2 contains another package, jump2, and loose files (standalone classes). Here is where you find the trojan code.

 
Fig. 10 – Geinimi visualización de código / Geinimi code visualization

jSMSHider

Troyano descubierto en junio de 2011, y a diferencia de otros troyanos su infección se enfoca a usuarios chinos que hayan instalado una ROM personalizada, limitando su peligrosidad. jSMSHider utiliza un exploit para obtener root pero este exploit no ataca al sistema Android  como otros troyanos, sino que explota una vulnerabilidad en la firma digital de las ROMs. Podemos decir que jSMSHider es un troyano diferente a todo lo visto hasta ahora.

Trojan discovered in June 2011 and unlike other Trojans its infection focuses on Chinese users who have installed a custom ROM, limiting his dangerousness. jSMSHider uses an exploit to gain root but unlike other trojans this exploit does not attack the Android system but exploit a vulnerability in the digital signature of the ROMs. We can say that jSMSHider is a trojan different to that we have seen so far.

Una vez obtenido root en el teléfono, el troyano instala otro paquete, testnew.apk, convirtiendo al teléfono en parte de una botnet. Ahora el troyano puede instalar nuevos paquetes, comunicarse con varias páginas web que funcionan como el centro de mando (C&C) utilizando DES para encriptar las comunicaciones y abrir páginas web de forma silenciosa sin que el usuario lo sepa.

Once obtained root on the phone, the trojan installs another package, testnew.apk, making the phone part of a botnet. Now the Trojan can install new packages, communicate with several websites that act as the command centers (C&C) using DES to encrypt communications and open web pages silently without the user knowing.

Imaginamos que esta ROM personalizada debe ser popular en el mercado chino por el grado de sofisticación y el tiempo de desarrollo empleado para este troyano.

We imagine this custom ROM must be popular in the Chinese market by the degree of sophistication and time spent developing this trojan.

En el análisis de permisos de jSMSHider (ver Fig.  11) dos permisos llaman nuestra atención, que son la instalación de paquetes (INSTALL_PACKAGES) y borrar paquetes (DELETE_PACKAGES). Otros permisos de interés son localización (ACCESS_COARSE_LOCATION), leer SMS (READ_SMS) y leer contactos (READ_CONTACTS).

In the analysis of jSMSHider permissions (see Fig. 11) two permissions call our attention, the installation of packages (INSTALL_PACKAGES) and delete packages (DELETE_PACKAGES). Other interesting permissions are phone location (ACCESS_COARSE_LOCATION), read SMS (READ_SMS) and read contacts (READ_CONTACTS).
 

Fig. 11 – jSMSHider permisos / jSMSHider permissions

En el análisis de código (Fig. 12) encontramos un paquete principal, org.expressme.love, que en su interior contiene otros tres paquetes: contentwrapper, logic y ui. En ui es donde podemos encontrar el código del troyano.

In the code analysis (Fig. 12) we see a main package, org.expressme.love, containing inside other three packages: contentwrapper, logic and ui. Ui is where you can find the trojan code.

 
Fig. 12 – jSMSHider visualización de código / jSMSHider code visualization

Plankton

Plankton es un troyano descubierto en junio de 2011 con una sofisticación moderada. Este troyano no utiliza exploits pero el teléfono infectado forma parte de una botnet.

Plankton is a trojan discovered in June 2011 with a moderate sophistication. This Trojan doesn’t use exploits but the infected phone is part of a botnet.

Como otros troyanos Plankton roba información del teléfono como los contactos, el historial y logs del sistema. Otras características son ejecutar comandos y manipular los iconos de acceso (shorcuts) además de la capacidad de encriptar mensajes.

Like other trojans Plankton steals phone information such as contacts, history, and system logs. Other features are running commands and manipulate shortcuts and also the ability to encrypt messages.

Al analizar los permisos de Plankton (Fig. 13) destaca la lectura de logs del sistema (READ_LOGS). Otros permisos interesantes son la lectura del historial (READ_HISTORY_BOOKMARKS), escritura del historial (WRITE_HISTORY_BOOKMARKS) leer contactos (READ_CONTACTS) y leer el estado del teléfono (READ_PHONE_STATE).

Analyzing the permissions of Plankton, Fig. 13, stresses the reading of logs from the system (READ_LOGS). Other interesting permissions are the reading browser history (READ_HISTORY_BOOKMARKS), writing browser history (WRITE_HISTORY_BOOKMARKS), reading contacts (READ_CONTACTS) and reading phone status (READ_PHONE_STATE).
 

Fig. 13 – Plankton permisos / Plankton permissions

En el análisis de código del troyano (Fig. 14) encontramos dos paquetes principales: com y org. Com, a su vez está formando por crazypps.angry.birds.rio.unlocker y plankton. Es en este último paquete donde encontramos el código del troyano.

In the code analysis of the Trojan (Fig. 14) there are two main packages: com and org. Com is formed by crazypps.angry.birds.rio.unlocker and plankton packages. It is the former package where we find the trojan code.

 
Fig. 14 – Plankton visualización de código / Plankton code visualization

TrojanSMS

El TrojanSMS fue descubierto en agosto de 2010 y tiene el honor de ser el primer troyano para Android. Es un troyano muy simple y su infección consiste en enviar SMS a números de pago (Premium) rusos por lo que solo afecta a usuarios en Rusia.

The TrojanSMS was discovered in August 2010 and has the honor of being the first trojan for Android. It is a very simple trojan and his infection consists in sending SMS to Russians payment numbers (Premium) so it only affects users in Russia.

En el análisis de permisos (Fig. 15) podemos ver que sólo requiere un permiso: el de envío de SMS (SEND_SMS).

In the permissions analysis (Fig. 15) we can see that it only requires one permission: sending SMS (SEND_SMS).

 
Fig. 15 – TrojanSMS permisos / TrojanSMS permissions

Igualmente en el análisis de código (Fig. 16) podemos observar la simpleza de este troyano. El código está formado por un solo paquete, org.me.androidapplicacion1, que contiene el troyano.  

In the code analysis (Fig. 16) we can see the simplicity of this trojan. The code is composed of just one package, org.me.androidapplicacion1, which contains the trojan code.

 
Fig. 16 – TrojanSMS visualización de código / TrojanSMS code visualization

Crusewind

Troyano descubierto en junio de 2011 de sofisticación moderada. Este troyano convierte al teléfono en una pasarela SMS (relay) para el envío de SMS de forma silenciosa. Otras características del troyano son el robo de información que se envía a centros de mando (C&C), listar las aplicaciones instaladas y la capacidad de actualizarse a sí mismo.

Trojan discovered in June 2011 with a moderate sophistication. This trojan turns the phone into a SMS relay for sending SMS silently. Other trojan features are the steal of information that is sent to command centers (C&C), listing installed applications and the ability to update itself.

En el análisis de permisos (Fig. 17) dos son los permisos que llaman nuestra atención: leer SMS (READ_SMS) y escribir SMS (WRITE_SMS). Otros permisos interesantes son recibir y leer SMS (RECEIVE_SMS y READ_SMS) y leer el estado del teléfono (READ_PHONE_STATE).

In the permissions analysis (Fig. 17) two permissions catch our attention: read SMS (READ_SMS) and write SMS (WRITE_SMS). Other interesting permissions are to receive and read SMS (RECEIVE_SMS and READ_SMS) and read phone status (READ_PHONE_STATE).
 

Fig. 17 – Crusewind permisos / Crusewind permissions

En el análisis de código de Crusewind (Fig. 18) podemos observar un paquete principal, com.flashp, que se divide en una serie de paquetes (bo, data, http, task, utils y xml) y ficheros. Todos estos paquetes forman parte del código del troyano.

In the code analysis of Crusewind, Fig. 18, we can see a main package, com.flashp, which is divided into a number of files and packages (bo, data, utils, task, http and xml). All these packages form part of the trojan code.

 
Fig. 18 – Crusewind visualización de código / Crusewind code visualization

Conclusión / Conclusion

A lo largo de este artículo hemos analizado diversos troyanos para Android que se encuentran entre las infecciones más comunes y que en varias ocasiones Google ha tenido que eliminarlos del Android Market, pero si un teléfono está infectado es responsabilidad del usuario limpiarlo.

In this article we have analyzed different Android trojans that are amongst the most common infections and several times it Google had to delete them from the Android Market, but if a phone is infected it is the responsibility of the user to clean it.

Entre los troyanos analizados hemos podido observar cómo roban información del teléfono, utilizan exploits para obtener root, instalan troyanos para formar parte de botnets, envían SMS o realizan llamadas y protegen sus comunicaciones mediante canales seguros. Desde luego emplean una buena variedad de técnicas ofensivas.

Among the analyzed trojans we have seen how they steal phone information, use exploits to gain root, install more trojans to form part of botnets, send SMS or make calls and protect communications through secure channels. I would say a high variety of offensive techniques.

Llama la atención la cantidad de troyanos que son de origen chino y en especial el jSMSHider ,que está totalmente focalizado a una serie de usuarios en concreto. ¿Puede ser que todo este desarrollo de tecnologías ofensivas sea parte del programa de ciberguerra del gobierno? Lo que está claro es que los atacantes chinos están muy activos.

It is striking the number of trojans that are Chinese in origin, and especially the jSMSHider that is targeted on a number of particular users. Could it be that all these developments of offensive technologies are part of the Chinese Government cyber warfare program?  What is clear is that Chinese attackers are very active.

Es de esperar que el número de troyanos aumente en las plataformas móviles, si no ¿por qué tanto antivirus disponible para teléfonos?

It is expected that the number of trojans will increase in the mobile platforms, if not why so many antivirus available for phones?

Si alguna persona está interesada en un análisis técnico con más detalle de los troyanos del artículo, estaré encantado de proporcionarlo por un precio 😉

If anyone is interested in a technical analysis with more details of any trojans in the article, I’ll be happy to provide it for a price 😉

Por ultimo dar las gracias a Mila y la lista Mobile Malware por proporcionar copias de los troyanos.

Finally thanks to Mila and Mobile Malware list by providing copies of the trojans.

¿Qué troyano te ha gustado más?

What trojan did you like most?

— Simon Roses Femerling

Enlaces / Links

This entry was posted in Hacking, Security, Technology and tagged , , , , . Bookmark the permalink.

10 Responses to Exploring Android Malware

Leave a Reply to Ronaldo Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.