osascript abuse
What it detects
AppleScript (osascript) used for shell execution, privilege escalation, or keystroke injection — a common macOS living-off-the-land execution technique.
MITRE ATT&CK mapping
- T1059.002Command and Scripting Interpreter: AppleScript· Execution
False positives and triage
Some admin tooling and installers legitimately use osascript. Judge by the invoking process, the script body, and whether privileges are requested.
The rule
Declarative YAML read by the detection engine — data, never executed. Confidence 70%. Source: rules/macos/osascript_abuse.yaml, licensed under the Apache License 2.0.
id: macos.execution.osascript_abuse
version: 1.0.0
status: stable
severity: high
confidence: 0.7
platforms: [macos]
mitre_techniques: [T1059.002]
description: |
AppleScript (osascript) used for shell execution, privilege escalation, or
keystroke injection — a common macOS living-off-the-land execution technique.
match:
raw_message_regex: '(?i)osascript\b.*(do shell script|with administrator privileges|keystroke|System Events)'
false_positive_guidance: |
Some admin tooling and installers legitimately use osascript. Judge by the
invoking process, the script body, and whether privileges are requested.
Related detections
Run this rule on your own logs — offline
KIROSEC runs this rule and the rest of the library over Windows, Linux, macOS and cloud audit logs on the analyst's own machine. Every alert links to the events that raised it, and nothing leaves the device.
