Security Market Segment LS
Friday, 23 August 2024 21:10

Beyond the wail: deconstructing the BANSHEE infostealer

By Elastic Security Labs

GUEST RESEARCH - The BANSHEE malware is a macOS-based infostealer that targets system information, browser data, and cryptocurrency wallets.

Preamble

In August 2024, a novel macOS malware named "BANSHEE Stealer" emerged, catching the attention of the cybersecurity community. Reportedly developed by Russian threat actors, BANSHEE Stealer was introduced on an underground forum and is designed to function across both macOS x86_64 and ARM64 architectures.

This malware presents a severe risk to macOS users, targeting vital system information, browser data, and cryptocurrency wallets.

With a steep monthly subscription price of $3,000, BANSHEE Stealer stands out in the market, particularly compared to known stealers like AgentTesla.

As macOS increasingly becomes a prime target for cybercriminals, BANSHEE Stealer underscores the rising observance of macOS-specific malware. This analysis explores the technical details of BANSHEE Stealer, aiming to help the community understand its impact and stay informed about emerging threats.

Key takeaways

  • BANSHEE Stealer highlights the growing number of macOS malware samples as the OS becomes a more attractive target for cyber threats.
  • BANSHEE Stealer's $3,000 monthly price is notably high compared to Windows-based stealers.
  • BANSHEE Stealer targets a wide range of browsers, cryptocurrency wallets, and around 100 browser extensions, making it a highly versatile and dangerous threat.

Malware Analysis 

The malware we analysed in this research contained all the C++ symbols, which is interesting as we can guess the project's code structure by knowing these source code file names, as seen in the picture below. Looking into the C++-generated global variable initialisation functions, we can find values set automatically/manually by the user during the build process, like the remote IP, encryption key, build ID, etc.

2

 

Functions list that initialise the global variables of every source file 

The following table summarises the leaked .cpp file names through the symbols in the binary.

File name

Description

 

Controller.cpp

Manages core execution tasks, including anti-debugging measures, language checks,data collection, and exfiltration.

 Debugger, VM Detection, and Language Checks           

Browsers.cpp

Handles the collection of data from various web browsers.

 

System.cpp

Executes AppleScripts to gather system information and perform password phishing.

 

Tools.cpp

Provides utility functions for encryption, directory creation, and compression etc.

 

Wallets.cpp

Responsible for collecting data from cryptocurrency wallets.

 

 

 

 3Checking for debugging, Virtualisation, and the language of the machine

 

BANSHEE Stealer uses basic techniques to evade detection. It detects debugging by utilising the sysctl API.

 4Debugging detection with sysctl macOS API

For virtualisation detection, it runs the command system_profiler SPHardwareDataType | grep 'Model Identifier' to determine whether the string Virtual appears in the hardware model identifier, which suggests a virtual machine. These methods are relatively simple and can be easily circumvented by advanced sandboxes and malware analysts.

5Virtual machine check

Additionally, It parses the user-preferred canonicalised language returned from the CFLocaleCopyPreferredLanguages API and looks for the string ru. This tactic helps the malware avoid infecting systems where Russian is the primary language.

System information collection 

User password 

The malware creates an Osascript password prompt with a dialog saying that to launch the application, you need to update the system settings. Please enter your password.

When the user enters the password, it will be validated using the dscl command by running dscl Local/Default -authonly <username> <password>

If valid, the password will be written to the following file /Users/<username>/password-entered.

6User password phishing through a prompt

These credentials can be leveraged to decrypt the keychain data stored on the system, granting access to all saved passwords.

File, software, and hardware information collection 

The function System::collectSystemInfo collects system information and serialises it in a JSON object. It executes the command system_profiler SPSoftware DataType SPHardwareDataType, which provides details about the system’s software and hardware. It gets the machine's public IP by requesting it from freeipapi.com through the built-in macOS cURL command.

The JSON file will be saved under <temporary_path>/system_info.json

BANSHEE stealer executes AppleScripts; interestingly, it writes the AppleScripts to the same file /tmp/tempAppleScript.

The first script to be executed first mutes the system sound with osascript -e 'set volume with output muted' command. It then collects various files from the system, which are listed below:

  • Safari cookies
  • Notes database
  • Files with the following extensions .txt.docx.rtf.doc.wallet.keys, or .key from the Desktop and Documents folders.

Dump keychain passwords 

It copies the keychain of the system /Library/Keychains/login.keychain db to <temporary_path>/Passwords

Browser collection 

BANSHEE collects data from 9 different browsers currently, including browser history, cookies, logins, etc:

  • Chrome
  • Firefox
  • Brave
  • Edge
  • Vivaldi
  • Yandex
  • Opera
  • OperaGX

Regarding Safari, only the cookies are collected by the AppleScript script for the current version.

7Web browser file collection

Additionally, data from approximately 100 browser plugins are collected from the machine. A list of these extension IDs is provided at the end of the blog post.

The collected files are saved under <temporary_path>/Browsers.

Wallet collection

  • Exodus
  • Electrum
  • Coinomi
  • Guarda
  • Wasabi Wallet
  • Atomic
  • Ledger

The collected wallets are stored under <temporary_path>/Wallets.

Exfiltration 

After the malware finishes collecting data, it first ZIP compresses the temporary folder using the ditto command. The zip file is then XOR encrypted and base64 encoded and sent through a post request to the URL: https://45.142.122[.]92/send/ with the built-in cURL command.

8Xor and base64 encoding of the zip file to be exfiltrated

 Behavior detection

YARA rule

Elastic Security has created YARA rules to identify this activity. Below are YARA rules to identify the BANSHEE malware:

rule Macos_Infostealer_Banshee {

    meta:

        author = "Elastic Security"

        creation_date = "2024-08-13"

        last_modified = "2024-08-13"

        os = "MacOS"

        arch = "x86, arm64"

        category_type = "Infostealer"

        family = "Banshee"

        threat_name = "Macos.Infostealer.Banshee"

        license = "Elastic License v2"

    strings:

        $str_0 = "No debugging, VM, or Russian language detected." ascii fullword

        $str_1 = "Remote IP: " ascii fullword

        $str_2 = "Russian language detected!" ascii fullword

        $str_3 = " is empty or does not exist, skipping." ascii fullword

        $str_4 = "Data posted successfully" ascii fullword

        $binary_0 = { 8B 55 BC 0F BE 08 31 D1 88 08 48 8B 45 D8 48 83 C0 01 48 89 45 D8 E9 }

        $binary_1 = { 48 83 EC 60 48 89 7D C8 48 89 F8 48 89 45 D0 48 89 7D F8 48 89 75 F0 48 89 55 E8 C6 45 E7 00 }

    condition:

        all of ($str_*) or all of ($binary_*)

     }

Conclusion 

BANSHEE Stealer is macOS-based malware that can collect extensive data from the system, browsers, cryptocurrency wallets, and numerous browser extensions. Despite its potentially dangerous capabilities, the malware's lack of sophisticated obfuscation and the presence of debug information make it easier for analysts to dissect and understand. While BANSHEE Stealer is not overly complex in its design, its focus on macOS systems and the breadth of data it collects make it a significant threat that demands attention from the cybersecurity community.

Read 2476 times

Please join our community here and become a VIP.

Subscribe to ITWIRE UPDATE Newsletter here
JOIN our iTWireTV our YouTube Community here
BACK TO LATEST NEWS here




IDC WHITE PAPER: The Business Value of Aiven Data Cloud Solutions

According to IDC, Aiven enables your teams to perform more efficiently, reduce direct infrastructure costs, and provide improved database performance, agility and scalability.

Find out how Aiven makes teams 48% more efficient, allowing staff to focus on high-value activities that drive real business results:

340% 3-year ROI – break even in 5 months (average)

37% lower 3-year cost of operations

78% reduction in staff time for database deployments


Download the IDC White Paper now

DOWNLOAD WHITE PAPER!

PROMOTE YOUR WEBINAR ON ITWIRE

It's all about Webinars.

Marketing budgets are now focused on Webinars combined with Lead Generation.

If you wish to promote a Webinar we recommend at least a 3 to 4 week campaign prior to your event.

The iTWire campaign will include extensive adverts on our News Site itwire.com and prominent Newsletter promotion https://itwire.com/itwire-update.html and Promotional News & Editorial. Plus a video interview of the key speaker on iTWire TV https://www.youtube.com/c/iTWireTV/videos which will be used in Promotional Posts on the iTWire Home Page.

Now we are coming out of Lockdown iTWire will be focussed to assisting with your webinars and campaigns and assistance via part payments and extended terms, a Webinar Business Booster Pack and other supportive programs. We can also create your adverts and written content plus coordinate your video interview.

We look forward to discussing your campaign goals with you. Please click the button below.

MORE INFO HERE!

BACK TO HOME PAGE
Share News tips for the iTWire Journalists? Your tip will be anonymous

Subscribe to Newsletter

*  Enter the security code shown:

WEBINARS & EVENTS

CYBERSECURITY

PEOPLE MOVES

GUEST ARTICLES

Guest Opinion

ITWIRETV & INTERVIEWS

RESEARCH & CASE STUDIES

Channel News

Comments