macOS OSACompile Run-Only Script Execution

Flags osacompile commands on macOS using run-only (-x) with inline script (-e) execution.

FreeReviewedSigma · High · v2
Product
macos
Category
process_creation
Author
Sohan G (D4rkCiph3r) (SigmaHQ), DRL 1.1
Published
2023-01-31
Updated
2026-07-31

ATT&CK techniques

Execution
  1. Recon

  2. Resource Dev

  3. Initial Access

  4. Persistence

  5. Priv Esc

  6. Defense Evasion

  7. Cred Access

  8. Discovery

  9. Lateral Movement

  10. Collection

  11. C2

  12. Exfiltration

  13. Impact

What it detects

This rule flags process creations where the command line includes OSACompile with run-only indicators, specifically the presence of ' -x ' and ' -e '. Attackers can use OSACompile to execute embedded AppleScript/OSAScript content directly, which can support short-lived or hard-to-review execution flows. Detection relies on macOS process creation telemetry, matching command-line substrings in the spawned process.

Related detections9 linkedT1059.002 — drag to rearrange
Suspicious Osascript Requesting Administrator Privileges (via process_creation)
Malicious Remote Script Piped to a Shell on macOS (via process_creation)
AppleScript do-shell-script Abuse via Osascript (via process_creation)
Suspicious AppleScript Payload Execution via osascript (macOS)
Suspicious AppleScript Execution Spawning a Shell via Osascript
Suspicious osascript Execution of Encoded AppleScript on macOS (via process_creation)
Suspicious Credential Prompt Phishing via osascript (via process_creation)
Malicious ClickFix Stager Piping curl Output to osascript
Suspicious Shell Execution Referencing Mounted DMG Volume via Terminal (macOS)
macOS OSACompile Run-Only Script Execution
Pivot detection · T1059.002 · 9 related

Changelog

v2
  1. v2
    Candidate ingested via manual entry.2026-07-31
  2. v1
    No changelog recorded for this version.2026-07-30

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.