BatLoader Continues to Abuse Google Search Ads to Deliver Vidar…

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 December, we published
a summary of BatLoader activity whereby Google Search Ads were used to impersonate software such as WinRAR to deliver malicious Windows Installer files. The installer files contained custom action commands which used PowerShell to download and execute payloads (Redline Stealer, Ursnif, etc.) hosted on legitimate websites.

Throughout February 2023, TRU has observed a series of newly registered websites impersonating various applications and brands. Included among these are:

  • ChatGPT (chatgpt-t[.]com)
  • Zoom (zoomvideor[.]com)
  • Spotify (spotify-uss[.]com)
  • Tableau (tableau-r[.]com)
  • Adobe (adobe-l[.]com)

In addition to comparable domain registration attributes, these websites tend to follow a similar naming convention where one or more characters are appended to the impersonated brand name (e.g., adobe-l[.]com vs adobe.com). These sites were used to host imposter download pages and all likely stem from malicious advertisements on Google Search Ads. A more complete list can be found at the end of this post.

BatLoader continues to see changes and improvement since it first emerged in 2022. Recent samples analyzed by TRU utilize Windows Installer files masquerading as the above applications to launch embedded Python scripts.

BatLoader’s Python Loader

In mid-February 2023, eSentire MDR for
Endpoint blocked an attempt to execute Ursnif via code injection on a
manufacturing customer’s endpoint. A subsequent investigation traced the
infection to a Google search result for Adobe Reader by the victim user.

The user had clicked on a top-of-page ad on the search
results page where they were directed via an intermediary website (adolbe[.]website) to adobe-e[.]com, a webpage masquerading as Adobe Acrobat Reader (Figure 1). As a
result, the user unknowingly downloaded and executed AdobeSetup.msi(9ebbe0a1b79e6f13bfca014f878ddeec), BatLoader’s Windows Installer file.

Figure 1 adobe-e[.]com, Adobe Acrobat Reader lookalike webpage.

Like previous versions of BatLoader, the MSI file contains
Custom Actions to execute commands. In this case, the command executed an
embedded batch file (seen here as InstallPython.bat,
also observed as PythonFramework.bat) with admin
privileges in a hidden window.

A decoy application was written to C:Program Files (x86)Chat
Mapper
along with BatLoader scripts and supporting files (Figure 2).

Figure 2 BatLoader Python scripts and supporting files.

The batch file (figure 3, insert) performs the following actions:

  1. Installs Python 3.9.9 using an included setup binary.
  2. Uses pip to install pywin32 and wmi packages.
  3. Unpacks the compressed OpenSSL library files using PowerShell into multiple locations.
  4. Starts two Python files in sequence after a short timeout.
Figure 3 Batch file execution via Windows Installer custom action.

BatLoader’s Python Files

In this case, two Python files (framework.py and frameworkb.py) were included in the package. These were protected using PyArmor and require unpacking with tools such as PyArmor-Unpacker (Figure 4). The files use a script copied from a Stack Overflow question as a template for executing Python code with elevated privileges.

Figure 4 Decoded Python Loader “framework.py”

BatLoader’s instruction set is inserted into the main function of the Stack Overflow Python script. The code retrieves an encrypted payload as control.exe.enc then executes a series of Windows commands. The instructions executed by both Python files were nearly identical except for a change in the payload URL.

The commands shown in Figure 5 are summarized as follows:

  1. Download encrypted payload control.exe.enc from https://shvarcnegerhistory[.]com/ The payload is saved under %appdata% or %userprofile%.
  2. Modify Defender settings to exclude paths, processes, and file extensions.
  3. Decrypt control.exe.enc using the OpenSSL library installed by the previous batch file. The password tor9232jds is used and the file is saved as control.exe.
  4. WorkFolders.exe is called, leveraging a signed execution LOLBAS technique to execute control.exe.
Figure 5 Windows commands from “framework.py” and “frameworkb.py”, summarized

In the above-mentioned case, the payload intercepted by MDR for Endpoint was Ursnif (md5hash 0cb75b1192b23b8e03d955f1156ad19e), specifically isfb_v2.14+ variant configured to connect to the following C2 domains:

  • uelcoskdi[.]ru
  • iujdhsndjfks[.]ru
  • isoridkf[.]ru
  • gameindikdowd[.]ru
  • jhgfdlkjhaoiu[.]su
  • reggy506[.]ru
  • reggy914[.]ru

Ursnif’s persistence was achieved using a registry run key (VirtualStop) under HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionRun. This value executed a shortcut (LineType.lnk) which in turn launches a PowerShell script (CharReturn.ps1), as seen in Figure 6.

Figure 6 CharReturn.ps1

CharReturn.ps1 executed a staged
PowerShell loader from registry at HKEY_USERSSoftwareAppDataLowSoftwareMicrosoft[randomstring]. The loader contained
the embedded Ursnif binary which is injected into the Explorer process.

In this incident, MDR for Endpoint identified and blocked PowerShell
execution of the Ursnif loader stored in registry.

Other Batloader Observations

Observed URL structures would suggest multiple payloads are available for download:

  • /t1s1j1/index/c1/?servername=msi
  • /t1s1j1/index/c2/?servername=msi
  • /t1s1j1/index/c3/?servername=msi
  • /t1s1j1/index/c4/?servername=msi
  • /t1s1j1/index/b1/?servername=msi

BatLoader has historically been linked to payloads such as Redline Stealer, SystemBC RAT, Syncro RMM, Vidar Stealer, Ursnif and Cobalt Strike. Analysis of more recent samples in March 2023 has yielded both Vidar Stealer and Ursnif trojans.

TRU has reviewed samples from public malware repositories which exhibited slightly different behavior than what was seen in the February incident described above. This sample from mid-February contained a third Python file named ‘networkframework.py’:

Figure 7 BatLoader’s batch file containing a third Python file “networkframework.py”

Like the others, it is obfuscated with PyArmor and contains an identical series of commands to handle payload retrieval, decryption and execution via WorkFolder.exe. In addition, netframework.py contains checks for curating payloads for domain-joined systems with more than 2 IP neighbors in the system’s ARP table.

Figure 8 Snippet of BatLoader Python script showing system profiling.

This behavior has been previously observed whereby BatLoader executed Cobalt Strike in addition to the standard payloads such as Ursnif or Vidar. We assess this is done to prep systems residing in business networks for further infiltration.

As of time of writing, the payload URLs were no longer available for retrieval, but given that this fits into BatLoader’s known historical target selection patterns, we assess that Cobalt Strike is the probable candidate.

How did we find it?

  • eSentire MDR for Endpoint
    identified and blocked BatLoader’s payload execution.

What did we do?

  • Our team of 24/7 SOC Cyber Analysts investigated the blocked behavior and worked with the customer on remediating the system.

What can you learn from this TRU positive?

  • Use of Google Search Ads by various malware families has been widely observed in early 2023. We wrote about this tactic in a previous TRU Positive post.
    • Despite overall observations diminishing in February 2023, BatLoader’s use continues to persist. This assertion is supported by observations in our own telemetry but also by the continued registration of website infrastructure throughout the month of February.
  • BatLoader targets various popular applications for impersonation, such as ChatGPT, Zoom, Adobe, AnyDesk, Microsoft Teams, Java, etc. This is no accident, as these applications are commonly found in business networks and thus, they would yield more valuable footholds for monetization via fraud or hands-on-keyboard intrusions.
  • Cobalt Strike, a known BatLoader payload, enables hands-on-keyboard access to footholds and facilitates network intrusion actions. BatLoader should be considered a precursor threat to ransomware and any observation prioritized for treatment.

Recommendations from our Threat Response Unit (TRU) Team:

  • Raise awareness of malware masquerading as legitimate applications, and include relevant examples within your Phishing and Security Awareness Training (PSAT) program to educate your employees on how to protect themselves against similar cyber threats.
    • Remember – an effective PSAT program emphasizes building cyber resilience by increasing risk awareness, rather than trying to turn everyone into security experts.
  • Protect endpoints against malware.

Indicators of Compromise

Suspected BatLoader Domains Registered in February 2023:

Domain Creation Date
chatgpt-t[.]com 2023-02-28
zoomvideor[.]com 2023-02-27
adobe-l[.]com 2023-02-22
freecad-l[.]com 2023-02-22
microso-t[.]com 2023-02-22
spotify-uss[.]com 2023-02-21
quickbooks-q[.]com 2023-02-21
freecad-f[.]com2 2023-02-20
java-s[.]com 2023-02-13
adobe-e[.]com 2023-02-13
anydesk-o[.]com 2023-02-13
anydesk-r[.]com 2023-02-09
java-r[.]com 2023-02-09
tableau-r[.]com 2023-02-09
java-a[.]com 2023-02-07
basecamp-a[.]com 2023-02-07
adobe-a[.]com 2023-02-03
visualstudio-t[.]com 2023-02-03
openoffice-a[.]com 2023-02-03
bitwarden-t[.]com 2023-02-01
gimp-t[.]com 2023-02-01
figma-t[.]com6 2023-02-01

Other Indicators of Compromise

Indicator Note
3db1edc5b5550f54abdcb5520cf91d75 Vidar
0cb75b1192b23b8e03d955f1156ad19e Ursnif
85fbc743bb686688ce05cf3289507bf7 Ursnif
11ae3dabdb2d2458da43558f36114acb AdobeSetup.msi (BatLoader)
9ebbe0a1b79e6f13bfca014f878ddeec AdobeSetup.msi (BatLoader)
shvarcnegerhistory[.]com BatLoader C2
Pixelarmada[.]su BatLoader C2
uelcoskdi[.]ru Ursnif C2
iujdhsndjfks[.]ru
isoridkf[.]ru
gameindikdowd[.]ru
jhgfdlkjhaoiu[.]su
reggy506[.]ru
reggy914[.]ru

eSentire’s Threat Response Unit (TRU) is a world-class team of threat researchers who develop new detections enriched by original threat intelligence and leverage new machine learning models that correlate multi-signal data and automate rapid response to advanced threats.

If you are not currently engaged with an MDR provider, eSentire MDR can help you reclaim the advantage and put your business ahead of disruption.

Learn what it means to have an elite team of Threat Hunters and Researchers that works for you. Connect with an eSentire Security Specialist.

Source: https://www.esentire.com/blog/batloader-continues-to-abuse-google-search-ads-to-deliver-vidar-stealer-and-ursnif