Pirrit
Techniques & procedures
12 distinct techniques documented for this family, organized by ATT&CK tactic.
Execution
3 techniques
Execution
The Scripts archive contained multiple files... so we can focus on the postinstall script itself... #!/bin/bash ... The script defines a function func_act() which downloads and executes arbitrary content from a remote URL.
AppleScript offers offensive actors a plethora of ways to execute. In addition to simply executing a .scrpt file, you can run AppleScripts from Mail rules, from a shell script, in memory, from the command line, from within a MachO, in a plain text, uncompiled file, from an Automator workflow, from a Folder Action, a Finder Service or from a Calendar event.
This is seen in an HTML file displayed during the installation that claims to be associated with “Flash Player” and a background image using an Adobe logo.
Stealth
3 techniques
Stealth
many others write their AppleScript directly into a MachO binary, either in plain text strings or in obfuscated base64 or similar encoding. The next sample is a variant of a Pirrit malware... The authors use both plain text AppleScript and base64 encoded AppleScript
In this instance of malware and many others, the developer masquerades the installer to pose as an Adobe product. This is seen in an HTML file displayed during the installation that claims to be associated with “Flash Player” and a background image using an Adobe logo.
Finally, the script executes the process /var/tmp/act/act ... sleep 120 rm -rf /var/tmp/act/act rm -rf /var/tmp/act.tgz ... After executing, the contents from postinstall should not exist on the affected system anymore.
Discovery
3 techniques
Discovery
The first few lines grab the macOS version using sw_vers and the affected system’s UUID using ioreg.
The first few lines grab the macOS version using sw_vers and the affected system’s UUID using ioreg.
The script then unpacks it to /var/tmp/act . Finally, the script executes the process /var/tmp/act/act ... sleep 120 rm -rf /var/tmp/act/act rm -rf /var/tmp/act.tgz
Collection
2 techniques
Collection
attempting to perform automated keystrokes to copy the current URL to the user’s clipboard before replacing the URL to that of the attacker’s choice
The purpose of the AppleScript is to replace the user’s search query on popular search engines google, bing and yahoo, with one provided by the attacker’s shell script.
Command and Control
1 technique
Command and Control
No matter the version, however, the script downloads an act.tgz file from c.firstinstallmac[.]club and writes it to disk. The script then unpacks it to /var/tmp/act.
Observables
4 indicators attributed across vendor reports, sandbox runs, and researcher write-ups. Values are masked here and available in full in Mallory.
Recent activity
5 sources tracked across advisories, community write-ups, and news. New activity surfaces here as Mallory finds it.