Skip to content
rat

MiniRAT

MiniRAT is a Go-based macOS remote access trojan (RAT) distributed through malicious npm packages that enables persistent remote access, host profiling, file exfiltration, and arbitrary command execution on compromised developer systems.

Symptoms

You might observe the following artifacts associated with this threat:

  • Persistence Artifacts: A newly created LaunchAgent at ~/Library/LaunchAgents/com.apple.Terminal.profiler.plist (configured with RunAtLoad but no KeepAlive), and a modified ~/.zshrc containing a launchctl submit -l zsh.profiler line that re-launches the implant at each interactive login.
  • Suspicious Support Files: Unexpected items under ~/Library/Application Support/com.apple.Terminal/, including a hidden .cache file (the AES-encrypted C2 configuration) and a profiler binary — paths chosen to blend in with legitimate Apple Terminal data.
  • Temp-Directory Artifacts: A single-instance mutex file updater.lock and an operational log updater.log, both written under $TMPDIR (resolving to /var/folders/<XX>/<random>/T/ on macOS).
  • Anomalous Network Activity: Unauthorized outbound HTTP(S) beaconing to unknown command and control (C2) hosts (datahub.ink, cloud-sync.online, byte-io.us), accompanied by geolocation lookups to api.ipify.org and ipinfo.io/json.
  • Suspicious Background Commands: Reconnaissance commands executing without an associated open application, such as scutil, sysctl, ioreg, whoami, hostname, sw_vers, and uname -m.

Technical Breakdown

MiniRAT is a remote access trojan written in Go and compiled for macOS (arm64), internally named "minirat." Because Go binaries are statically linked, the sample carries obscured function boundaries that hinder static analysis, and it is ad hoc signed rather than carrying a valid developer signature.

The infection chain begins with a supply-chain compromise: the RAT was delivered by a poisoned npm package, @velora-dex/sdk@9.4.1, published in April 2026. Build metadata shows the source was committed roughly two and a half weeks earlier, indicating premeditated development rather than an opportunistic payload.

On execution, MiniRAT runs an anti-analysis routine that self-terminates if a virtualized or sandboxed environment is detected. It then establishes persistence via both a ~/.zshrc entry and a LaunchAgent plist, loads its C2 list from an AES-encrypted configuration file, and uploads an enrollment dossier containing username, hostname, macOS version, CPU model, public IP, and region.

 

Some of MiniRAT's primary capabilities include:

  • Remote Shell Execution: Running arbitrary shell commands via the internal ExecuteCommand helper, which invokes /bin/sh -c <command> and returns captured stdout/stderr to the operator, providing interactive shell-like control.
  • Data Exfiltration: Uploading individual files or entire directories from the victim to the attacker's server, with directories handled recursively (likely archived to ZIP before upload).
  • Payload Delivery: Downloading files from the attacker's server to a specified location on the victim, enabling secondary payloads, tooling, or updated implant versions.
  • Host Profiling / Information Harvesting: Collecting system and user identity data through native macOS utilities during enrollment.
  • Anti-VM / Sandbox Evasion: Detecting virtualized environments and self-terminating to frustrate automated analysis.
  • Stealth via Masquerading: Disguising its LaunchAgent label, support-directory paths, and lock/log filenames to imitate legitimate Apple Terminal components.

Command execution concurrency varies: upload and download tasks are dispatched asynchronously as goroutines, while command runs synchronously in the beacon thread, so a long-running shell command will stall the next polling cycle until it finishes.

Check out the full MiniRAT write-up here for a full breakdown and the Indicators of Compromise (IOCs).

Next Steps

Behavioral Endpoint Detection & Response (EDR) is recommended to catch MiniRAT's runtime activity — LaunchAgent abuse, .zshrc modification, anti-VM reconnaissance commands, and anomalous C2 beaconing — since static indicators alone are insufficient against statically linked Go binaries. Affected systems should have the persistence artifacts removed (~/.zshrc entry, com.apple.Terminal.profiler.plist, and the com.apple.Terminal/.cache and profiler files), and any credentials or secrets accessible from compromised developer endpoints should be rotated.

In the future, audit npm and other third-party dependencies before installation, pin and verify package versions, and adopt proactive software supply-chain monitoring to flag compromised packages. Obtain software only from trusted, official sources, and use professional security monitoring tools to audit system activity, as standard GUI file management may not reveal MiniRAT's hidden components.

Stay up to date

Iru's bi-weekly collection of articles, videos, and research to keep IT & Security teams ahead of the curve.