{"id":4501,"date":"2024-07-17T10:27:02","date_gmt":"2024-07-17T15:27:02","guid":{"rendered":"https:\/\/www.darkreading.com\/endpoint-security\/malicious-badpack-apk-files-android-malware"},"modified":"2024-07-17T10:27:02","modified_gmt":"2024-07-17T15:27:02","slug":"badpack-apk-files-make-android-malware-hard-to-detect","status":"publish","type":"post","link":"https:\/\/ddi.mohflo.net\/index.php\/2024\/07\/17\/badpack-apk-files-make-android-malware-hard-to-detect\/","title":{"rendered":"&#8216;BadPack&#8217; APK Files Make Android Malware Hard to Detect"},"content":{"rendered":"<div class=\"media_block\"><a href=\"https:\/\/i0.wp.com\/eu-images.contentstack.com\/v3\/assets\/blt6d90778a997de1cd\/bltbd48f49570344cc9\/6697916d36c9204b645f72f5\/mobilemalware_VladyslavYushynov_Alamy.jpeg?ssl=1\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?w=640&#038;ssl=1\" class=\"media_thumbnail\"><\/a><\/div>\n<div><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?w=640&#038;ssl=1\" class=\"ff-og-image-inserted\"><\/div>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;BadPack,&#8221; a set of maliciously packaged APK files that make it difficult for researchers to analyze and detect malware within Android applications, has come to light. It&#8217;s a key reason why they believe the prevalence of <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.darkreading.com\/endpoint-security\/chameleon-android-trojan-offers-biometric-bypass\" rel=\"noopener\">Android banking Trojans<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> and other malware such as TeaBot have surged in recent years, and continue to plague users of these devices.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">BadPack files contain maliciously altered header information in a compressed file format for APK files, &#8220;and typically pose a challenge for Android reverse-engineering tools,&#8221; Palo Alto Networks Unit 42&#8217;s Lee Wei Yeong <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/unit42.paloaltonetworks.com\/apk-badpack-malware-tampered-headers\/\" rel=\"noopener\">revealed<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> in a report published on July 16.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">In the last year, Unit 42&#8217;s telemetry detected almost 9,200 BadPack samples in Android apps, including on <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.darkreading.com\/endpoint-security\/google-play-spread-patchwork-apt-espionage-apps\" rel=\"noopener\">Google Play;<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> Google, however, says it has eliminated them from the mobile app store.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">BadPack could be a reason that security analysis of Android malware historically has been so difficult. &#8220;APK files using BadPack reflect the increasing sophistication of APK malware samples,&#8221; Yeong wrote. &#8220;This not only presents a <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.darkreading.com\/cloud-security\/billions-android-devices-open-dirty-stream-attack\" rel=\"noopener\">formidable challenge<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> for security analysts, but it also underscores the need for continuous development of innovative techniques and tools to identify and mitigate these threats.&#8221;<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">APK files are applications used by the <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.darkreading.com\/remote-workforce\/snowblind-tampering-technique-may-drive-android-users-adrift\" rel=\"noopener\">Android OS<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> that use the ZIP archive format and contain a file named AndroidManifest.xml that stores data and instructions for the archive&#8217;s content.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">In a BadPack APK file, however, attackers have tampered with its ZIP header data in a way that attempts to prevent analysis of its content. Unit 42 researchers found that &#8220;many&#8221; Android <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.darkreading.com\/threat-intelligence\/brata-android-malware-evolves-into-an-apt\" rel=\"noopener\">banking Trojans<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"> \u2014 among them <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/www.darkreading.com\/endpoint-security\/90-malicious-apps-55-million-downloads-google-play\" rel=\"noopener\">TeaBot (aka Anatsa)<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">, BianLian, and Cerberus \u2014 use BadPack, which have helped them infect Android devices with malware without being detected.<\/span><\/p>\n<h2 class=\"ContentText ContentText_variant_h2 ContentText_align_left\" data-testid=\"content-text\" id=\"How BadPack Prevents Malware Detection\">How BadPack Prevents Malware Detection<\/h2>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">AndroidManifest.xml provides essential information about a mobile app to the Android OS, including components to handle both activities initiated by the user and services run by the application. The manifest also includes the permissions users grant to apps so they run correctly, as well as the versions of Android that the app runs on.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">That said, the first step in static analysis of an APK sample is to read and process this manifest file, which is why it behooves malware authors to tamper with the file to make it difficult for security analysts to prevent this from happening.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">BadPack does this by tampering with the structure headers of the ZIP file, making the APK fail to extract and decode AndroidManifest.xml. &#8220;This causes a chain reaction of errors downstream in the static analysis pipeline,&#8221; Yeong wrote. &#8220;As a result, the file cannot be read and fully processed.&#8221;<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">There are a variety of ways that malware authors can manipulate these header values to fool common static analysis tools like Apktool or Jadx that are used to detect malware. These tools are &#8220;generally stricter than the Android system runtime on Android devices,&#8221; Yeong wrote.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;For these analysis tools, an APK sample must adhere to ZIP file format specifications,&#8221; he wrote. &#8220;Therefore, Apktool and Jadx parse both the local file header and central directory file header of the ZIP structure headers in an APK file.&#8221;<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Android devices are not as strict about the official file format as these analysis tools, however, so an APK file may contain invalid values that do not fully adhere to the official file format specification, and it may still run.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;This is because the Android system runtime only inspects the central directory file header,&#8221; Yeong wrote. &#8220;If a value from the local file header does not match, the Android runtime assumes what a correct value should actually be.&#8221;<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">This is the difference in behavior that causes tools like Apktool and Jadx to fail to analyze a BadPack APK sample that installs and runs properly without issue on an Android device, and thus allows Trojans and other malware that leverages BadPack to successfully infect a device, he said.<\/span><\/p>\n<h2 class=\"ContentText ContentText_variant_h2 ContentText_align_left\" data-testid=\"content-text\" id=\"BadPack Detection &amp; Prevention\">BadPack Detection &amp; Prevention<\/h2>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Unit 42 has found a way to analyze BadPack APK samples by reversing changes made to the header to restore the original ZIP structure header values before using APK analysis tools. The researchers also discovered that an open source tool called <\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\"><a class=\"ContentText-BodyTextChunk ContentText-BodyTextChunk_link\" target=\"_blank\" href=\"https:\/\/github.com\/erev0s\/apkInspector\" rel=\"noopener\">APK Inspector<\/a><\/span><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">, released last December, can successfully extract APK content and decode the Android manifest file even when BadPack is present, providing defenders a way to detect the malware.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">Other ways that Android users can prevent themselves from stealthy malware is to be suspicious of Android applications requiring unusual permissions not aligned with their advertised functionality, Yeong recommended. For example, it should be a red flag if something like an Android flashlight app requests permissions to access the device&#8217;s phonebook, he noted.<\/span><\/p>\n<p class=\"ContentParagraph ContentParagraph_align_left\" data-testid=\"content-paragraph\"><span class=\"ContentText ContentText_variant_bodyNormal\" data-testid=\"content-text\">&#8220;We recommend that people also refrain from installing applications that originate from third-party sources onto their devices,&#8221; Yeong added.<\/span><\/p>\n<p><a href=\"https:\/\/www.darkreading.com\/endpoint-security\/malicious-badpack-apk-files-android-malware\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;BadPack,&#8221; a set of maliciously packaged APK files that make<\/p>\n","protected":false},"author":12,"featured_media":4502,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[809],"class_list":["post-4501","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-dark-reading"],"featured_image_urls":{"full":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?fit=1920%2C1080&ssl=1",1920,1080,false],"thumbnail":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?resize=150%2C150&ssl=1",150,150,true],"medium":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?fit=300%2C169&ssl=1",300,169,true],"medium_large":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?fit=640%2C360&ssl=1",640,360,true],"large":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?fit=640%2C360&ssl=1",640,360,true],"1536x1536":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?fit=1536%2C864&ssl=1",1536,864,true],"2048x2048":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?fit=1920%2C1080&ssl=1",1920,1080,true],"chromenews-featured":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?fit=1024%2C576&ssl=1",1024,576,true],"chromenews-large":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?resize=825%2C575&ssl=1",825,575,true],"chromenews-medium":["https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?resize=590%2C410&ssl=1",590,410,true]},"author_info":{"display_name":"Dark Reading","author_link":"https:\/\/ddi.mohflo.net\/index.php\/author\/darkreading\/"},"category_info":"<a href=\"https:\/\/ddi.mohflo.net\/index.php\/category\/uncategorized\/\" rel=\"category tag\">Uncategorized<\/a>","tag_info":"Uncategorized","comment_count":"0","jetpack_featured_media_url":"https:\/\/i0.wp.com\/ddi.mohflo.net\/wp-content\/uploads\/2024\/07\/badpack-apk-files-make-android-malware-hard-to-detect.png?fit=1920%2C1080&ssl=1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/posts\/4501","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/comments?post=4501"}],"version-history":[{"count":0,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/posts\/4501\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/media\/4502"}],"wp:attachment":[{"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/media?parent=4501"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/categories?post=4501"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ddi.mohflo.net\/index.php\/wp-json\/wp\/v2\/tags?post=4501"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}