Detection: MacOS Osascript Displaying Suspicious User Prompt

Description

The following analytic detects the execution of the macOS osascript utility with AppleScript commands that display a dialog or alert containing potentially deceptive, credential-related, or security-themed content. Adversaries may abuse osascript to present fake system messages or credential prompts and trick users into disclosing sensitive information. This detection is based on command-line content and should be reviewed with the parent process, executing user, script content, and surrounding endpoint activity.

 1
 2| tstats `security_content_summariesonly`
 3  count min(_time) as firstTime
 4        max(_time) as lastTime
 5
 6FROM datamodel=Endpoint.Processes WHERE
 7
 8Processes.process_name="osascript"
 9Processes.process IN (
10    "*display alert*",
11    "*display dialog*"
12)
13Processes.process IN (
14    "*access System*",
15    "*authentication*",
16    "*credentials*",
17    "*critical update*",
18    "*needs your attention*",
19    "*password*",
20    "*security update*",
21    "*system error*",
22    "*verify*",
23    "*with hidden answer*"
24)
25
26BY Processes.dest Processes.original_file_name Processes.parent_process_id
27   Processes.process Processes.process_exec Processes.process_guid
28   Processes.process_hash Processes.process_id
29   Processes.process_current_directory Processes.process_name
30   Processes.process_path Processes.user
31   Processes.user_id Processes.vendor_product
32
33
34| `drop_dm_object_name(Processes)`
35
36| `security_content_ctime(firstTime)`
37
38| `security_content_ctime(lastTime)`
39
40| `macos_osascript_displaying_suspicious_user_prompt_filter`

Data Source

Name Platform Sourcetype Source
Osquery Results Other 'osquery:results' 'osquery'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
macos_osascript_displaying_suspicious_user_prompt_filter search *
macos_osascript_displaying_suspicious_user_prompt_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1056.002 GUI Input Capture Collection
T1059.002 AppleScript Credential Access
Exploitation
Installation
DE.AE
CIS 10

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Finding (Notable) No
Creates Intermediate Finding (Risk Event) Yes
Anomaly detections generate Intermediate Findings (Risk Events). They do not generate a Finding (Notable) directly.

Implementation

This detection uses osquery and endpoint security on MacOS. Follow the link in references, which describes how to setup process auditing in MacOS with endpoint security and osquery. Also the TA-OSquery must be deployed across your indexers and universal forwarders in order to have the osquery data populate the data models.

Known False Positives

Legitimate administrative, MDM, software deployment, support, or automation scripts may use osascript to display dialogs or alerts. Review the parent process, executing user, script content, signer, and known administrative tooling before suppressing the activity.

Associated Analytic Story

Intermediate Findings

Message Entity Field Entity Type Risk Score
The osascript utility executed a command containing dialog-related and potentially deceptive content on endpoint [$dest$] with the Command Line [$process$]. dest system 20

Threat Objects

Field Type
process process

References

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Passing N/A N/A N/A
Unit Passing Dataset osquery osquery:results
Integration ✅ Passing Dataset osquery osquery:results

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub |

Version: 1