MacOS Scripting Interpreter AppleScript
A Sigma rule for process creation on macOS, by Alejandro Ortuno, oscd.community.
medium 1 ATT&CK technique 1 program it names 6 everyday examples trip it
What it looks for
detection:
filter_optional_opencode:
CommandLine|contains|all:
- 'osascript'
- ' -e '
- 'set imageData to the clipboard'
- 'set fileRef'
ParentImage|endswith: 'opencode'
selection:
CommandLine|contains:
- ' -e '
- '.scpt'
- '.js'
Image|endswith: '/osascript'
condition: selection and not 1 of filter_optional_*
The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by Alejandro Ortuno, oscd.community, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.
Command lines that trip it
Run multiple AppleScript commands on the page for osascript
osascript -e 'say "Hello"' -e 'say "world"'IdentifyRun a compiled (*.scpt), bundled (*.scptd), or plaintext (*.applescript) AppleScript file on the page for osascript
osascript path/to/apple.scptIdentifyGet the bundle identifier of an application (useful for open -b) on the page for osascript
osascript -e 'id of app "Application"'Identify