Adversaries don’t work 9-5 and neither do we. At eSentire, our 24/7 SOCs are staffed with Elite Threat Hunters and Cyber Analysts who hunt, investigate, contain and respond to threats within minutes.
We have discovered some of the most dangerous threats and nation state attacks in our space – including the Kaseya MSP breach and the more_eggs malware.
Our Security Operations Centers are supported with Threat Intelligence, Tactical Threat Response and Advanced Threat Analytics driven by our Threat Response Unit – the TRU team.
In TRU Positives, eSentire’s Threat Response Unit (TRU) provides a summary of a recent threat investigation. We outline how we responded to the confirmed threat and what recommendations we have going forward.
Here’s the latest from our TRU Team…
What did we find?
In April 2024, eSentire’s Threat Response Unit (TRU) detected the FakeBat loader being distributed through compromised websites. These websites contain injected malicious JavaScript that triggers fake browser update notifications, misleading users into believing they need to install legitimate browser updates.
This campaign has evolved from previous methods by fetching malicious links directly from Pastebin and a linked domain, bypassing older techniques that used embedded links on Telegra[.]ph.
Fake browser updates have been responsible for numerous malware infections, including those of the well-known SocGholish. In 2023, ClearFake emerged, distributing the Amadey modular loader via similar fake update mechanisms.
The infection chain started when the user visited the infected webpage (Figure 1).
Upon loading the compromised page, the injected malicious JavaScript code triggers, which leads the user to the fake update page.
Prior to displaying the landing page, the function “can(callback)” sends a GET request to a server to check if it should be displayed. This is determined based on the server’s response:
- If the server returns true (“1”), it will call back (true), indicating that the necessary condition is met, and the landing page is displayed.
- If the server returns a “false” response, the landing page is prevented from rendering (Figure 3).
The “sendUpdateCounterRequest()” function could be used as part of a strategy to control the exposure of a malicious page based on a visit counter. For example, the server tracks the number of hits to deactivate the landing page display once a preset threshold is reached.
This can be a tactic to evade detailed scrutiny once the page gets spotted by security professionals or automated systems (Figure 4).
The “insertScript” function sets up the conditions and environment where a landing or phishing page might be displayed to the user. The function dynamically alters the visibility and content of iframes on the page. It inserts a new iframe that covers the entire view, effectively creating a new “landing page” within the iframe.
This new content serves as a fake browser landing page, misleading users into thinking they are interacting with a legitimate site. The script retrieves the data from doggygangers[.]com/YfMv2QsjpCQl845BWSYNfNOQitweyze_Z6lIlrRr43MRjX_HrM/stats/get_stats.php.
If the data is not empty, the entire content of the body is replaced by inserting a new iframe (the contents of the response shown in Figure 5) that covers the whole viewport and serves as a fake update landing page.
If the data is empty, indicating that “isLand” returns false, a new iframe is inserted into a cleared document body as specified by the srcdoc attribute. This might serve as a fallback mechanism.
The contents of this srcdoc are similar to those retrieved from doggygangers[.]com/YfMv2QsjpCQl845BWSYNfNOQitweyze_Z6lIlrRr43MRjX_HrM/land/universal_land/.
However, the content from the latter includes additional comments; one such comment contains the misspelled Russian word for “content.” The phrase “Новое содеccccржимое” is intended to mean “new content” (Figure 6).
Let’s analyze the content of the main malicious script – the landing page. When the landing page loads, the script checks the user’s browser type by examining the “userAgent” string. This helps the script identify which browser the user uses (e.g., Chrome, Firefox, Edge, Opera).
Based on the detected browser, the script sets variables like “browserName” and “logoSrc”. The “logoSrc” is obtained by decoding a Base64 string corresponding to an image URL, which is the logo of the detected browser. This personalization makes the fake update page reflect the user’s current browser.
The script dynamically inserts the browser’s logo and modifies text elements on the page to reflect the browser’s name, which reinforces the deception. The function “replaceTextByLanguage(lang)” is responsible for displaying the text content of a fake update landing page based on the user’s browser language settings (Figure 7).
Next, the script fetches the content from a PHP script on the server (get_download_file_name.php), which further contains another PHP script doggygangers.com/YfMv2QsjpCQl845BWSYNfNOQitweyze_Z6lIlrRr43MRjX_HrM/downloadsdownloadfile/dwnl_standart[.]php.
The PHP script redirects the user to the final page serving FakeBat MSIX payload named “UpdateSetup-x86” (MD5: 569d206636b75c33240ba4c1739c04d6) (Figure 8).
It’s worth mentioning that the MSIX file is signed with “Consoneai Ltd”, the same signature was previously used by FakeBat on other MSIX payloads (MD5: 06165e8da7bf1b22962c8272f19d707f).
FakeBat
Unlike the campaign we analyzed in our previous blog, this campaign no longer embeds malicious links within Telegra[.]ph pages. Instead, it directly retrieves them from Pastebin and another website (seacraftsgallery[.]com).
Notably, the IP address of this other website is also associated with the domain hosting the landing page, doggygangers[.]com. The content of the Pastebin link includes code to bypass AMSI (Antimalware Scan Interface) (Figure 9).
Interestingly, if we investigate the author of the Pastebin paste, we find the handle “[email protected]” (Figure 10). This handle was also associated with the creation of malicious PowerShell payloads on the HuggingFace platform back in 2022, as mentioned in our previous blogs.
The rest of the infection steps are similar to our previous analysis, with Payk RunPE dropping LummaC2.
The FakeBat campaign showcases a sophisticated phishing tactic using fake browser updates, likely orchestrated by various threat actors who have acquired the FakeBat loader. Initially spread through Google ads, this threat has expanded its reach by employing fake updates.
What did we do?
Our 24/7 SOC Cyber Analysts investigated the suspicious activities, notified the client, and isolated the affected device.
What can you learn from this TRU Positive?
- The FakeBat campaign implements sophisticated social engineering by mimicking legitimate browser update prompts that match the user’s browser type and language.
- This targeted approach indicates the need for increased user awareness about the authenticity of update notifications and the sources from which updates are downloaded.
- The use of server-side logic to determine whether or not to display a malicious page, based on a visit counter, highlights a method by which attackers can manage their campaigns to evade detection.
- This underscores the importance of real-time monitoring and adaptive security defenses to counteract dynamic threat behaviors.
- The detailed analysis of the infection chain and the use of specific PHP scripts to ultimately serve the FakeBat MSIX payload illustrates the layered nature of the malware distribution networks.
- This calls for advanced endpoint protection solutions that can detect and block such multi-stage attack vectors.
Recommendations from our Threat Response Unit (TRU) Team:
Indicators of Compromise
You can access the indicators of compromise here.
References
Source: Original Post