Detection rules › Sigma

File and Directory Discovery - MacOS

Status
test
Severity
informational
Log source
product macos, category process_creation
Author
Daniil Yugoslavskiy, oscd.community
Source
github.com/SigmaHQ/sigma

Detects usage of system utilities to discover files and directories

MITRE ATT&CK coverage

TacticTechniques
DiscoveryT1083 File and Directory Discovery

Event coverage

ProviderEventTitle
ESFexecProcess Execution (Notify)

Rule body yaml

title: File and Directory Discovery - MacOS
id: 089dbdf6-b960-4bcc-90e3-ffc3480c20f6
status: test
description: Detects usage of system utilities to discover files and directories
references:
    - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1083/T1083.md
author: Daniil Yugoslavskiy, oscd.community
date: 2020-10-19
modified: 2022-11-25
tags:
    - attack.discovery
    - attack.t1083
logsource:
    category: process_creation
    product: macos
detection:
    select_file_with_asterisk:
        Image: '/usr/bin/file'
        CommandLine|re: '(.){200,}' # execution of the 'file */* *>> /tmp/output.txt' will produce huge commandline
    select_recursive_ls:
        Image: '/bin/ls'
        CommandLine|contains: '-R'
    select_find_execution:
        Image: '/usr/bin/find'
    select_mdfind_execution:
        Image: '/usr/bin/mdfind'
    select_tree_execution|endswith:
        Image: '/tree'
    condition: 1 of select*
falsepositives:
    - Legitimate activities
level: informational

Stages and Predicates

Stage 0: condition

1 of select*

Stage 1: select_file_with_asterisk

select_file_with_asterisk:
    Image: '/usr/bin/file'
    CommandLine|re: '(.){200,}'

Stage 2: select_recursive_ls

select_recursive_ls:
    Image: '/bin/ls'
    CommandLine|contains: '-R'

Stage 3: select_find_execution

select_find_execution:
    Image: '/usr/bin/find'

Stage 4: select_mdfind_execution

select_mdfind_execution:
    Image: '/usr/bin/mdfind'

Stage 5: select_tree_execution|endswith

Image: '/tree'

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
CommandLinematch
  • -R
CommandLineregex_match
  • (.){200,}
Imageeq
  • /bin/ls
  • /tree
  • /usr/bin/file
  • /usr/bin/find
  • /usr/bin/mdfind