Detectionmediumtest

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.

Open in Detection LabConvert ruleBuild Package
Omar KhaledCreated 2024-08-213b2c1059-ae5f-40b6-b5d4-6106d3ac20femacos
Log Source
macOSProcess Creation
ProductmacOS← raw: macos
CategoryProcess Creation← raw: process_creation

Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.

Detection Logic
Detection Logic1 selector
detection:
    selection:
        Image|endswith: '/chflags'
        CommandLine|contains: 'hidden '
    condition: selection
False Positives

Legitimate usage of chflags by administrators and users.

Rule Metadata
Rule ID
3b2c1059-ae5f-40b6-b5d4-6106d3ac20fe
Status
test
Level
medium
Type
Detection
Created
2024-08-21
Path
rules/macos/process_creation/proc_creation_macos_chflags_hidden_flag.yml
Raw Tags
attack.credential-accessattack.command-and-controlattack.stealthattack.t1218attack.t1564.004attack.t1552.001attack.t1105
View on GitHub