Hidden Flag Set On File/Directory Via Chflags - MacOS

Detects the execution of the "chflags" utility with the "hidden" flag, in order to hide files on MacOS. When a file or directory has this hidden flag set, it becomes invisible to the default file listing commands and in graphical file browsers.

Sigma rule (View on GitHub)

 1title: Hidden Flag Set On File/Directory Via Chflags - MacOS
 2id: 3b2c1059-ae5f-40b6-b5d4-6106d3ac20fe
 3status: experimental
 4description: |
 5    Detects the execution of the "chflags" utility with the "hidden" flag, in order to hide files on MacOS.
 6    When a file or directory has this hidden flag set, it becomes invisible to the default file listing commands and in graphical file browsers.    
 7references:
 8    - https://www.sentinelone.com/labs/apt32-multi-stage-macos-trojan-innovates-on-crimeware-scripting-technique/
 9    - https://www.welivesecurity.com/2019/04/09/oceanlotus-macos-malware-update/
10    - https://www.paloaltonetworks.com/content/dam/pan/en_US/assets/pdf/reports/Unit_42/unit42-wirelurker.pdf
11    - https://ss64.com/mac/chflags.html
12author: Omar Khaled (@beacon_exe)
13date: 2024-08-21
14tags:
15    - attack.defense-evasion
16    - attack.t1218
17    - attack.t1564.004
18    - attack.t1552.001
19    - attack.t1105
20logsource:
21    product: macos
22    category: process_creation
23detection:
24    selection:
25        Image|endswith: '/chflags'
26        CommandLine|contains: 'hidden '
27    condition: selection
28falsepositives:
29    - Legitimate usage of chflags by administrators and users.
30level: medium

References

Related rules

to-top