13/09/2013
17:49

A new menace for Android... it is the TrojanSMS.Agent.A!


The CRAM (Anti-Malware Research Center of TG Soft) team has recently discovered and analyzed a new threat that targets Android and hidden itself to the user in order to steal its personal information and to take control of SMS.

The CRAM (Anti-Malware Research Center of TG Soft) team has recently discovered and analyzed a new threat that, among others, targets users of the Android operating system. It is the TrojanSMS.Agent.A that, once installed, hidden itself to the user in order to steal its personal information (such as: phone number, IMEI, etc...) and to take control of SMS.

Name: application.apk Android.TrojanSMS.Agent.A
Package: com.android.system
MD5: E4941DF174EE0700E004904C7C8C132F
Size: 20.480 Byte

When one tries to install this malicious app, which named itself “Android”, it requires the following permissions (declared into the AndroidManifest.xml file):

  • android.permission.INTERNET
  • android.permission.WRITE_SMS
  • android.permission.READ_SMS
  • android.permission.SEND_SMS
  • android.permission.RECEIVE_SMS
  • android.permission.WRITE_EXTERNAL_STORAGE
  • android.permission.WAKE_LOCK
  • android.permission.READ_PHONE_STATE
  • android.permission.READ_EXTERNAL_STORAGE
  • android.permission.READ_CONTACTS
  • android.permission.RECEIVE_BOOT_COMPLETED
  • android.permission.CHANGE_COMPONENT_ENABLED_STATE

In particular, between the various SMS-related permissions, we want to point out SEND_SMS and RECEIVE_SMS. The first one allows the app to send SMS, while the second one allows the app to monitor incoming SMS messages in order to record them or to perform further opertations on them. Furthermore, between the other permissions, we want to highlight RECEIVE_BOOT_COMPLETED and WAKE_LOCK. The first one allows the app to receive the signal broadcasted after the operating system has finished booting, while the second one allows to avoid the processor from sleeping and/or the screen from dimming.

Remind that it is highly recommended to READ the permissions that an app requires CAREFULLY before installing it!
 

Android.TrojanSMS.Agent.A


Glancing at the AndroidManifest.xml file, we also can see that the first Activity to be launched, once the app will be started, will be AppDownloaderActivity and its name will be the one declared in the res/strings.xml file with ID app_name (i.e. fonts). Furthermore, we can see that the app is composed also by a Service called SystemService and four BroadcastReceiver called respectively: SmsReceiver, which required the highest priority (1000), OnBootReceiver, IncomingCallReceiver and ServiceController.

Among the strings declared into res/strings.xml, in particular, we can notice one with the ID hello and value: "rus mod by 13nikita успешно установлен".

Once the app is installed, we can see it among our apps, with the name of fonts.

Android.TrojanSMS.Agent.A

If we launch the app, it shows a black screen with a message that says: “Android System Update Installed”. In background, in the meanwhile, the app auto-deletes itself from the apps menu (by disabling the Activity AppDownloaderActivity) and launches a service, called SystemService, which hooks itself at the boot of the operating system in order to run automatically at every reboot of the device.


Android.TrojanSMS.Agent.A     Android.TrojanSMS.Agent.A

In particular, analysing the class AppDownloaderActivity, we observe that it launches SystemService using localIntent.setFlags(268435456), therefore launching the service as a new task (indeed the value 268435456 correspond to FLAG_ACTIVITY_NEW_TASK). Furthermore, we notice that the setComponentEnabledSetting(localComponentName, 2, 1)  method of the PacketManager of Android is called. This method is used to activate some settings of a particular Andorid component, in this case AppDownloaderActivity itself. In particular, this method is called with 2 (value corresponding to COMPONENT_ENABLED_STATE_DISABLED) as new state, that is the Activity will be explicity disabled regardless of what it is specified in the AndroidManifest.xml, and with 1 (value corresponding to DONT_KILL_APP) as flag, that is this procedure should not kill the app.


Android.TrojanSMS.Agent.A

Analysing the SystemService class, we observe that it declares two static variables, mainurl and url. The first contains the domain: online17.ru. This domain results be dislocated in Russia, have the name mailkryton.beget.ru and IP address 91.106.203.33.

Once it has been started, SystemService immediately starts an AsyncTask, called addTask, declared inside its own class and that does some operations in background and sets an AlarmManager that launches ServiceController regularly, every 3 minutes.

In the background, addTask connects to the IP address 91.106.203.33, at the URL: http://online17.ru/dev/reg.php?country=[...]&phone=[...]&op=Android&balance=[...]&imei=[...]. In this way, the malware sends some user data, such as the county ISO code, the phone number, the operating system (from which we can suppose there exists versions of this malware that targeted other OSs rather than Android), the IMEI (International Mobile Equipment Identity) and a field called “balance” that we suppose to be the credit of the SIM card. The server analyses the data sent and, if these are the standard ones of the Android emulator (e.g. 15555215554 as telephone number, 000000000000000 as IMEI and 0 as balance), the server will answer saying to the malware that the device is in the blacklist.

Furthermore, the malware connects regularly, approximately every 3 minutes, to: http://online17.ru/dev/getTask.php?imei=[...]&balance=[...]. This is probably done in order to update the balance field of the device inside the server. If we are using a real device (or, anyway, we are not blacklisted), then, in its answer, the server will include some fields, such as: the infection date, the date of the last "activation", the phone operator and, in a field called balance, the IP address of the device.


Android.TrojanSMS.Agent.A

Analysing the OnBootReceiver class, we observe that this simply occupies to hook to the boot of the operating system and launch SystemService, always using FLAG_ACTIVITY_NEW_TASK in order to launch the service as a new task.
 


Android.TrojanSMS.Agent.A

Analysing the ServiceController class, we observe that it does some operations in the background, such as: sending SMS via the sendSMS() method, creating a log file (called log.file) into the SD card through the appendLog() method, and saving a special bookmark inside the browser through the saveBookmark() method.


Android.TrojanSMS.Agent.A

Finally, analysing the SmsReceiver class, we observe that this scans the incoming SMS through the onReceive() method and, if the sender phone number contains the “088011” or “000100”, the malware looks in the body of the SMS for the pattern given by the regular expression "-?\\d+" (thus zero or one “-” followed by one or more numbers). If this patter is founded, then it is stored into the static variable secretcode.
Moreover, inside this class it is declared another class, called Scan (Runnable), inside of which there is method called run() that scans the SMS and, if it found SMS from given senders, firstly it marks them as read (probably to avoid the notifications) and afterwards it deletes them.
Android.TrojanSMS.Agent.A


-------------------------
Paolo Rovelli & Gianfranco Tonello
CRAM (Anti-Malware Research Center) of TG Soft

Any information published on our site may be used and published on other websites, blogs, forums, facebook and/or in any other form both in paper and electronic form as long as the source is always and in any case cited explicitly “Source: CRAM by TG Soft www.tgsoft.it” with a clickable link to the original information and / or web page from which textual content, ideas and / or images have been extrapolated.
It will be appreciated in case of use of the information of C.R.A.M. by TG Soft www.tgsoft.it in the report of summary articles the following acknowledgment/thanks “Thanks to Anti-Malware Research Center C.R.A.M. by TG Soft of which we point out the direct link to the original information: [direct clickable link]”

Vir.IT eXplorer PRO is certified by the biggest international organisation: