MacOS LOLbin

Original Source: [splunk source]
Name:MacOS LOLbin
id:58d270fb-5b39-418e-a855-4b8ac046805e
version:4
date:2024-09-30
author:Patrick Bareiss, Splunk
status:production
type:TTP
Description:The following analytic detects multiple executions of Living off the Land (LOLbin) binaries on macOS within a short period. It leverages osquery to monitor process events and identifies commands such as "find", "crontab", "screencapture", "openssl", "curl", "wget", "killall", and "funzip". This activity is significant as LOLbins are often used by attackers to perform malicious actions while evading detection. If confirmed malicious, this behavior could allow attackers to execute arbitrary code, escalate privileges, or persist within the environment, posing a significant security risk.
Data_source:
search:`osquery_macro` name=es_process_events columns.cmdline IN ("find*", "crontab*", "screencapture*", "openssl*", "curl*", "wget*", "killall*", "funzip*")
| rename columns.* as *
| stats min(_time) as firstTime max(_time) as lastTime values(cmdline) as cmdline, values(pid) as pid, values(parent) as parent, values(path) as path, values(signing_id) as signing_id, dc(path) as dc_path by username host
| rename username as user, cmdline as process, path as process_path, host as dest
| where dc_path > 3
| `security_content_ctime(firstTime)`| `security_content_ctime(lastTime)`
| `macos_lolbin_filter`


how_to_implement: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.
known_false_positives:None identified.
References:
  -https://osquery.readthedocs.io/en/stable/deployment/process-auditing/
drilldown_searches:
name:'View the detection results for - "$user$" and "$dest$"'
search:'%original_detection_search% | search user = "$user$" dest = "$dest$"'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
name:'View risk events for the last 7 days for - "$user$" and "$dest$"'
search:'| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", "$dest$") starthoursago=168 | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
earliest_offset:'$info_min_time$'
latest_offset:'$info_max_time$'
tags:
  analytic_story:
    - 'Living Off The Land'
  asset_type:Endpoint
  confidence:50
  impact:50
  message:Multiplle LOLbin are executed on host $dest$ by user $user$
  mitre_attack_id:
    - 'T1059.004'
    - 'T1059'
  observable:
    name:'user'
    type:'User'
    - role:
      - 'Victim'
    name:'dest'
    type:'Hostname'
    - role:
      - 'Victim'
  product:
    - 'Splunk Enterprise'
    - 'Splunk Enterprise Security'
    - 'Splunk Cloud'
  required_fields:
    - '_time'
    - 'columns.cmdline'
    - 'columns.pid'
    - 'columns.parent'
    - 'columns.path'
    - 'columns.signing_id'
    - 'columns.username'
    - 'host'
  risk_score:25
  security_domain:endpoint

tests:
name:'True Positive Test'
 attack_data:
  data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1059.004/macos_lolbin/osquery.log
  source: osquery
  sourcetype: osquery:results
manual_test:None

Related Analytic Stories


Living Off The Land