{"id":24300,"date":"2024-04-15T18:46:18","date_gmt":"2024-04-16T02:46:18","guid":{"rendered":"http:\/\/www.palada.net\/index.php\/2024\/04\/15\/news-18030\/"},"modified":"2024-04-15T18:46:18","modified_gmt":"2024-04-16T02:46:18","slug":"news-18030","status":"publish","type":"post","link":"https:\/\/www.palada.net\/index.php\/2024\/04\/15\/news-18030\/","title":{"rendered":"Smoke and (screen) mirrors: A strange signed backdoor"},"content":{"rendered":"<p><strong>Credit to Author: Matt Wixey| Date: Tue, 09 Apr 2024 19:08:05 +0000<\/strong><\/p>\n<div class=\"entry-content lg:prose-lg mx-auto prose max-w-4xl\">\n<p>In December 2023, Sophos X-Ops received a report of a false positive detection on an executable signed by a valid Microsoft Hardware Publisher Certificate. However, the version info for the supposedly clean file looked a little suspicious.<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-954635\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image1.png\" alt=\"A table of file version information, with the CompanyName listed as &quot;Catalog Thales&quot;\" width=\"465\" height=\"226\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image1.png 465w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image1.png?resize=300,146 300w\" sizes=\"auto, (max-width: 465px) 100vw, 465px\" \/><\/a><\/p>\n<p><em>Figure 1: Version info of the detected file. Note the typos \u2018Copyrigth\u2019 and \u2018rigths\u2019<\/em><\/p>\n<p>The file\u2019s metadata indicates that it is a \u201cCatalog Authentication Client Service\u201d by \u201cCatalog Thales \u201d \u2013 possibly an attempt to impersonate the legitimate company Thales Group. However, after digging into both our internal data and reports on VirusTotal, we discovered that the file was previously bundled with <a href=\"https:\/\/www.virustotal.com\/gui\/file\/0c73be16870f418d15f2e14846b1849532566cf2dce3b5dff5e358a9e6a0cc70\">a setup file<\/a> for a product named <a href=\"https:\/\/github.com\/Laixi-Develop\/Laixi_Setup\">LaiXi Android Screen Mirroring<\/a>, \u201ca marketing software\u2026[that] can connect hundreds of mobile phones and control them in batches, and automate tasks like batch following, liking, and commenting.\u201d<\/p>\n<p>It&#8217;s worth noting that while we can\u2019t prove the legitimacy of the LaiXi software \u2013 the GitHub repository has no code as of this writing, but contains a link to what we assume is the developer\u2019s website \u2013 we are confident that the file we investigated is a malicious backdoor.<\/p>\n<p>This isn\u2019t the first time Sophos X-Ops has seen threat actors abusing the Microsoft Windows Hardware Compatibility Program (WHCP). In December 2022, almost exactly a year before conducting this research, <a href=\"https:\/\/news.sophos.com\/en-us\/2022\/12\/13\/signed-driver-malware-moves-up-the-software-trust-chain\/\">we reported that attackers had deployed cryptographically-signed drivers<\/a> in a failed attempt to disable Sophos endpoint security products. Those drivers, variants of <a href=\"https:\/\/www.mandiant.com\/resources\/blog\/unc2596-cuba-ransomware\">BURNTCIGAR\/POORTRY<\/a> (an EDR killer sold on criminal forums and linked to ransomware gangs such as LockBit and CUBA) were signed with a legitimate WHCP certificate. However, other than the abuse of WHCP, we didn\u2019t observe any evidence that the December 2023 backdoor is in any way linked to that earlier EDR killer.<\/p>\n<p>Just as we did in 2022, we immediately reported our findings to the Microsoft Security Response Center. After validating our discovery, the team at Microsoft has added the relevant files to its <a href=\"https:\/\/support.microsoft.com\/en-gb\/topic\/kb5029033-notice-of-additions-to-the-windows-driver-stl-revocation-list-d330efa5-3fb7-4903-9f0b-3230d31fca38\">revocation list<\/a> (updated today as part of the usual Patch Tuesday cycle; see CVE-2024-26234).<\/p>\n<p>While writing this article, which is based on our independent research into this backdoor in December 2023, we became aware that Stairwell had published <a href=\"https:\/\/stairwell.com\/resources\/signed-sealed-but-not-always-secure-rethinking-trust-in-digitally-signed-certificates\/\">its own article<\/a> on this topic in January 2024, based on information in <a href=\"https:\/\/twitter.com\/jaydinbas\/status\/1742155413200507358\">a tweet by Johann Aydinbas<\/a> (also in January 2024). Our research validates and expands on some of those findings.<\/p>\n<h1>Picking up the trail<\/h1>\n<p>As noted above, the threat actor behind the malicious file managed to obtain a Microsoft Windows Hardware Compatibility Publisher signature from Microsoft, so we started our analysis from there.<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-954636\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image2.png\" alt=\"A screenshot of certificate information from Catalog.exe, showing WHCP as the signer\" width=\"640\" height=\"451\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image2.png 812w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image2.png?resize=300,211 300w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image2.png?resize=768,541 768w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><em>Figure 2: Signature of Catalog.exe<\/em><\/p>\n<p><a href=\"https:\/\/learn.microsoft.com\/en-us\/windows-hardware\/drivers\/install\/authenticode\">Authenticode<\/a> is a Microsoft code-signing security measure, which identifies the publisher of an application and provides verification that the application hasn\u2019t been modified since it was signed and published. Fortunately, Microsoft provides <a href=\"https:\/\/learn.microsoft.com\/en-us\/previous-versions\/troubleshoot\/windows\/win32\/get-information-authenticode-signed-executables\">code snippets<\/a> on how to process these signatures and extract further metadata from them. One of the pieces of information we were able to extract was the original requesting publisher.<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-954637\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image3.png\" alt=\"A screenshot from a Windows command-line showing output from the AuthenticodeParse.exe tool on Catalog.exe, showing WHCP in the signer certificate information\" width=\"588\" height=\"146\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image3.png 588w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image3.png?resize=300,74 300w\" sizes=\"auto, (max-width: 588px) 100vw, 588px\" \/><\/a><\/p>\n<p><em>Figure 3: Extracting the original requesting publisher from the malicious file<\/em><\/p>\n<p>In this case, the original requesting publisher is Hainan YouHu Technology Co. Ltd, which is also shown as the publisher of the LaiXI software.<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-954638\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image4.png\" alt=\"A screenshot of the LaiXi website. The company name is highlighted in a red box on the bottom-right\" width=\"640\" height=\"351\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image4.png 1449w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image4.png?resize=300,165 300w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image4.png?resize=768,421 768w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image4.png?resize=1024,562 1024w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><em>Figure 4: Hainan YouHu Technology Co. Ltd is also shown as the publisher of the LaiXi application<\/em><\/p>\n<p>We have no evidence to suggest that the LaiXi developers deliberately embedded the malicious file into their product, or that a threat actor conducted a supply chain attack to insert it into the compilation\/building process of the LaiXi application. However, we will note that given the links between LaiXi and the malicious backdoor we investigated \u2013 and the length of time those links have existed (since at least January 2023, as we\u2019ll discuss shortly) \u2013 users should exercise extreme caution when it comes to downloading, installing, and using LaiXi.<\/p>\n<h1>Technical analysis<\/h1>\n<p>The suspicious file embeds a tiny freeware proxy server, called <a href=\"https:\/\/github.com\/3proxy\/3proxy\">3proxy<\/a> \u2013 a sketchy feature for an authentication client. We assess that this embedded binary is intended to monitor and intercept network traffic on an infected system.<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-954631\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image5.png\" alt=\"A screenshot from a disassembly of the malware, with the strings &quot;3proxy&quot; highlighted in yellow\" width=\"640\" height=\"211\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image5.png 768w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image5.png?resize=300,99 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><em>Figure 5: Strings relating to the embedded proxy server within the malware<\/em><\/p>\n<p>When the file executes, it installs itself as a service called \u2018CatalogWatcher\u2019, with a service description of \u2018Google ADB LoaclSocket [sic] Multi-threading Graphics API\u2019 \u2013 a complete mismatch for the file version information shown in Figure 1. While we can\u2019t confirm it, we assess that this is connected to link to a setup file for the LaiXi Android software, and an attempt to trick infected users into believing that the service is legitimate.<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-954632\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image6.png\" alt=\"A screenshot from a disassembly of the malware\" width=\"563\" height=\"515\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image6.png 563w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image6.png?resize=300,274 300w\" sizes=\"auto, (max-width: 563px) 100vw, 563px\" \/><\/a><\/p>\n<p><em>Figure 6: The function for creating the CatalogWatcher service<\/em><\/p>\n<p>Once the service runs, the malware queues a new work item\/thread via QueueUserWorkItem to the threadpool. Once the process has enough resources available, the malicious thread starts. This thread embeds the core functionality of the backdoor itself.<\/p>\n<p>Interestingly, this function starts with an attempt to call the function VmProtectBeginVirtualization(), which is an export of the VMProtectSDK32.DLL by VMProtect.<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-954633\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image7.png\" alt=\"A screenshot from a disassembly of the malware\" width=\"609\" height=\"253\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image7.png 609w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image7.png?resize=300,125 300w\" sizes=\"auto, (max-width: 609px) 100vw, 609px\" \/><\/a><\/p>\n<p><em>Figure 7: Start of function for C2 communication<\/em><\/p>\n<p>As per <a href=\"https:\/\/vmpsoft.com\/vmprotect\/user-manual\/\">the VMProtect user manual<\/a>, this function is used to define areas of code to protect via obfuscation and virtualization. Legitimate software developers often use virtual machine-based code protection to help prevent applications from being reverse-engineered \u2013 but threat actors also abuse it to try and thwart malware analysis. For more detail on reverse-engineering applications that use virtual machine-based protection, see <a href=\"https:\/\/malwareandstuff.com\/taming-virtual-machine-based-code-protection-1\/\">a blog I wrote on my personal site<\/a> a few years ago. In this case, the function is not properly obfuscated. We conclude that the threat actor may have intended to do this, but failed for some unknown reason.<\/p>\n<p>We also note that the POORTRY\/BURNTCIGAR samples we reported to Microsoft in December 2022 were packed with VMProtect. Back then, we already suspected that the attackers were using commercial packers such as Armadillo or VMProtect to hide the software\u2019s malicious intent and get their drivers signed. It is possible that the threat actor behind this backdoor was attempting to do the same (although we should point out that the use of obfuscation, packers, and virtualization \u2013 including VMProtect \u2013 is very common across many malware developers).<\/p>\n<p>The C2 server string \u201ccatalog[.]micrisoftdrivers[.]com\u201d \u2013 a lookalike domain of microsoftdrivers[.]com &#8211; is decrypted via a simple XOR operation. A Python reimplementation of the decryption routine is below:<\/p>\n<pre># Decrypts to catalog[.]micrisoftdrivers[.]com  s = \"c`vbhja)e`iye~aidu`zbpdd6zuv\"  cc = \"\"  i = 0  while i &lt; len(s):      ch = chr((ord(s[i]) ^ i))      cc += ch      i += 1<\/pre>\n<h1>Threat hunting<\/h1>\n<p>Finally, we wanted to determine if the threat actor had embedded the same payload into other products. We checked both our own telemetry and other sources, but saw no evidence that the backdoor has been bundled with anything other than LaiXi. We did, however, find multiple other variants \u2013 some of which were linked to a file named \u2018Laixi_Update_1.0.6.7_b.exe\u2019, indicating that other files, not just the setup installer, contain the malicious backdoor.<\/p>\n<p>We\u2019ve classified all the samples we discovered into four groups, based on the compilation timestamp.<\/p>\n<p><a href=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-954634\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image8.png\" alt=\"A timeline showing the four categories of samples based on compilation timestamps\" width=\"640\" height=\"361\" srcset=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image8.png 1285w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image8.png?resize=300,169 300w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image8.png?resize=768,433 768w, https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/image8.png?resize=1024,578 1024w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n<p><em>Figure 8: The four groups of samples and their chronological classifications<\/em><\/p>\n<p>While the compilation timestamp of a PE file can be faked, we looked at the time delta between the moment the file was compiled and the time it initially appeared in our systems, and assess that the compilation stamps are likely genuine.<\/p>\n<ul>\n<li>The first variant contains a compilation time of 2023-01-05. We therefore assess that this campaign has been in development since at least January 2023<\/li>\n<li>The second variant contains a compilation timestamp of 2023-01-11. This is also the first sample that managed to obtain a WHCP certificate<\/li>\n<li>The third group of samples, with a compilation timestamp of 2023-03-19, were either signed by the WHCP certificate, or unsigned. Some of these samples are associated with the Laixi_Update_1.0.6.7_b.exe file mentioned above<\/li>\n<li>The final group shares a compilation timestamp of 2023-10-08. Interestingly, two samples of this group were signed by a different signer, although as of this writing we haven\u2019t been able to ascertain any further information on these signers, or identify any other samples signed by them.<\/li>\n<\/ul>\n<p><em>Table 1: A summary of all the samples we discovered, including their compilation timestamp and signer<\/em><\/p>\n<p>IoCs relating to this incident are <a href=\"https:\/\/github.com\/sophoslabs\/IoCs\/blob\/master\/3proxy-backdoor-IOCs.csv\">available on our GitHub repository.<\/a> The Sophos protection Mal\/Proxcat-A protects against this malware and the variants we discuss here.<\/p>\n<h1>Acknowledgments<\/h1>\n<p>Sophos X-Ops would like to thank Richard Cohen, Andrew Ludgate (SophosLabs), and Sean Gallagher (Sophos X-Ops) for their help in analyzing the samples; and Microsoft for engaging with us to help protect users.<\/p>\n<\/p><\/div>\n<p><a href=\"https:\/\/news.sophos.com\/en-us\/2024\/04\/09\/smoke-and-screen-mirrors-a-strange-signed-backdoor\/\" target=\"bwo\" >http:\/\/feeds.feedburner.com\/sophos\/dgdY<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/news.sophos.com\/wp-content\/uploads\/2024\/04\/shutterstock_767658412.jpg\"\/><\/p>\n<p><strong>Credit to Author: Matt Wixey| Date: Tue, 09 Apr 2024 19:08:05 +0000<\/strong><\/p>\n<p>Sophos X-Ops discovers a curious backdoored (and signed) executable, masquerading as something else entirely<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[10378,10377],"tags":[10836,11476,129,12141,27030,16771],"class_list":["post-24300","post","type-post","status-publish","format-standard","hentry","category-security","category-sophos","tag-backdoor","tag-certificate","tag-featured","tag-proxy","tag-sophos-x-ops","tag-threat-research"],"_links":{"self":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/24300","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/comments?post=24300"}],"version-history":[{"count":0,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/posts\/24300\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/media?parent=24300"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/categories?post=24300"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.palada.net\/index.php\/wp-json\/wp\/v2\/tags?post=24300"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}