Detection rules › Sigma

Suspicious Execution via macOS Script Editor

Status
test
Severity
medium
Log source
product macos, category process_creation
Author
Tim Rauch (rule), Elastic (idea)
Source
github.com/SigmaHQ/sigma

Detects when the macOS Script Editor utility spawns an unusual child process.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
ESFexecProcess Execution (Notify)

Rule body yaml

title: Suspicious Execution via macOS Script Editor
id: 6e4dcdd1-e48b-42f7-b2d8-3b413fc58cb4
status: test
description: Detects when the macOS Script Editor utility spawns an unusual child process.
author: Tim Rauch (rule), Elastic (idea)
references:
    - https://github.com/elastic/protections-artifacts/commit/746086721fd385d9f5c6647cada1788db4aea95f#diff-7f541fbc4a4a28a92970e8bf53effea5bd934604429112c920affb457f5b2685
    - https://wojciechregula.blog/post/macos-red-teaming-initial-access-via-applescript-url/
date: 2022-10-21
modified: 2022-12-28
logsource:
    category: process_creation
    product: macos
tags:
    - attack.defense-impairment
    - attack.t1566
    - attack.t1566.002
    - attack.initial-access
    - attack.t1059
    - attack.t1059.002
    - attack.t1204
    - attack.t1204.001
    - attack.execution
    - attack.persistence
    - attack.t1553
detection:
    selection_parent:
        ParentImage|endswith: '/Script Editor'
    selection_img:
        - Image|endswith:
              - '/curl'
              - '/bash'
              - '/sh'
              - '/zsh'
              - '/dash'
              - '/fish'
              - '/osascript'
              - '/mktemp'
              - '/chmod'
              - '/php'
              - '/nohup'
              - '/openssl'
              - '/plutil'
              - '/PlistBuddy'
              - '/xattr'
              - '/sqlite'
              - '/funzip'
              - '/popen'
        - Image|contains:
              - 'python'
              - 'perl'
    condition: all of selection_*
falsepositives:
    - Unknown
level: medium

Stages and Predicates

Stage 0: condition

all of selection_*

Stage 1: selection_parent

selection_parent:
    ParentImage|endswith: '/Script Editor'

Stage 2: selection_img

selection_img:
    - Image|endswith:
          - '/curl'
          - '/bash'
          - '/sh'
          - '/zsh'
          - '/dash'
          - '/fish'
          - '/osascript'
          - '/mktemp'
          - '/chmod'
          - '/php'
          - '/nohup'
          - '/openssl'
          - '/plutil'
          - '/PlistBuddy'
          - '/xattr'
          - '/sqlite'
          - '/funzip'
          - '/popen'
    - Image|contains:
          - 'python'
          - 'perl'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
Imageends_with
  • /PlistBuddy
  • /bash
  • /chmod
  • /curl
  • /dash
  • /fish
  • /funzip
  • /mktemp
  • /nohup
  • /openssl
  • /osascript
  • /php
  • /plutil
  • /popen
  • /sh
  • /sqlite
  • /xattr
  • /zsh
Imagematch
  • perl
  • python
ParentImageends_with
  • /Script Editor