# Heartbreaker: Metamorphic Ransomware Targeting macOS (Apple silicon)

> Heartbreaker is a previously unknown macOS ransomware sample: an ad hoc-signed ARM64 Mach-O written in Rust that encrypts files in ~/Downloads with AES-256-GCM, persists via a LaunchAgent, and attempts metamorphic self-rebuilding. It was uploaded to VirusTotal in May 2025 and undetected by all engines at the time of Objective-See's analysis; it is assessed as unlikely to pose a major real-world threat in its current form.

- **Author:** Threadlinqs Team
- **Published:** 2026-12-01T15:07:02Z
- **Last updated:** 2026-12-01T15:07:02Z
- **Canonical:** https://intel.threadlinqs.com/threat/TL-2026-7181
- **Card image:** https://intel.threadlinqs.com/og/threat/TL-2026-7181.png
- **ID:** TL-2026-7181
- **Severity:** MEDIUM
- **Category:** RANSOMWARE
- **Status:** MONITORING
- **Detections:** 9 (1 shown free below) · **IOCs:** 16 (2 shown free below)

## Description

Heartbreaker is a Mach-O 64-bit arm64 executable named 'heartbreaker', written in Rust with an eframe GUI and ad hoc (linker) signed (CodeDirectory flags 0x20002 adhoc,linker-signed) with the code-signing identifier heartbreaker-e2c97a640967e3f6. The sample was uploaded to VirusTotal in May 2025, discovered by Megan Carney, and analyzed by Objective-See (Patrick Wardle) in a post published 2026-10-18; a copy is distributed in the Objective-See malware collection as HeartBreaker.zip (password 'infect3d'). At the time of writing it was undetected by all VirusTotal engines. No CVE, threat actor, initial-access vector, or in-the-wild campaign has been reported.

On execution, entry() calls mimicore::add_to_startup() (return value ignored), which writes a LaunchAgent at ~/Library/LaunchAgents/com.network.startup.plist whose template Label is com.myapp.startup (it does not match the filename), RunAtLoad true, and ProgramArguments set at runtime to the path of the running binary. It then recursively walks ~/Downloads, skipping files already ending in .heartbreaker, and for each file ('Encrypting file:' is logged) reads the entire contents, encrypts them with AES-256-GCM (aes-gcm crate 0.10.3), truncates and overwrites the original, writes nonce (12 bytes, OsRng.fill_bytes) + ciphertext + 16-byte GCM tag, and renames the file with a .heartbreaker suffix (file.txt -> file.txt.heartbreaker). Endpoint Security events observed via FileMonitor are NOTIFY_OPEN, NOTIFY_WRITE and NOTIFY_RENAME. A single hard-coded 32-byte key is used for every file and (presumably) every victim, so files can be decrypted without paying; Objective-See published a Python decryptor (decrypt_heartbreaker.py) using AESGCM(KEY).decrypt(nonce, ciphertext_and_tag, None) and recovered a test file. A README.txt ransom note is written to the Desktop demanding 0.003 BTC (no wallet address is published in the analysis), and after encryption a 'HEARTBREAKER WARNING!' window ('Your system has been encrypted!', 'Please send 0.003 BTC ...') is shown whose 'Decrypt Files' button is disabled and recovers nothing. If no eligible files exist the GUI is skipped and the rebuild starts immediately.

The distinguishing feature is an attempted metamorphic engine. The binary embeds its own main.rs and build.rs via include_str!, and a rewrite() function reconstructs a Cargo.toml (aes-gcm 0.10.3 plus a mimicore git dependency) and calls mimicore::morph() with the embedded source, build script, 15 junk functions and the executable name. Prior func_* junk functions are removed by regex, identifiers are randomized (r_ prefix in Heartbreaker; w_ in the related public metacore source), new func_<random> junk functions (2-5 random operations each) are generated, and functions are shuffled; METAMORPHIC_MARKER_START/END delimit the rewritable region. If cargo is absent the malware attempts to install Rust (no install command is shown in the analysis), then writes src/main.rs, Cargo.toml and build.rs to a temporary project (logging 'Writing source to: modified_source.rs', 'Running cargo build', 'Saving new executable'), runs 'cargo build --release', renames the running executable with a .tmp extension, copies in the new build with mode 0o755, and removes the old .tmp (restoring the original if replacement fails). The hash changes on each rebuild while behavior stays the same, and each binary embeds the transformed source for the next generation. The mimicore git dependency (github.com/saaaarwar/mimicore) is no longer publicly available, so the rebuild fails unless the dependency is already cached. A closely related public repository, metacore (github.com/saaaarwar/metacore), describes itself as a dynamic and extensible framework for generating and transforming Rust source code; the analysis does not prove direct lineage.

Limitations reduce real-world risk: only ~/Downloads is targeted, macOS privacy protections are ignored, the key is universal, and the build framework is unavailable. RansomWhere? detected the sample behaviorally (Endpoint Security modified-file close events; rapid conversion of files to high-entropy data by an untrusted process; process suspended and user alerted) without a Heartbreaker-specific signature; the author notes this approach is reactive and can be evaded by slow encryption, transforming ciphertext before writing, trusted child processes, or small files. No network indicators (domains, IPs, C2) were published, so BeaconBeagle correlation is not applicable.

## MITRE ATT&CK

- T1491.001 Defacement: Internal Defacement
- T1543.001 Create or Modify System Process: Launch Agent
- T1027 Obfuscated Files or Information
- T1027.004 Obfuscated Files or Information: Compile After Delivery
- T1027.016 Obfuscated Files or Information: Junk Code Insertion
- T1070.004 Indicator Removal: File Deletion
- T1222.002 Linux and Mac Permissions

## Free detection (Splunk SPL, Microsoft KQL, Sigma)

**Heartbreaker macOS Ransomware - .heartbreaker Encrypted Files and Desktop README.txt Note (Splunk SPL)** (`TL-2026-7181-SPL-001`)

Detects the Impact phase of Heartbreaker (TL-2026-7181), an ad hoc-signed ARM64 Rust Mach-O that encrypts ~/Downloads with AES-256-GCM, renames each file to <name>.heartbreaker and drops a README.txt ransom note (0.003 BTC) on the Desktop. Fires when any process writes files ending in .heartbreaker; a README.txt written to a Desktop by the same process raises the risk score. Uses the CIM Endpoint.Filesystem datamodel so it works with any macOS EDR/Endpoint Security feed mapped to CIM. Note the sample has a universal hard-coded key, so recovery without payment is possible once the host is contained.

- **Languages:** Splunk SPL, Microsoft KQL, Sigma
- **ATT&CK:** T1486, T1491.001
- **Data sources:** Splunk CIM datamodel Endpoint.Filesystem (macOS EDR / Endpoint Security file events), Microsoft Defender for Endpoint DeviceFileEvents (macOS), macOS Endpoint Security file_event
- **Severity:** high
- **Confidence:** high

### Splunk SPL

````spl
| tstats summariesonly=false count AS event_count dc(Filesystem.file_path) AS distinct_paths min(_time) AS firstTime max(_time) AS lastTime values(Filesystem.file_name) AS sample_files FROM datamodel=Endpoint.Filesystem WHERE (Filesystem.file_name="*.heartbreaker" OR (Filesystem.file_name="README.txt" AND Filesystem.file_path="*/Desktop/*")) BY Filesystem.dest Filesystem.user Filesystem.process_name
| rename Filesystem.* AS *
```Heartbreaker TL-2026-7181: alert only when the .heartbreaker extension was written; the Desktop README.txt ransom note from the same process is corroboration```
| eval encrypted_ext=if(isnotnull(mvfind(sample_files,"[.]heartbreaker$")),1,0), note_dropped=if(isnotnull(mvfind(sample_files,"^README[.]txt$")),1,0)
| where encrypted_ext=1
| eval risk_score=70+(note_dropped*20)+if(distinct_paths>=5,10,0)
| eval firstTime=strftime(firstTime,"%Y-%m-%d %H:%M:%S"), lastTime=strftime(lastTime,"%Y-%m-%d %H:%M:%S")
| table firstTime lastTime dest user process_name event_count distinct_paths note_dropped risk_score sample_files
````

### Microsoft KQL

```kql
let lookback = 1h;
let KnownExtension = DeviceFileEvents
| where Timestamp > ago(lookback)
| where ActionType in ("FileRenamed", "FileCreated")
| where FileName endswith ".heartbreaker"
| summarize FileCount = dcount(strcat(FolderPath, "/", FileName)), Samples = make_set(FileName, 5), Timestamp = max(Timestamp) by DeviceName, DeviceId, InitiatingProcessFileName, InitiatingProcessSHA256, InitiatingProcessFolderPath
| project Timestamp, DeviceName, DeviceId, Process = InitiatingProcessFileName, ProcessSHA256 = InitiatingProcessSHA256, ProcessPath = InitiatingProcessFolderPath, Detail = strcat(tostring(FileCount), " files with .heartbreaker extension: ", tostring(Samples)), Branch = "known_extension";
let SuffixBehaviour = DeviceFileEvents
| where Timestamp > ago(lookback)
| where ActionType == "FileRenamed" and FolderPath contains "/Downloads"
| where isnotempty(PreviousFileName) and strlen(FileName) > strlen(PreviousFileName) and FileName startswith PreviousFileName
| extend AppendedSuffix = substring(FileName, strlen(PreviousFileName))
| summarize RenamedCount = count(), DistinctSuffixes = dcount(AppendedSuffix), Suffix = any(AppendedSuffix) by DeviceName, DeviceId, InitiatingProcessFileName, InitiatingProcessSHA256, InitiatingProcessFolderPath, Timestamp = bin(Timestamp, 10m)
| where RenamedCount >= 10 and DistinctSuffixes == 1
| project Timestamp, DeviceName, DeviceId, Process = InitiatingProcessFileName, ProcessSHA256 = InitiatingProcessSHA256, ProcessPath = InitiatingProcessFolderPath, Detail = strcat(tostring(RenamedCount), " files renamed with appended suffix ", Suffix), Branch = "suffix_behaviour";
union KnownExtension, SuffixBehaviour
| order by Timestamp desc
```

### Sigma

```yaml
title: Heartbreaker macOS Ransomware Encrypted File Extension and Ransom Note
id: 3e7d9a52-6c14-4b8f-a1d0-5f2b8c9e7a11
status: experimental
description: Detects creation of files with the .heartbreaker extension, or a README.txt ransom note on a Desktop written by a process named heartbreaker (TL-2026-7181).
references:
  - https://objective-see.org/blog/blog_0x8A.html
author: Threadlinqs Team
date: 2026-12-01
tags:
  - attack.impact
  - attack.t1486
  - attack.t1491.001
logsource:
  category: file_event
  product: macos
detection:
  selection_ext:
    TargetFilename|endswith: '.heartbreaker'
  selection_note:
    TargetFilename|endswith: '/Desktop/README.txt'
    Image|endswith: '/heartbreaker'
  condition: 1 of selection_*
falsepositives:
  - Unrelated utility that appends a .heartbreaker suffix (not known)
  - Analyst detonating the sample in a lab
level: high
```

**Known false positives:**

- Malware analysts or red teams detonating the Objective-See HeartBreaker.zip sample in a lab
- Backup or archive tools that append a custom suffix on mass rename (affects only the KQL suffix-behaviour branch)

**Tuning notes:** Schedule every 15 minutes over a 30 minute window and make sure the Endpoint.Filesystem datamodel is accelerated and populated from your macOS sensor. The extension match is near zero-noise; if your macOS sensor does not map process_name into CIM, drop it from the BY clause. In KQL, raise RenamedCount above 10 or exclude known backup/sync processes if the suffix-behaviour branch is noisy. Because the metamorphic rebuild changes the hash, do not rely on SHA-256 matching.

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

- [indicator] macOS Ransomware - Encrypted File Extension and Mass Suffix Rename in Downloads (Sentinel KQL) (locked: unlock with TL Creds)
- [indicator] macOS LaunchAgent Persistence - com.network.startup.plist (Sentinel KQL) (locked: unlock with TL Creds)
- [indicator] Metamorphic Rebuild - cargo/rustup Activity and Self-Replacement Artifacts (Sentinel KQL) (locked: unlock with TL Creds)
- [indicator] macOS Ransomware Encrypted File Extension and Ransom Note (Sigma) (locked: unlock with TL Creds)
- [indicator] macOS LaunchAgent Persistence Plist (Sigma) (locked: unlock with TL Creds)
- [indicator] macOS Metamorphic Rebuild via Cargo or Rust Toolchain Install (Sigma) (locked: unlock with TL Creds)
- [indicator] macOS LaunchAgent Persistence - com.network.startup.plist (Splunk SPL) (locked: unlock with TL Creds)
- [indicator] Metamorphic Rebuild - cargo build --release and Rust Toolchain Install from Downloads Binary (Splunk SPL) (locked: unlock with TL Creds)

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

## Sample indicators (2 of 16)

Defanged, TLP:CLEAR.

- URL: `hxxps://github[.]com/saaaarwar/metacore`
- File hash: `6bdf42a575d2daee3de2530161cb5b1fef6ca78b4abfa74f329d6b6c72890d18`

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

## Sources

- [Objective-See: Heartbreaker - Metamorphic ransomware comes for macOS](https://objective-see.org/blog/blog_0x8A.html)
- [VirusTotal report for Heartbreaker sample (SHA-256 6bdf42a575d2daee3de2530161cb5b1fef6ca78b4abfa74f329d6b6c72890d18)](https://www.virustotal.com/gui/file/6bdf42a575d2daee3de2530161cb5b1fef6ca78b4abfa74f329d6b6c72890d18)
- [Hexnode Threat Watch: Heartbreaker macOS ransomware response](https://www.hexnode.com/threat-watch/heartbreaker-macos-ransomware-response/)
- [Hexnode Threat Watch](https://www.hexnode.com/threat-watch/?p=2372)
- [metacore - Rust source generation/transformation framework (GitHub, saaaarwar)](https://github.com/saaaarwar/metacore)
- [Objective-See Malware repository: HeartBreaker.zip sample archive](https://github.com/objective-see/Malware/blob/main/HeartBreaker.zip)
- [Objective-See malware collection](https://objective-see.org/malware.html)
- [Practical Ransomware Detection on macOS via Maths, not AI (Patrick Wardle)](https://speakerdeck.com/patrickwardle/practical-ransomware-detection-on-macos-via-maths-not-ai)
- [Objective-See: RansomWhere? behavioral ransomware detection](https://objective-see.org/products/ransomwhere.html)
- [Objective-See: Towards generic ransomware detection (original RansomWhere? research)](https://objective-see.org/blog/blog_0x0F.html)

## Full data

The other 8 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 and Gold in full, 2 calls a day on a free account): https://intel.threadlinqs.com/mcp

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