Santa-APT: Android and Blackberry Malware Technical Analysis Part 2

CloudSEK is an artificial intelligence technology-based risk monitoring enterprise, which focuses on customized, intelligent security monitors.

CloudSEK’s SaaS-based products help a client, assess security real-time from the perspective of an attacker 24*7. Our monitors track our client’s various Internet-based resources for potential security risks. Instead of using traditional static threat detection engines and manual verification process our monitors use Artificial Intelligence to identify threats.

The blog is an analysis of some critical information CloudSEK acquired from our data partner.

At CloudSEK we monitor and attribute all potential threats that affect Cloud services. In our previous blog we wrote about a group of attackers code named as Santa-APT that was functioning as a cyber crime unit as well as an APT. This team targeted Cloud servicing vendors as well.

Santa-APT team had multiple games and apps on Playstore as well as other android markets. These games never had all permissions required to do full data theft. The actual malware payloads came as updates.  They not only had Android Malware but Blackberry versions too. In this blog we will provide more technical details regarding their payloads.

Screenshot of Santa-APT mobile malware interface.

Part 1 attribution: https://cloudsek.com/harbour-aimed-a-slowen-down-in-singer-city-screening/

As mentioned before, the payloads come in the form of an Update. Here we are sharing the analysis of three different updates [2 for android and 1 for Blackberry] that are used by Santa-APT.

Android SMS stealers:

These updates are for stealing SMS information, similarly they have updates that can perform various other functionalities as mentioned in our previous article.

Signatures:

MD5 (remote.apk) = af543393e0d6da372cd781a928895c79

MD5 (IncomingSMSApp-1.apk) = 5bd71e7b465c1a8435ff0d4b093289e3sha256

Permissions:

android.permission.RECEIVE_SMS

android.permission.SEND_SMS

android.permission.INTERNET

android.permission.ACCESS_NETWORK_STATE

This update steals messages from devices and sends it off to a CNC server. From the looks of it, this is just testing app which will later be integrated to a full-fledged malware.

Sending text message code:

It connects to the backend, which pushes xml. The xmlpullparser modules parses the received xml and executes the tasks in the application accordingly.

Android Call, Camera and GPS collection:

Signatures:

App Name : Android Care

Launcher Display name: update

SHA512(aps.apk)= 92c2979398c7f89c19d2a7e038a4fbca2dce99fc1741382b27abefb46e5fd8ed5c887ff8ca5ec0b39c15f47955e62f3f29a9cd8a6dace3509ce2bcd4975de37c

Malware Class: droidFakePatch

sha256: 21ae32e66f80e8479264163eec340732c05c1f7d7d408c7d2ff623deaba4a920

This module has the functionality to collect call, GPS and camera data. This mostly works on triggers. Like lets say the user is in a specific building , then it sends an sms to the Master number. Various other triggers like talking while driving etc is calculated . It is possible from the admin site to configure what all triggers are configured and so on. This data comes from the server in XML format which is parsed by the Spyware app. We have previously documented the controller interface that does this functionality .

While trying to un-install, it gives an intimidating message like below, where in the user thinks that he should be doing something wrong and doesn’t un-install.

This is achieved by fiddling with the android:label section in the androidManifest.xml file.

 

From the phone dialer, its possible to check if this spyware is running or not by dailing

*#0006#, this must be added for testing purpose.

Screen Shot 2015-12-30 at 1.10.40 PM

There is an XML endpoint which gets config data such as “set Master Number” etc. The alerts are sent to this number when a trigger is activated.  Following are the data it collects.

Screen Shot 2015-12-30 at 1.13.55 PM

 

Screen Shot 2015-12-30 at 1.15.55 PM


 

A module that steals pretty much everything. 

Name: droidFakePatch

Type:  Class file

Signatures :

sha256: 21ae32e66f80e8479264163eec340732c05c1f7d7d408c7d2ff623deaba4a920

 

Brief:

The application disguises itself as an android secure patch, when installed disappears from the Android Launcher, which convinces the user to believe that the patch would be applied. The app runs as a background service and provides no GUI or App icons for a user to interact with. It monitors for calls, sms, contacts, Images and Videos in the device and connects to a CNC server over network. While reverse engineering the malware, it appears to be well structured and carefully planned.

Screen Shot 2015-12-30 at 1.48.33 PM

Permissions:

The app requests permissions for almost all the data it needs to spy on. It also requests for certain system level permissions that would be granted if the device running the app runs an outdated version of android, since some permissions were moved to signature level recently in the latest releases of android.

Permissions requested:

– make calls and reroute calls

– read and send sms

– read Bookmark, history

– read/write to SDcard

– full network access

– run at startup

– change system settings, prevent sleep, change audio settings etc

Screen Shot 2015-12-30 at 1.49.03 PM

Analysis:

Once the application has started, it removes itself from the Launcher Screen and starts the background activity. It achieves this by calling the below API.

Screen Shot 2015-12-30 at 1.51.07 PM

Most of application logic is run within the background service. The Controller Class verifies if it’s the first run or not by reading values from shared preferences and issues intents accordingly.

 

Screen Shot 2015-12-30 at 1.51.48 PM

OnStart Method of the MainService Class also registers an Intent Filter for two events, i.e. android.intent.action.SCREEN_ON, android.intent.action.SCREEN_OFF, which enables the application to be aware of the above events while a user turns on and off his mobile device screen.

Screen Shot 2015-12-30 at 1.52.50 PM

The app then checks for the SimIMSI number, logs SIM change events and updates its internal database. It also logs the users phone number, the state of the phone etc. and also registers observers for contacts, SMS, images and video as shown below. These observers notify the application in their onChange methods, where there is code to update the new entries in the internal database and later upload it to the CNC.

Screen Shot 2015-12-30 at 1.53.05 PM

The application has capabilities for camera, audio, video and call recording which it has permissions for. The data is either stored in the SDcard or within the sandbox and later uploaded to the CNC. The data uploaded is done using plain http, xml data over http as well as by an sftp module.

 

Application Sandbox:

Most of the structured data; like incoming / outgoing call lists, contacts, SMS, GPS information etc. is stored in the database and uploaded to the CNC when a network connection is available. There are no native binaries used in the application. Shared preferences file is used to maintain the state of service that is run in the background.

Screen Shot 2015-12-30 at 2.00.13 PM


Blackberry Malwares :

The group performed operations similar to the android updates for stealing Blackberry users data.

Name: Update.jar

Type:  Java archive

Signatures :

SHA512(Update.jar)= 0302bbf67937cffc8177511481165ab53d3cbdabfaf2cd2cdfda04633d18b5eedc49a066b593de4f822a301392817b2b047aef276ef8faee7172dc8a5d7f08e2
SHA512(Update.jar)= 73d7afeb0af7efe579ddcefa2823c5f05d4465a93df123e2c3a63fc817283b032c7ecd11e312c0ca8c90e843ebe372771032efcf6c88e1bc84a40cf3fd429449
SHA512(Update.jar)= e97fefb240845e2ddd234dcec13e59ef038229ea42f7bad878fc407f219ff54443b6682aea1dc58fc85d22c45cc3a97e2ec3fd294b06e1262c66fffed2acacd6
SHA512(Update.jar)= e97fefb240845e2ddd234dcec13e59ef038229ea42f7bad878fc407f219ff54443b6682aea1dc58fc85d22c45cc3a97e2ec3fd294b06e1262c66fffed2acacd6
SHA512(Update.jar)= e97fefb240845e2ddd234dcec13e59ef038229ea42f7bad878fc407f219ff54443b6682aea1dc58fc85d22c45cc3a97e2ec3fd294b06e1262c66fffed2acacd6
SHA512(Update.jar)= 73d7afeb0af7efe579ddcefa2823c5f05d4465a93df123e2c3a63fc817283b032c7ecd11e312c0ca8c90e843ebe372771032efcf6c88e1bc84a40cf3fd429449
SHA512(Update.jar)= 0302bbf67937cffc8177511481165ab53d3cbdabfaf2cd2cdfda04633d18b5eedc49a066b593de4f822a301392817b2b047aef276ef8faee7172dc8a5d7f08e2

Blackberry version of the malware steals the following information.

  1. Emails
  2. Media files
  3. Contacts
  4. MMS data
  5. Calendar
  6. Audio recording
  7. SMS
  8. GPS location
  9. Installed applications

Screen Shot 2015-12-30 at 4.06.56 PM

 

The collected data is uploaded and visualised on the same controller that is used by the android malware. The Blackberry malware uses Blackberry APIs . The code flaw and feature sets are all identical to the android malware. A more detailed analysis would be added if required in our next blog.

 

Screen Shot 2015-12-30 at 3.59.54 PM

Summary:

The group has full-fledged malware capable of spying users in almost all avenues possible. Santa-APT team  doesn’t utilize any root / privilege escalation exploits, but makes use of the permissions the user granted it and quietly skims data to the CNC server. Hardcoded server addresses and API endpoints is spread in the binary and the networking module and uses both HTTP and sFTP communication to the CNC. Even though santa-APT had OSX developers and OSX applications, we have not identified any OSX malware form this group.

The target of this APT is so diverse, ranging from government officials, high profile individuals to engineers from technology companies. More attribution , victim informations and artifacts about Santa-APT could be provided on request at [theoracle (-@-) cloudsek.com ]

CloudSEK is thankful to Anto Joseph from garage4hackers for the android malware analysis.

Written by :