{"id":1415,"date":"2022-04-01T14:28:08","date_gmt":"2022-04-01T12:28:08","guid":{"rendered":"https:\/\/lab52.io\/blog\/?p=1415"},"modified":"2022-04-01T14:28:10","modified_gmt":"2022-04-01T12:28:10","slug":"complete-dissection-of-an-apk-with-a-suspicious-c2-server","status":"publish","type":"post","link":"https:\/\/lab52.io\/blog\/complete-dissection-of-an-apk-with-a-suspicious-c2-server\/","title":{"rendered":"Complete dissection of an APK with a suspicious C2 Server"},"content":{"rendered":"\n<p>During <a href=\"https:\/\/lab52.io\/blog\/looking-for-penquins-in-the-wild\/\" data-type=\"URL\" data-id=\"https:\/\/lab52.io\/blog\/looking-for-penquins-in-the-wild\/\">our analysis of the Penquin-related infrastructure<\/a> we reported in our previous post, we paid special attention to the malicious binaries contacting these IP addresses, since as we showed in the analysis, they had been used as C2 of other threats used by Turla.<\/p>\n\n\n\n<p>One threat that makes contact with the 82.146.35[.]240 address in particular caught our attention, as it was the only one that contacts against that IP and it was an Spyware for Android devices. <\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"732\" height=\"145\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/04\/Captura-de-pantalla-de-2022-04-01-14-14-21.png\" alt=\"\" class=\"wp-image-1544\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/04\/Captura-de-pantalla-de-2022-04-01-14-14-21.png 732w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/04\/Captura-de-pantalla-de-2022-04-01-14-14-21-300x59.png 300w\" sizes=\"(max-width: 732px) 100vw, 732px\" \/><\/figure><\/div>\n\n\n\n<p>So in this report, we want to share our analysis on the capabilities of this piece of malware, although the attribution to Turla does not seem possible given its threat capabilities.<\/p>\n\n\n\n<p><strong>Name: <\/strong>Process Manager<\/p>\n\n\n\n<p><strong>Package: <\/strong>com.remote.app<\/p>\n\n\n\n<p><strong>Hash: <\/strong>e0eacd72afe39de3b327a164f9c69a78c9c0f672d3ad202271772d816db4fad8 (sha-256)<\/p>\n\n\n\n<p><strong>Size: <\/strong>0.37 MB<\/p>\n\n\n\n<p><strong>Target SDK: <\/strong>Android 14 \u2013 Android 21<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/1-1024x146.png\" alt=\"\" class=\"wp-image-1416\" width=\"732\" height=\"104\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/1-1024x146.png 1024w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/1-300x43.png 300w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/1-768x109.png 768w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/1.png 1110w\" sizes=\"(max-width: 732px) 100vw, 732px\" \/><\/figure><\/div>\n\n\n\n<p>On the Android device, the application is displayed with a gear-shaped icon.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/2.png\" alt=\"\" class=\"wp-image-1418\" width=\"281\" height=\"508\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/2.png 427w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/2-166x300.png 166w\" sizes=\"(max-width: 281px) 100vw, 281px\" \/><\/figure><\/div>\n\n\n\n<p>When the application is run, a warning appears about the permissions granted to the application. These include screen unlock attemps, lock the screen, set the device global proxy, set screen lock password expiration, set storage encryption and disable cameras.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/3.png\" alt=\"\" class=\"wp-image-1422\" width=\"517\" height=\"477\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/3.png 915w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/3-300x277.png 300w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/3-768x710.png 768w\" sizes=\"(max-width: 517px) 100vw, 517px\" \/><\/figure><\/div>\n\n\n\n<p>The icon is then removed and the application runs in the background, showing in the notification bar.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/4.png\" alt=\"\" class=\"wp-image-1425\" width=\"407\" height=\"225\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/4.png 443w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/4-300x166.png 300w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/4-400x222.png 400w\" sizes=\"(max-width: 407px) 100vw, 407px\" \/><\/figure><\/div>\n\n\n\n<p>As mentioned in the previous section, the malware requests different permissions from the user. However, the number of permissions requested by the application amounts to 18:<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter is-style-regular\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\"><strong>PERMISSIONS<\/strong><\/th><th class=\"has-text-align-right\" data-align=\"right\"><strong>DESCRIPTION<\/strong><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>ACCESS_COARSE_LOCATION<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Access to the phone location.<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>ACCESS_FINE_LOCATION<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Access to the location based on GPS.<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>ACCESS_NETWORK_STATE<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">View the status of all networks.<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>ACCESS_WIFI_STATE<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">View WIFI information.<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>CAMERA<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Take pictures and videos from the camera<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>FOREGROUND_SERVICE<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to put in foreground<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>INTERNET<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to create internet sockets<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>MODIFY_AUDIO_SETTINGS<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to modify audio settings<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>REAL_CALL_LOG<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to read a telephone call<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>READ_CONTACTS<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to read contacts information<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>READ_EXTERNAL_STORAGE<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to read external storage devices<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>WRITE_EXTERNAL_STORAGE<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to write to the Memory Card<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>READ_PHONE_STATE<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to read phone status and its id<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>READ_SMS<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to read SMS stored on the SIM card<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>RECEIVE_BOOT_COMPLETED<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">               Allows to start the app when the device is turned on<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>RECORD_AUDIO<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Access to the audio recorder<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>SEND_SMS<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Allows to send sms<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>WAKE_LOG<\/strong><\/td><td class=\"has-text-align-right\" data-align=\"right\">Prevents the device from locking\/hibernating<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"has-text-align-left\">In addition, the manifest displays additional information about the application configuration.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><strong><em>android:allowBackup=true: <\/em><\/strong>Allows the application data to be added to the backup.<\/li><li><strong><em>android:exported=true:<\/em><\/strong> Can share info with other apps and be accessed by the device.<\/li><li><strong><em>android_secret_code:<\/em><\/strong> In the manifest is the secret code that can allow access to hidden content.<\/li><\/ul>\n\n\n\n<p>As you can see in the image, the com.remote.app package contains 21 classes.15 of them are named after the first letters of the alphabet and then there are the DeviceAdmin, MainActivity, MainService, MyReceiver, NotificationListener and ServiceReceiver classes (the R class is generated by the JADX software).<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/5.png\" alt=\"\" class=\"wp-image-1436\" width=\"264\" height=\"420\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/5.png 469w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/5-188x300.png 188w\" sizes=\"(max-width: 264px) 100vw, 264px\" \/><\/figure><\/div>\n\n\n\n<p>The MainService class is the main class and therefore it is the first one to be executed in the application. This class has a main function OnCreate, it creates a notification channel called &#8220;Battery Level Service&#8221; where it will be executed.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6.png\" alt=\"\" class=\"wp-image-1437\" width=\"680\" height=\"175\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6.png 752w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-300x77.png 300w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><\/figure><\/div>\n\n\n\n<p>Next, the MainActiviy class is invoked, which using DeviceAdmin configures the device with administration permissions.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-2.png\" alt=\"\" class=\"wp-image-1439\" width=\"485\" height=\"148\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-2.png 573w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-2-300x92.png 300w\" sizes=\"(max-width: 485px) 100vw, 485px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-3.png\" alt=\"\" class=\"wp-image-1440\" width=\"661\" height=\"133\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-3.png 619w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-3-300x61.png 300w\" sizes=\"(max-width: 661px) 100vw, 661px\" \/><\/figure><\/div>\n\n\n\n<p>Once the application is configured, each of the tasks that steal information from the device are executed. Classes a, b, f, g, i, j, k, l, m, n, o and NotificationListener implement functions that steal information from the device and add it to a JSON.<\/p>\n\n\n\n<p>In the <strong>Class a<\/strong>, the malware adds information about the installed packages to the JSON. For each of them it provides the package name, the application name, the version and its number.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"346\" height=\"162\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-4.png\" alt=\"\" class=\"wp-image-1441\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-4.png 346w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-4-300x140.png 300w\" sizes=\"(max-width: 346px) 100vw, 346px\" \/><\/figure><\/div>\n\n\n\n<p>In the <strong>Class b<\/strong>, the malware adds information about the calls made from the device to the JSON. For each call it shows the number, name (contact), duration, date and type. The type is a number corresponding to the following table:<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter is-style-regular\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">NUMBER<\/th><th class=\"has-text-align-center\" data-align=\"center\">     TYPE<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">1<\/td><td class=\"has-text-align-center\" data-align=\"center\">Incoming<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">2<\/td><td class=\"has-text-align-center\" data-align=\"center\">Outgoing<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">3<\/td><td class=\"has-text-align-center\" data-align=\"center\">Missed<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">4<\/td><td class=\"has-text-align-center\" data-align=\"center\">Voice Message<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">5<\/td><td class=\"has-text-align-center\" data-align=\"center\">Refused<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">6<\/td><td class=\"has-text-align-center\" data-align=\"center\">Blacklist<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-7.png\" alt=\"\" class=\"wp-image-1448\" width=\"531\" height=\"166\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-7.png 507w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-7-300x94.png 300w\" sizes=\"(max-width: 531px) 100vw, 531px\" \/><\/figure><\/div>\n\n\n\n<p>Similarly, the <strong>Class f<\/strong> adds to the JSON information about the contact list. Indicating the number and name of each one.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-6.png\" alt=\"\" class=\"wp-image-1447\" width=\"549\" height=\"138\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-6.png 464w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-6-300x76.png 300w\" sizes=\"(max-width: 549px) 100vw, 549px\" \/><\/figure><\/div>\n\n\n\n<p>We continue with the <strong>Class g <\/strong>that collects all the files in the device, saving in the JSON the name and the buffer of each one of them. In case a file cannot be accessed it also indicates it with &#8220;Access Denied&#8221;.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-8.png\" alt=\"\" class=\"wp-image-1451\" width=\"641\" height=\"152\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-8.png 580w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-8-300x71.png 300w\" sizes=\"(max-width: 641px) 100vw, 641px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-9.png\" alt=\"\" class=\"wp-image-1452\" width=\"385\" height=\"128\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-9.png 468w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-9-300x100.png 300w\" sizes=\"(max-width: 385px) 100vw, 385px\" \/><\/figure><\/div>\n\n\n\n<p>In addition, it also lists the directories, indicating the name and path.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-10.png\" alt=\"\" class=\"wp-image-1454\" width=\"433\" height=\"112\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-10.png 478w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-10-300x78.png 300w\" sizes=\"(max-width: 433px) 100vw, 433px\" \/><\/figure><\/div>\n\n\n\n<p>This <strong>Class i<\/strong> implements functions related to a location listener (When the location is changed, it is enabled or disabled), then adds in the JSON the location information with each change: The altitude, latitude, longitude, precision and even the speed at which the device is moving.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-11.png\" alt=\"\" class=\"wp-image-1455\" width=\"464\" height=\"223\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-11.png 509w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-11-300x144.png 300w\" sizes=\"(max-width: 464px) 100vw, 464px\" \/><\/figure><\/div>\n\n\n\n<p>The <strong>Class j<\/strong> returns adds to the JSON the clipboard information each time the clipboard is updated. To do so, it uses a listener that is configured in the <strong>MainService Class<\/strong>.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-12.png\" alt=\"\" class=\"wp-image-1457\" width=\"583\" height=\"180\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-12.png 567w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-12-300x93.png 300w\" sizes=\"(max-width: 583px) 100vw, 583px\" \/><\/figure><\/div>\n\n\n\n<p>The <strong>Class k <\/strong>implements a timer that launches task l and deletes the generated temporary file every x seconds. Afterwards, <strong>Class l <\/strong>records the audio from the device, extracts it in an .mp3 format in <em>cacheDir<\/em> and then adds a buffer of the file and the name to the JSON.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-13.png\" alt=\"\" class=\"wp-image-1459\" width=\"437\" height=\"263\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-13.png 496w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-13-300x180.png 300w\" sizes=\"(max-width: 437px) 100vw, 437px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-14.png\" alt=\"\" class=\"wp-image-1460\" width=\"392\" height=\"152\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-14.png 360w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-14-300x117.png 300w\" sizes=\"(max-width: 392px) 100vw, 392px\" \/><\/figure><\/div>\n\n\n\n<p>The <strong>Class m<\/strong> adds information about the permissions a user has on each package to the JSON. It goes through the entire list of packages on the device and checks what permissions each package is requesting.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-15.png\" alt=\"\" class=\"wp-image-1461\" width=\"673\" height=\"151\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-15.png 640w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-15-300x68.png 300w\" sizes=\"(max-width: 673px) 100vw, 673px\" \/><\/figure><\/div>\n\n\n\n<p>The <strong>Class n<\/strong> adds to the JSON conversations of all contacts thanks to (<em>content:\/\/mms-sms\/conversations?simple=true<\/em>) and of addresses of all contacts (<em>content:\/\/mms-sms\/canonical-addresses<\/em>). It also has a function that sends a text message in case the contact is not found.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-16.png\" alt=\"\" class=\"wp-image-1463\" width=\"565\" height=\"224\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-16.png 546w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-16-300x119.png 300w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/figure><\/div>\n\n\n\n<p>The <strong>Class o<\/strong> collects information from Wifis scanned by the device. For each of them it adds to the JSON its SSID and BSSID number.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-17.png\" alt=\"\" class=\"wp-image-1464\" width=\"575\" height=\"134\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-17.png 505w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-17-300x70.png 300w\" sizes=\"(max-width: 575px) 100vw, 575px\" \/><\/figure><\/div>\n\n\n\n<p>Finally, <strong>NotificationListener Class <\/strong>collects information about notifications. When a notification is opened, it stores in the JSON the name of the app, the content and the time it has been open.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-18.png\" alt=\"\" class=\"wp-image-1466\" width=\"315\" height=\"154\"\/><\/figure><\/div>\n\n\n\n<p>Once all the information has been collected in JSON format, the application contacts the C2 (82.146.35[.]240) and identifies the device by its model, version, id and manufacturer.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-20.png\" alt=\"\" class=\"wp-image-1469\" width=\"560\" height=\"170\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-20.png 549w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-20-300x91.png 300w\" sizes=\"(max-width: 560px) 100vw, 560px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"584\" height=\"30\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-19.png\" alt=\"\" class=\"wp-image-1468\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-19.png 584w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/6-19-300x15.png 300w\" sizes=\"(max-width: 584px) 100vw, 584px\" \/><\/figure><\/div>\n\n\n\n<p>Later, it will send the information it has stolen to the same server.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/Imagen1.png\" alt=\"\" class=\"wp-image-1470\" width=\"805\" height=\"60\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/Imagen1.png 737w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/Imagen1-300x23.png 300w\" sizes=\"(max-width: 805px) 100vw, 805px\" \/><\/figure><\/div>\n\n\n\n<p>To launch each of the tasks the malware has its own commands that are defined in <strong>Class e<\/strong> and are launched (in their entirety) with <strong>Class d<\/strong>. In the following table you can see the relationship of these commands with each task.<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter is-style-regular\"><table><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">COMMAND<\/th><th class=\"has-text-align-center\" data-align=\"center\">FUNCTION<\/th><th class=\"has-text-align-center\" data-align=\"center\">RELATED CLASS<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">0xLO<\/td><td class=\"has-text-align-center\" data-align=\"center\">Location<\/td><td class=\"has-text-align-center\" data-align=\"center\">i<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xCL<\/td><td class=\"has-text-align-center\" data-align=\"center\">Call List<\/td><td class=\"has-text-align-center\" data-align=\"center\">b<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xMI<\/td><td class=\"has-text-align-center\" data-align=\"center\">Audio Recorder<\/td><td class=\"has-text-align-center\" data-align=\"center\">l<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xFI<\/td><td class=\"has-text-align-center\" data-align=\"center\">File Information<\/td><td class=\"has-text-align-center\" data-align=\"center\">g<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xSM<\/td><td class=\"has-text-align-center\" data-align=\"center\">SMS Information<\/td><td class=\"has-text-align-center\" data-align=\"center\">n<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xPM\/0xGP<\/td><td class=\"has-text-align-center\" data-align=\"center\">Package Permissions<\/td><td class=\"has-text-align-center\" data-align=\"center\">m<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xCO<\/td><td class=\"has-text-align-center\" data-align=\"center\">Contact List<\/td><td class=\"has-text-align-center\" data-align=\"center\">f<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xIN<\/td><td class=\"has-text-align-center\" data-align=\"center\">Package Information<\/td><td class=\"has-text-align-center\" data-align=\"center\">a<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xWI<\/td><td class=\"has-text-align-center\" data-align=\"center\">Wifi Information<\/td><td class=\"has-text-align-center\" data-align=\"center\">o<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">0xNO<\/td><td class=\"has-text-align-center\" data-align=\"center\">Notifications<\/td><td class=\"has-text-align-center\" data-align=\"center\">NotificationListener<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Finally, among one of the communications made by the malware, we noticed that it tried to download an application called <strong>Rozdhan<\/strong> using a goo.gl shorter.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/Imagen1-1.png\" alt=\"\" class=\"wp-image-1472\" width=\"387\" height=\"191\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/Imagen1-1.png 408w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/Imagen1-1-300x148.png 300w\" sizes=\"(max-width: 387px) 100vw, 387px\" \/><\/figure><\/div>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/2-1.png\" alt=\"\" class=\"wp-image-1473\" width=\"778\" height=\"54\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/2-1.png 666w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/2-1-300x21.png 300w\" sizes=\"(max-width: 778px) 100vw, 778px\" \/><\/figure><\/div>\n\n\n\n<p>The application is on Google Play and is used to earn money, has a referral system that is abused by the malware. The attacker installs it on the device and makes a profit.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/2-2.png\" alt=\"\" class=\"wp-image-1475\" width=\"542\" height=\"181\" srcset=\"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/2-2.png 567w, https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/2-2-300x100.png 300w\" sizes=\"(max-width: 542px) 100vw, 542px\" \/><\/figure><\/div>\n\n\n\n<figure class=\"wp-block-table aligncenter is-style-regular\"><table><thead><tr><th class=\"has-text-align-left\" data-align=\"left\"><strong>IOCs<\/strong><\/th><th><\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\">82[.]146.35.240<\/td><td>C2<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">e0eacd72afe39de3b327a164f9c69a78c9c0f672d3ad202271772d816db4fad8<\/td><td>SHA256<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">51ab555404b7215af887df3146ead5e44603be9765d39c533c21b5737a88f176<\/td><td>SHA256<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">hxxps:\/\/videos-share-rozdhan[.]firebaseio.com<\/td><td>URL<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">hxxp:\/\/ylink[.]cc\/fqCV3<\/td><td>URL<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">hxxp:\/\/d3hdbjtb1686tn.cloudfront[.]net\/gpsdk.html<\/td><td>URL<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">hxxp:\/\/da.anythinktech[.]com<\/td><td>URL<\/td><\/tr><tr><td class=\"has-text-align-left\" data-align=\"left\">akankdev2017@gmail[.]com<\/td><td>EMAIL SRC<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Customers with Lab52\u2019s APT intelligence private feed service already have more tools and means of detection for this campaign.<br>In case of having threat hunting service or being client of S2Grupo CERT, this intelligence has already been applied.<\/p>\n\n\n\n<p>If you need more information about Lab52\u2019s private APT intelligence feed service, you can contact us through the<a href=\"https:\/\/lab52.io\/contact\"> following link<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>During our analysis of the Penquin-related infrastructure we reported in our previous post, we paid special attention to the malicious binaries contacting these IP addresses, since as we showed in the analysis, they had been used as C2 of other threats used by Turla. One threat that makes contact with the 82.146.35[.]240 address in particular [&hellip;]<\/p>\n","protected":false},"author":20,"featured_media":1542,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[1],"tags":[49,53,52],"class_list":{"0":"post-1415","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-uncategorised","8":"tag-android","9":"tag-apk","10":"tag-stealer","11":"entry"},"featured_image_src":"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/7B12992810-85ab-4edd-a871-a89d409776ff7D.jpg","featured_image_src_square":"https:\/\/lab52.io\/blog\/wp-content\/uploads\/2022\/03\/7B12992810-85ab-4edd-a871-a89d409776ff7D.jpg","author_info":{"display_name":"Er1c_C","author_link":"https:\/\/lab52.io\/blog\/author\/er1c_c\/"},"_links":{"self":[{"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/posts\/1415"}],"collection":[{"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/users\/20"}],"replies":[{"embeddable":true,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/comments?post=1415"}],"version-history":[{"count":42,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/posts\/1415\/revisions"}],"predecessor-version":[{"id":1549,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/posts\/1415\/revisions\/1549"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/media\/1542"}],"wp:attachment":[{"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/media?parent=1415"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/categories?post=1415"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lab52.io\/blog\/wp-json\/wp\/v2\/tags?post=1415"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}