macOS: Detect Axios malicious npm execution chain using osascript, curl download, and cleanup

Flags macOS command-line patterns showing osascript execution plus npm package download and staged file cleanup.

FreeReviewedSigma · High · v5
Product
macos
Category
process_creation
Author
Swachchhanda Shrawan Poudel (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2026-04-01
Updated
2026-07-31

ATT&CK techniques

Initial Access → C2
  1. Recon

  2. Resource Dev

  3. Persistence

  4. Priv Esc

  5. Defense Evasion

  6. Cred Access

  7. Discovery

  8. Lateral Movement

  9. Collection

  10. Exfiltration

  11. Impact

What it detects

This rule flags a specific macOS process execution sequence that includes AppleScript execution (via osascript), a curl-based payload download from packages.npm.org, subsequent permission modification and execution, and removal of a referenced temporary path. Attackers can use a compromised npm dependency to trigger this local execution chain to stage and run further tooling. It relies on process creation telemetry and matches on command-line substrings referencing osascript usage, the npm download URL pattern, and the cleanup of a hardcoded /tmp path.

Related detections9 linkedT1105 — drag to rearrange
Linux process chain for Axios NPM compromise: curl download with nohup and python3
Malicious Download Piped to Shell via curl or wget (via process_creation)
Possible Mirai IoT Payload Staging via chmod on Linux (via process_creation)
Suspicious GeoServer Java Process Spawning Download Utility
Malicious Linux Payload Download and Execution Chain via Wget and Chmod (via process_creation)
Suspicious Execution From Hidden fonts-unix Directory in tmp on Linux
Suspicious tmp Download and Execute Chain on Embedded Linux
Suspicious osascript Spawning Shell curl to External Host on macOS (via process_creation)
Malicious AppleScript Execution of curl-Fetched Shell Payload via osascript (via process_creation)
macOS: Detect Axios malicious npm execution chain using osascript, curl download, and cleanup
Pivot detection · T1105 · 9 related

Changelog

v5
  1. v5
    Candidate ingested via manual entry.2026-07-31
  2. v4
    Candidate ingested via manual entry.2026-07-31
  3. v3
    Candidate ingested via manual entry.2026-07-31
  4. v2
    Candidate ingested via manual entry.2026-07-31
  5. 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.