|
| 1 | +name: MacOS Hidden Files and Directories |
| 2 | +id: 51c43b7b-e406-45d2-9bad-5c67f07e6528 |
| 3 | +version: 1 |
| 4 | +date: '2026-02-26' |
| 5 | +author: Raven Tait, Splunk |
| 6 | +status: production |
| 7 | +type: Anomaly |
| 8 | +description: The following analytic detects suspicious creation of hidden files and directories, which may indicate an attacker's attempt to conceal malicious activities or unauthorized data. Hidden files and directories are often used to evade detection by security tools and administrators, providing a stealthy means for storing malware, logs, or sensitive information. By monitoring for unusual or unauthorized creation of hidden files and directories, this analytic helps identify potential attempts to hide or unauthorized creation of hidden files and directories, and helps identify potential attempts to hide malicious operations, enabling security teams to uncover and address hidden threats effectively. |
| 9 | +data_source: |
| 10 | + - osquery |
| 11 | +search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where (Processes.process="*chflags *" AND Processes.process="* hidden*") OR (Processes.process="*xattr *" AND Processes.process="* -c *") by Processes.dest Processes.original_file_name Processes.parent_process_id Processes.process Processes.process_exec Processes.process_guid Processes.process_hash Processes.process_id Processes.process_current_directory Processes.process_name Processes.process_path Processes.user Processes.user_id Processes.vendor_product | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `macos_hidden_files_and_directories_filter`' |
| 12 | +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. Also the [TA-OSquery](https://github.com/d1vious/TA-osquery) must be deployed across your indexers and universal forwarders in order to have the osquery data populate the data models. |
| 13 | +known_false_positives: Power users or developers utilizing build tools or CI/CD tools could trigger this activity. |
| 14 | +references: |
| 15 | + - https://osquery.readthedocs.io/en/stable/deployment/process-auditing/ |
| 16 | +drilldown_searches: |
| 17 | + - name: View the detection results for - "$user$" and "$dest$" |
| 18 | + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' |
| 19 | + earliest_offset: $info_min_time$ |
| 20 | + latest_offset: $info_max_time$ |
| 21 | + - name: View risk events for the last 7 days for - "$user$" and "$dest$" |
| 22 | + 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)`' |
| 23 | + earliest_offset: $info_min_time$ |
| 24 | + latest_offset: $info_max_time$ |
| 25 | +rba: |
| 26 | + message: Attempt to hide files on $dest$ by $user$ |
| 27 | + risk_objects: |
| 28 | + - field: user |
| 29 | + type: user |
| 30 | + score: 35 |
| 31 | + - field: dest |
| 32 | + type: system |
| 33 | + score: 35 |
| 34 | + threat_objects: [] |
| 35 | +tags: |
| 36 | + analytic_story: |
| 37 | + - MacOS Persistence Techniques |
| 38 | + asset_type: Endpoint |
| 39 | + mitre_attack_id: |
| 40 | + - T1564.001 |
| 41 | + product: |
| 42 | + - Splunk Enterprise |
| 43 | + - Splunk Enterprise Security |
| 44 | + - Splunk Cloud |
| 45 | + security_domain: endpoint |
| 46 | +tests: |
| 47 | + - name: True Positive Test |
| 48 | + attack_data: |
| 49 | + - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1564.001/osquery_hidden_files/osquery.log |
| 50 | + source: osquery |
| 51 | + sourcetype: osquery:results |
0 commit comments