SOC Prime Bias: High

25 Nov 2025 17:59

Clickfix on macOS: AppleScript Malware Campaign Uses Terminal Prompts to Steal Data

Author Photo
Ruslan Mikhalov Chief of Threat Research at SOC Prime linkedin icon Follow
Clickfix on macOS: AppleScript Malware Campaign Uses Terminal Prompts to Steal Data
shield icon

Detection stack

  • AIDR
  • Alert
  • ETL
  • Query

Summary

The AppleScript malware campaign targets macOS users via a ClickFix technique by persuading them to manually execute base64-decoded shell commands in Terminal. These commands retrieve an AppleScript stealer that harvests browser data, cryptocurrency wallets, local documents, and other sensitive information, then exfiltrates it to attacker-controlled servers. Because no traditional binary is written to disk, the activity is harder to spot with classic AV. The operation relies on multiple deceptive domains and unusual service ports for command-and-control traffic.

AppleScript Campaign Analysis

Researchers examined the phishing websites, the JavaScript responsible for delivering the payload, and the AppleScript used for collection and exfiltration. Infrastructure mapping uncovered domains such as cryptoinfo-news.com and odyssey1.to, along with services exposed on ports 22, 80, 3333, and 5201. The AppleScript payload packages stolen data into a ZIP file at /tmp/out.zip and uses curl to upload it to a remote endpoint.

Mitigation

Defenders should block identified malicious domains and limit outbound connections on uncommon ports. Harden macOS hosts by restricting AppleScript and shell usage, monitoring for base64-d | bash execution patterns, and applying strict CORS controls in web environments. Security awareness training should highlight phishing pages that instruct users to copy-paste and run Terminal commands.

Response

When these indicator patterns are detected, notify the SOC, isolate the affected system, and capture temporary artifacts and shell history. Perform a forensic review of the /tmp directory, quarantine any suspicious ZIP archives, and correlate outbound traffic with the known C2 servers and ports identified in the campaign.

graph TB %% Class definitions classDef technique fill:#e0f7fa %% Node definitions initial_access[“<b>Initial Access</b> – <b>T1659 Content Injection</b>: Victims load a phishing page that injects a malicious command.”] class initial_access technique execution_copy_paste[“<b>Execution</b> – <b>T1204.004 User Execution: Malicious Copy and Paste</b>: The user copies a base64 command and runs it in the Terminal.”] class execution_copy_paste technique execution_proxy[“<b>Execution</b> – <b>T1127 Trusted Developer Utilities Proxy Execution</b>: Decodes and executes AppleScript via native macOS utilities.”] class execution_proxy technique execution_xpc[“<b>Execution</b> – <b>T1559.003 Inter-Process Communication: XPC Services</b>: AppleScript leverages XPC for internal calls.”] class execution_xpc technique collection_browser_disc[“<b>Collection</b> – <b>T1217 Browser Information Discovery</b>: AppleScript enumerates Firefox and Chromium profiles.”] class collection_browser_disc technique collection_creds[“<b>Collection</b> – <b>T1555.003 Credentials from Password Stores: Web Browsers</b>: Steals cookies, saved credentials, and crypto wallet data.”] class collection_creds technique archive[“<b>Collection</b> – <b>T1560.001 Archive via Utility</b>: Packages files into a ZIP using ditto.”] class archive technique exfiltration[“<b>Exfiltration</b> – <b>T1020 Automated Exfiltration</b>: Uploads the ZIP to an attacker-controlled server via curl.”] class exfiltration technique c2_web[“<b>Command and Control</b> – <b>T1102 Web Service</b>: Communicates with C2 over HTTP with permissive CORS.”] class c2_web technique c2_ssh[“<b>Command and Control</b> – <b>T1021.004 Remote Services: SSH</b>: The attacker maintains SSH access for further control.”] class c2_ssh technique defense_compress[“<b>Defense Evasion</b> – <b>T1027.015 Compression</b>: Uses compression to hide payload data.”] class defense_compress technique defense_file_delete[“<b>Defense Evasion</b> – <b>T1070.004 File Deletion</b>: Removes temporary directories and archives.”] class defense_file_delete technique credential_cookie[“<b>Credential Access</b> – <b>T1539 Steal Web Session Cookie</b>: Uses stolen cookies to hijack sessions.”] class credential_cookie technique %% Connections initial_access –>|leads to| execution_copy_paste execution_copy_paste –>|leads to| execution_proxy execution_proxy –>|uses| execution_xpc execution_proxy –>|collects| collection_browser_disc collection_browser_disc –>|collects| collection_creds collection_creds –>|archives| archive archive –>|exfiltrates| exfiltration exfiltration –>|uses| c2_web c2_web –>|fallback| c2_ssh exfiltration –>|covers tracks| defense_compress exfiltration –>|covers tracks| defense_file_delete collection_creds –>|enables| credential_cookie

Attack Flow

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 directly reflect the identified TTPs and aim to generate the exact telemetry expected by the detection logic.

  • Attack Narrative & Commands:

    1. The attacker sends a phishing email containing the one‑liner:

      echo "cHJpbnQoJ0NhdXNlJykK" | base64 -d | bash

      (The payload decodes to print('Cause') – a placeholder for any malicious Bash script.)

    2. An unsuspecting user copies the line and pastes it into Terminal.

    3. macOS spawns a bash process whose command line exactly matches the pattern base64 -d | bash, satisfying the Sigma rule’s selection.

    4. The Bash interpreter executes the decoded payload, completing the malicious action (e.g., establishing a reverse shell, downloading additional tools).

  • Regression Test Script: The script below automates steps 1‑3, reproducing the telemetry needed for validation.

    #!/bin/bash
    # -------------------------------------------------
    # Simulate macOS Base64‑decode‑and‑Bash execution
    # -------------------------------------------------
    # Base64‑encoded payload (prints “Compromise”)
    PAYLOAD="cHJpbnQoJ0NvbXByb21pc2UnKQ=="
    
    # Execute the one‑liner exactly as an attacker would
    echo "$PAYLOAD" | base64 -d | bash
    
    # Exit with the status of the Bash command
    exit $?
  • Cleanup Commands: Remove any temporary files or background processes that may have been created by the payload (replace with payload‑specific cleanup if needed).

    #!/bin/bash
    # Simple cleanup – ensure no stray Bash child processes remain
    pkill -f "base64 -d | bash" 2>/dev/null
    # If the payload created files, delete them (example placeholder)
    rm -f /tmp/malicious_script.sh 2>/dev/null