macOS.OSAMiner is a long-running macOS cryptomining malware campaign, likely active since at least 2015, that deploys a Monero miner while using layered run-only AppleScripts to hinder reverse engineering and analysis. It has been associated with trojanized and cracked macOS software, including pirated productivity and gaming applications, as an infection vector.
The malware uses a multi-stage architecture. An initial run-only AppleScript establishes persistence through LaunchAgents, performs environmental checks such as available disk space, drops and executes an embedded anti-analysis AppleScript, and retrieves a subsequent stage from a URL concealed within the source of a public web page. Later variants increased complexity by embedding one run-only AppleScript inside another. Additional stages masquerade as benign file types while functioning as AppleScript or Mach-O payloads.
A notable feature of macOS.OSAMiner is its defense-evasion logic. Its embedded script checks for Activity Monitor and terminates it, and it also searches for consumer security and cleanup tools to interfere with analysis or removal. It further inspects installation logs to identify certain installed applications. The malware also kills Terminal in some execution paths and uses simple anti-virtualization logic by checking CPU characteristics before deploying the miner.
For persistence and execution, macOS.OSAMiner stores components in user-space locations and has adapted its storage strategy over time, shifting from earlier directories to cache locations in response to macOS privacy and access-control changes introduced in Mojave. The miner deployment stage downloads and configures a Monero mining component consistent with XMR-STAK-RX, writes configuration files, prevents the system from sleeping, and launches the miner to consume host resources.
Operationally, infections have been associated with high CPU utilization, system instability, and interference with user attempts to inspect running processes. macOS.OSAMiner is best characterized as a macOS-focused cryptomining trojan with persistence, downloader behavior, and anti-analysis features.
18 distinct techniques documented for this family, organized by ATT&CK tactic.
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has used `osascript` to call itself via the `do shell script` command in the [Launch Agent](https://attack.mitre.org/techniques/T1543/001) `.plist` file.(Citation: SentinelLabs reversing run-only applescripts 2021)
This command is then executed via the AppleScript do shell script command... ps ax | grep <name> | grep -v grep | awk '{print $1}' ... kill - 9
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has used `launchctl` to restart the [Launch Agent](https://attack.mitre.org/techniques/T1543/001).(Citation: SentinelLabs reversing run-only applescripts 2021)
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has placed a [Stripped Payloads](https://attack.mitre.org/techniques/T1027/008) with a `plist` extension in the [Launch Agent](https://attack.mitre.org/techniques/T1543/001)'s folder. (Citation: SentinelLabs reversing run-only applescripts 2021)
the parent script continues to execute, setting up a persistence agent... the malware now has four components running... a persistence agent for the parent script at ~/Library/LaunchAgents/com.apple.FY9.plist
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has placed a [Stripped Payloads](https://attack.mitre.org/techniques/T1027/008) with a `plist` extension in the [Launch Agent](https://attack.mitre.org/techniques/T1543/001)'s folder. (Citation: SentinelLabs reversing run-only applescripts 2021)
the parent script continues to execute, setting up a persistence agent... the malware now has four components running... a persistence agent for the parent script at ~/Library/LaunchAgents/com.apple.FY9.plist
The malware authors used run-only AppleScripts prevented much further analysis... Recent versions of macOS.OSAMiner add greater complexity by embedding one run-only AppleScript inside another... the script is passed an obfuscated string of hex characters.
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has used run-only Applescripts, a compiled and stripped version of [AppleScript](https://attack.mitre.org/techniques/T1059/002), to remove human readable indicators to evade detection.(Citation: SentinelLabs reversing run-only applescripts 2021)
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has embedded [Stripped Payloads](https://attack.mitre.org/techniques/T1027/008) within another run-only [Stripped Payloads](https://attack.mitre.org/techniques/T1027/008).(Citation: SentinelLabs reversing run-only applescripts 2021)
Despite the .png extension, it is of course another run-only AppleScript, which is now written out to ~/Library/11.png on the infected device... In keeping with the malware’s tactic of using misleading file extensions, this is of course not a plist but in fact a Mach-O executable.
Observed Parent Script Strings: rm ~/Library/11.png rm ~/Library/k.plist
It parses the output of the built-in system_profiler tool to check whether the device has 4 cores, a rudimentary way of trying to ensure it is not running in a virtual machine environment.
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) can parse the output of the native `system_profiler` tool to determine if the machine is running with 4 cores.(Citation: SentinelLabs reversing run-only applescripts 2021)
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has searched for the Activity Monitor process in the System Events process list and kills the process if running. [macOS.OSAMiner](https://attack.mitre.org/software/S1048) also searches the operating system's `install.log` for apps matching its hardcoded list, killing all matching process names.(Citation: SentinelLabs reversing run-only applescripts 2021)
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has used `ps ax | grep <name> | grep -v grep | ...` and `ps ax | grep -E...` to conduct process discovery.(Citation: SentinelLabs reversing run-only applescripts 2021)
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) can gather the device serial number.(Citation: SentinelLabs reversing run-only applescripts 2021)
It parses the output of the built-in system_profiler tool to check whether the device has 4 cores, a rudimentary way of trying to ensure it is not running in a virtual machine environment.
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) can parse the output of the native `system_profiler` tool to determine if the machine is running with 4 cores.(Citation: SentinelLabs reversing run-only applescripts 2021)
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has checked to ensure there is enough disk space using the Unix utility `df`.(Citation: SentinelLabs reversing run-only applescripts 2021)
[macOS.OSAMiner](https://attack.mitre.org/software/S1048) has used `curl` to download a [Stripped Payloads](https://attack.mitre.org/techniques/T1027/008) from a public facing adversary-controlled webpage.
Finally, running our tools on the miner setup script reveals that it functions as a downloader and config for what appears to be an instance of the open-source XMR-STAK-RX – Free Monero RandomX Miner software.
36 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
11 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.