A sneaky macOS malware called OSAMiner had been infecting Macs without anyone noticing, by hiding using AppleScripts and mining cryptocurrency, since 2015.
As per security firm SentinelOne, OSAMiner had been distributed using pirated versions of Mac game like League of Legends (which is usually available to download for free), and Microsoft Office. Once users would download and install infected software, OSAMiner would use run-only AppleScripts to embed itself into the system.
OSAMiner has been secretly mining cryptocurrency on affected Macs
OSAMiner has been active since 2015, secretly mining cryptocurrency on affected Macs. The malware has also evolved recently and has primarily targeted users in China and Asia-Pacific.
When users downloaded the affected apps, an AppleScript would be downloaded which would run a second AppleScript, which would, in turn, download the third AppleScript. These “run-only” AppleScripts made it easier for OSAMiner to avoid detection over the years.
SentinelOne noted that run-only AppleScripts are rarely used for macOS malware, but OSAMiner showed that they are incredibly powerful for malicious intents and can be used to remain hidden from detection:
Run-only AppleScripts are surprisingly rare in the macOS malware world, but both the longevity of and the lack of attention to the macOS.OSAMiner campaign, which has likely been running for at least 5 years, shows exactly how powerful run-only AppleScripts can be for evasion and anti-analysis. In this case, we have not seen the actor use any of the more powerful features of AppleScript that we’ve discussed elsewhere, but that is an attack vector that remains wide open and which many defensive tools are not equipped to handle. In the event that other threat actors begin picking up on the utility of leveraging run-only AppleScripts, we hope this research and the tools discussed above will prove to be of use to analysts.
Now that OSAMiner has been detected and its complex architecture has been reverse engineered, it will help other researchers in finding any other hidden “run only” AppleScript malware. To keep yourself safe from such malware, make sure that you only download apps from trustworthy sources.