macOS JXA In-Memory Execution via osascript JavaScript eval and NSData URL loading

Detects osascript-launched in-memory JXA JavaScript execution patterns using eval and URL-based data loading.

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 macOS process executions where the command line includes osascript with inline JavaScript evaluation, alongside logic that loads content into NSData from a URL. This pattern is significant because it supports in-memory execution workflows that can avoid writing a persistent script file. The detection relies on process creation telemetry with the full command line, looking for specific osascript flags and string indicators for JavaScript evaluation and URL-based NSData loading.

Related detections9 linkedT1059.007 — drag to rearrange
Suspicious Hidden PowerShell Spawned by Script Host via process_creation
Suspicious Node.js Execution of nvidia.js Script via cmd (via process_creation)
Suspicious Script Host Spawning PowerShell Download Cradle (via process_creation)
Malicious Data Exfiltration via curl with Stealer Specific BuildID Header
Suspicious osascript Password Prompt via AppleScript Display Dialog (via process_creation)
Suspicious PowerShell Spawned by Windows Script Host during Scarlet Goldfinch Infection (via process_creation)
Suspicious Windows Script Host Execution of JavaScript from Temporary Archive Extraction Folder (via process_creation)
Suspicious Whoami Discovery Spawned by Windows Script Host via Process Creation (via process_creation)
Suspicious Node.js Execution from User AppData Directory (via process_creation)
macOS JXA In-Memory Execution via osascript JavaScript eval and NSData URL loading
Pivot detection · T1059.007 · 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.