GlassWorm Goes Mac: Fresh Infrastructure, New Tricks
Detection stack
- AIDR
- Alert
- ETL
- Query
Summary
The threat actor behind GlassWorm has pivoted from Windows-focused activity to macOS, distributing malicious VS Code extensions that fetch encrypted JavaScript payloads through Solana blockchain–derived C2 pointers. This wave expands capability by adding hardware wallet trojanization while continuing broad credential theft across browsers, developer tooling, and the macOS Keychain. The infrastructure includes a Solana wallet address and an IP reused from earlier GlassWorm operations, suggesting continuity in operator tooling and hosting. Researchers observed 50,000+ downloads before the extensions were removed, indicating meaningful exposure across developer environments.
Investigation
Koi Security identified three malicious VS Code extensions on the Open VSX marketplace and linked their command-and-control workflow to a Solana wallet plus a shared IP address previously tied to GlassWorm. The implants incorporate a 15-minute execution delay, then decrypt and run an AES-256-CBC JavaScript payload. On macOS, persistence is established via LaunchAgents. Collection targets include browser wallets and desktop wallet data, developer access tokens, SSH keys, and macOS Keychain material. The malware stages stolen data under /tmp/ijewf/ before exfiltration to a server path resembling /p2p. It also attempts to replace legitimate hardware wallet companion apps—such as Ledger Live and Trezor Suite—with trojanized lookalikes to capture high-value secrets and transactions.
Mitigation
Tighten controls around developer tooling by enforcing extension allowlisting and requiring security review for VS Code extensions, particularly those sourced from open marketplaces. Deploy runtime detections for delayed execution patterns and suspicious creation or modification of LaunchAgents. Monitor and block suspicious outbound activity associated with Solana-derived C2 lookups, and add network detections for unusual connections to the identified reused IP. Require MFA for developer and cloud accounts and implement hardware wallet integrity checks (publisher validation, notarization/signature verification, and controlled software update channels).
Response
Trigger alerts on new or modified LaunchAgents, anomalous access to Keychain stores, and retrieval attempts from Solana-referenced C2 endpoints. Quarantine and remove the malicious VS Code extensions, then eradicate any associated LaunchAgent persistence. Perform targeted forensics on /tmp/ijewf/ to scope credential staging and confirm what data was collected. Validate the integrity of hardware wallet applications (Ledger Live, Trezor Suite) and re-install from trusted sources if tampering is suspected. Reset impacted credentials, rotate SSH keys and developer tokens, invalidate sessions, and expand hunting across endpoints for the same extension IDs, file paths, and persistence artifacts.
"graph TB %% Class Definitions classDef action fill:#99ccff classDef technique fill:#ffcc99 classDef operator fill:#ff9900 classDef tool fill:#cccccc %% Nodes action_initial_access["<b>Action</b> – Initial Access"] class action_initial_access action technique_vs_code_ext["<b>Technique</b> – T1176.002: Malicious VS Code IDE Extension<br/><b>Description</b>: Adversary delivers a malicious extension for Visual Studio Code that executes code on the victim system."] class technique_vs_code_ext technique technique_delay["<b>Technique</b> – T1497.003: Execution Delay<br/><b>Description</b>: Malware waits for a period (e.g., 15 minutes) before executing its payload to evade analysis."] class technique_delay technique technique_decrypt["<b>Technique</b> – T1027.009 / T1027.004: Decrypt AESu2011256u2011CBC Payload<br/><b>Description</b>: Encrypted payload is decrypted inu2011memory using AESu2011CBC with a 256u2011bit key."] class technique_decrypt technique technique_c2_retrieve["<b>Technique</b> – T1573.001: Retrieve Endpoint from Solana Blockchain<br/><b>Description</b>: C2 server address is stored on a public blockchain and fetched by the malware."] class technique_c2_retrieve technique technique_c2_fetch["<b>Technique</b> – T1048.003: Unencrypted Protocol Data Transfer<br/><b>Description</b>: Malware contacts the C2 endpoint using an unencrypted protocol (e.g., HTTP)."] class technique_c2_fetch technique technique_persistence_agent["<b>Technique</b> – T1543.001: Install LaunchAgent<br/><b>Description</b>: A LaunchAgent plist is placed in the useru2019s LaunchAgents directory for persistence."] class technique_persistence_agent technique technique_persistence_daemon["<b>Technique</b> – T1543.004: Install LaunchDaemon<br/><b>Description</b>: A LaunchDaemon plist is placed in the system LaunchDaemons directory for persistence."] class technique_persistence_daemon technique technique_modify_plist["<b>Technique</b> – T1647: Modify PLIST File<br/><b>Description</b>: Attacker edits the plist to alter launch behavior or add malicious commands."] class technique_modify_plist technique technique_dump_keychain["<b>Technique</b> – T1555.001 / T1555.002: Dump Keychain<br/><b>Description</b>: Credential material from macOS Keychain is extracted."] class technique_dump_keychain technique technique_steal_keys["<b>Technique</b> – T1552.001 / T1552.004: Steal Private Keys and Tokens<br/><b>Description</b>: Private cryptocurrency keys and authentication tokens are harvested."] class technique_steal_keys technique technique_stage_data["<b>Technique</b> – T1074: Data Staged<br/><b>Description</b>: Collected files are copied to /tmp/ijewf for later exfiltration."] class technique_stage_data technique technique_archive["<b>Technique</b> – T1560.001 / T1560.003: Archive Collected Data<br/><b>Description</b>: Data is compressed into an archive format (e.g., zip)."] class technique_archive technique technique_exfil["<b>Technique</b> – T1048.003: Exfiltration Over Unencrypted Nonu2011C2 Channel<br/><b>Description</b>: Staged archive is sent out via an unencrypted channel not tied to the primary C2."] class technique_exfil technique technique_priv_esc["<b>Technique</b> – T1548.006: TCC Manipulation<br/><b>Description</b>: macOS Transparency, Consent, and Control database is modified to gain higher privileges."] class technique_priv_esc technique technique_impact["<b>Technique</b> – T1496.002: Replace Ledger Live / Trezor Suite<br/><b>Description</b>: Legitimate cryptocurrency wallet applications are swapped with trojanized versions to capture user assets."] class technique_impact technique %% Connections action_initial_access –>|uses| technique_vs_code_ext technique_vs_code_ext –>|triggers| technique_delay technique_delay –>|leads to| technique_decrypt technique_decrypt –>|establishes| technique_c2_retrieve technique_c2_retrieve –>|contacts| technique_c2_fetch technique_c2_fetch –>|installs| technique_persistence_agent technique_c2_fetch –>|installs| technique_persistence_daemon technique_persistence_agent –>|modifies| technique_modify_plist technique_persistence_daemon –>|modifies| technique_modify_plist technique_modify_plist –>|enables| technique_dump_keychain technique_dump_keychain –>|enables| technique_steal_keys technique_steal_keys –>|stores in| technique_stage_data technique_stage_data –>|archives| technique_archive technique_archive –>|exfiltrates via| technique_exfil technique_exfil –>|facilitates| technique_priv_esc technique_priv_esc –>|enables| technique_impact "
Attack Flow
Detections
Possible MacOS Browser Password Discovery Attempt (via cmdline)
View
IOCs (SourceIP) to detect: GlassWorm Goes Mac: Fresh Infrastructure, New Tricks
View
IOCs (DestinationIP) to detect: GlassWorm Goes Mac: Fresh Infrastructure, New Tricks
View
IOCs (Emails) to detect: GlassWorm Goes Mac: Fresh Infrastructure, New Tricks
View
GlassWorm macOS Keychain Access Detection [Linux Process Creation]
View
Potential AppleScript Execution for Keychain Access on macOS [Linux Process Creation]
View
Detection of Solana Blockchain C2 Communication by GlassWorm [Proxy]
View
Simulation Execution
Prerequisite: The Telemetry & Baseline Pre‑flight Check must have passed.
Rationale: This section details the precise execution of the adversary technique (TTP) designed to trigger the detection rule. The commands and narrative MUST directly reflect the TTPs identified and aim to generate the exact telemetry expected by the detection logic. Abstract or unrelated examples will lead to misdiagnosis.
-
Attack Narrative & Commands:
An attacker who has already compromised a low‑privileged macOS user account wishes to harvest a service account password stored in the Keychain under the labelpass_users_for_script. To avoid dropping a separate binary, the attacker writes a one‑liner AppleScript that invokes the built‑insecuritytool viado shell script. The script is executed directly in the user’s session, producing a process creation event with the exact command line the Sigma rule matches.# Create a test keychain item (only for demonstration; real attacker would target existing item) security add-generic-password -a attacker -s pass_users_for_script -w SuperSecret123 # Execute the AppleScript that reads the password osascript -e 'do shell script "security find-generic-password -s '''pass_users_for_script''' -w"' -
Regression Test Script:
#!/usr/bin/env bash set -euo pipefail # Step 1: Ensure the target keychain entry exists (idempotent) if ! security find-generic-password -s pass_users_for_script -w >/dev/null 2>&1; then security add-generic-password -a attacker -s pass_users_for_script -w SuperSecret123 fi # Step 2: Execute the AppleScript that triggers the detection rule echo "[+] Executing AppleScript to read the keychain entry..." osascript -e 'do shell script "security find-generic-password -s '''pass_users_for_script''' -w"' -
Cleanup Commands:
# Remove the test keychain item to leave the system clean security delete-generic-password -s pass_users_for_script echo "[+] Cleanup complete: test keychain entry removed."