What We Do
How We Do
Resources
Company
Partners
Get Started
Blog

Poseidon Stealer Uses Sopha AI Lure to Infect macOS

BY eSentire Threat Response Unit (TRU)

September 11, 2024 | 5 MINS READ

Attacks/Breaches

Threat Intelligence

Threat Response Unit

TRU Positive/Bulletin

Want to learn more on how to achieve Cyber Resilience?

TALK TO AN EXPERT

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 August 2024, eSentire's Threat Response Unit (TRU) identified an incident involving the Poseidon Stealer, a malware written specifically to target macOS devices.

We assess with high confidence that the initial access occurred through a drive-by download. The user was directed to the malicious website via a Google Ads link and subsequently downloaded a disk image file masquerading as Sora AI installer, an upcoming artificial intelligence model developed by OpenAI. Malwarebytes has previously documented the distribution mechanism for the Poseidon Stealer.

The downloaded file is named “InstallSoraAI.dmg”, the image file contains the setup file, which is the Poseidon Stealer payload (Figure 1).

Figure 1: Contents of InstallSoraAI.dmg file
Figure 1: Contents of InstallSoraAI.dmg file

Opening the file in a disassembler, we can see the hex string that decodes to and a value that holds the custom base64-encoded strings (Figure 2).

Figure 2: Disassembled setup file
Figure 2: Disassembled setup file 

Normally, if users run a program or script in the terminal, closing the terminal window will terminate that process. However, if the malware uses the “disown” command, it detaches itself from the terminal session. This means the malware continues running even after the terminal window is closed, effectively disconnecting itself from the terminal and making it less visible and more difficult for the user to detect and terminate.

To further cover its tracks, the malware may then use the “pkill Terminal” command to close the terminal application, preventing the user from noticing any suspicious activity.

Poseidon Stealer converts the AppleScript script into the hexadecimal format and then uses a custom Base64-encoding to encode the script. You can find configuration extractor script and the decoded script here and here.

Figure 3: Contents of the decoded script
Figure 3: Contents of the decoded script 

The script creates a directory at the path “/tmp/xuyna/” – this is the main directory where the stealer stores the collected data before compressing it into a ZIP file and sending it to a remote server. The stealer copies various files from specific locations on a macOS system, including browser data, cryptocurrency wallets, data from Apple Notes, Keychain data, user’s documents, files that contain specific extensions such as “docx”, “zip”, “wallet”, “key”, “keys”, “doc”, “jpeg”, “png”), photos, and VPN configuration (OpenVPN and FortiVPN). It's also worth noting that the stealer only copies files until a specified size limit (210 MB) is reached.

The “getpwd” function attempts to access Chrome Safe Storage to retrieve the master encryption key for Chrome by running the command:

Usually, when accessing secure items in the Keychain (like Chrome Safe Storage), macOS will prompt the user to enter their system password to allow access. But if the script could access the Keychain without the password prompt, which is generally impossible without user consent, it would store the master key in a file named “masterpass-chrome” within the “writemind” directory.

If it fails to access the key without the password prompt step fails, the script enters a loop where it repeatedly shows a fake dialog box to trick the user into entering their macOS password, thinking it's a legitimate system prompt (Figure 4).

Figure 4: Dialog box prompting the user to enter the password
Figure 4: Dialog box prompting the user to enter the password 

Once the user enters their password, the script checks its validity with “checkvalid(username, password_entered)”, and if the password is valid, the script saves it in the “writemind” directory under “pwd” filename and returns the password.

The stealer then uses “curl” command to send a file “/tmp/out.zip” containing the collected data to a C2 server hxxp://45.93.20[.]174/p2p using a POST request. The request includes custom headers such as a UUID, build ID, and username, which might be used by the server to identify and categorize the incoming data. The curl command:

In conclusion, the Poseidon Stealer malware uses a combination of deceptive techniques, such as fake password prompts, to trick users into revealing their credentials and stealth measures, like terminal manipulation, to evade detection. These tactics allow the malware to capture sensitive information and exfiltrate it to remote servers while remaining undetected from the user.

What did we do?

What can you learn from this TRU Positive?

Recommendations from our Threat Response Unit (TRU):

Indicators of Compromise

You can access the indicators of compromise here.

References

eSentire Unit
eSentire Threat Response Unit (TRU)

The eSentire Threat Response Unit (TRU) is an industry-leading threat research team committed to helping your organization become more resilient. TRU is an elite team of threat hunters and researchers that supports our 24/7 Security Operations Centers (SOCs), builds threat detection models across the eSentire XDR Cloud Platform, and works as an extension of your security team to continuously improve our Managed Detection and Response service. By providing complete visibility across your attack surface and performing global threat sweeps and proactive hypothesis-driven threat hunts augmented by original threat research, we are laser-focused on defending your organization against known and unknown threats.

Read the Latest from eSentire