AppleScript Abuse: Unpacking a macOS Phishing Campaign

AppleScript Abuse: Unpacking a macOS Phishing Campaign

Darktrace researchers uncovered a multistage AppleScript campaign targeting macOS users that uses phishing lures and social engineering to deliver a Node.js-based loader and attempt abuse of the macOS TCC privacy database to inherit permissions for trusted binaries. The campaign communicates with a C2 at sevrrhst[.]com, establishes persistence via LaunchAgents, and can fetch and execute additional Base64-encoded payloads and binaries. #TCC #sevrrhst

Keypoints

  • Infection begins with a phishing email prompting users to open an AppleScript masquerading as a .docx file (e.g., Confirmation_Token_Vesting.docx.scpt).
  • The initial AppleScript retrieves a secondary script from sevrrhst[.]com, creates a hidden ~/.ex.scpt, and executes it to continue the chain.
  • A fake credential prompt using AppKit steals macOS usernames and passwords, validates them locally, encodes them in Base64, and exfiltrates them to the C2.
  • The attacker attempts to forge TCC authorizations by extracting code-signing requirements from trusted binaries, injecting forged records into the TCC database, and killing tccd to force reload.
  • A modular Node.js loader is deployed into ~/Library/com.apple.commonjs and a LaunchAgent .plist ensures persistence; default.js and addon.js enable remote command execution and dynamic payload delivery.
  • The campaign’s TCC manipulation may succeed on older macOS versions but is likely to fail on up-to-date or MDM-managed systems due to integrity protections in tccd and system updates.

MITRE Techniques

  • [T1566 ] Phishing – Initial delivery used a phishing email prompting download/opening of an AppleScript masquerading as a document ( ‘The infection chain starts with a phishing email that prompts the user to download an AppleScript file named “Confirmation_Token_Vesting.docx.scpt”’ )
  • [T1059.002 ] Command and Scripting Interpreter: AppleScript – AppleScript files perform the initial fetch, execute hidden scripts, and present fake credential dialogs ( ‘Once the user opens the AppleScript file, they are presented with a prompt instructing them to run the script’ )
  • [T1059.004 ] Command and Scripting Interpreter: Unix Shell – The AppleScript builds and runs silent curl requests and executes shell commands such as dscl and killall ( ‘This part of the script builds a silent curl request to “sevrrhst[.]com”’ )
  • [T1059.007 ] Command and Scripting Interpreter: JavaScript – The attacker delivers JavaScript payloads (index.js, default.js, addon.js) that profile the system, act as loaders, and implement command loops ( ‘The JavaScript file, index.js, is a loader that profiles the system and sends the data to the C2’ )
  • [T1222.002 ] File and Directory Permissions Modification – The TCC directory is renamed and manipulated to enable injection of forged access records ( ‘To bypass integrity checks, the TCC directory is renamed to com.appled.tcc using Finder’ )
  • [T1036.005 ] Masquerading: Match Legitimate Name or Location – Malicious AppleScript filenames and installed directories mimic legitimate documents and macOS directories (e.g., Confirmation_Token_Vesting.docx.scpt and ~/Library/com.apple.commonjs) ( ‘The script creates a folder named com.apple.commonjs in ~/Library’ )
  • [T1140 ] Deobfuscate/Decode Files or Information – Several payloads and responses are Base64-encoded and decoded during execution ( ‘A request is made to the C2, which retrieves and executes a Base64-encoded script’ )
  • [T1547.001 ] Boot or Logon Autostart Execution: Launch Agent – Persistence is achieved by dropping a LaunchAgent .plist that launches node with default.js on load ( ‘A LaunchAgent .plist is also downloaded into the LaunchAgents directory to ensure the malware automatically starts’ )
  • [T1553.006 ] Subvert Trust Controls: Code Signing Policy Modification – The campaign extracts code-signing requirements from trusted apps and forges csreq entries to insert into TCC ( ‘Using the codesign command codesign -d –requirements, it extracts the designated code-signing requirement from the target application’ )
  • [T1082 ] System Information Discovery – The loader collects OS version, CPU, memory, disk layout, network interfaces, and running processes for profiling ( ‘The script identified the system platform… and then gathers OS version, CPU details, memory usage, disk layout, network interfaces, and running process’ )
  • [T1057 ] Process Discovery – The JavaScript profiling enumerates running processes as part of system fingerprinting ( ‘The script identified the system platform… and then gathers … running process’ )
  • [T1105 ] Ingress Tool Transfer – Additional tooling (Node binaries, archives, and binaries delivered as Base64) are retrieved from the C2 to the victim ( ‘These return a node archive, bundled Node.js binary, and a JavaScript payload’ )

Indicators of Compromise

  • [IP Address ] C2 server – 88.119.171.59
  • [Domain ] Command-and-control and distribution domains – sevrrhst[.]com, stomcs[.]com
  • [URL ] C2 endpoints used for registration and payload retrieval – https://sevrrhst[.]com/inc/register.php?req=next, https://sevrrhst[.]com/inc/register.php?req=init
  • [File Name ] Malicious AppleScript lures and payload names – Confirmation_Token_Vesting.docx.scpt, EDD_Questionnaire_Individual_Blank_Form.docx.scpt
  • [File Hash ] Known sample hashes for delivered scripts – d3539d71a12fe640f3af8d6fb4c680fd (Confirmation_Token_Vesting.docx.scpt), 94b7392133935d2034b8169b9ce50764 (EDD_Questionnaire_Individual_Blank_Form.docx.scpt)


Read more: https://www.darktrace.com/blog/applescript-abuse-unpacking-a-macos-phishing-campaign