Suspicious Hidden Flag Set On File/Directory Through Chflags - MacOS (via process_creation)

This rule detects the execution of the "chflags" utility with the "hidden" flag, 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.

SigmamediummacOSv1
sigma
title: Suspicious Hidden Flag Set On File/Directory Through Chflags - MacOS (via process_creation)
id: d6265cb8-dba4-5292-9f2b-6435f0940a9b
status: stable
description: This rule detects the execution of the "chflags" utility with the "hidden" flag, 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.
references:
    - https://attack.mitre.org/techniques/T1105/
    - https://attack.mitre.org/techniques/T1552/001/
    - https://attack.mitre.org/techniques/T1564/004/
    - https://attack.mitre.org/techniques/T1218/
    - https://www.sentinelone.com/labs/apt32-multi-stage-macos-trojan-innovates-on-crimeware-scripting-technique/
    - https://www.welivesecurity.com/2019/04/09/oceanlotus-macos-malware-update/
    - https://www.paloaltonetworks.com/content/dam/pan/en_US/assets/pdf/reports/Unit_42/unit42-wirelurker.pdf
    - https://ss64.com/mac/chflags.html
author: Huntrule Team
date: 2026-07-02
tags:
    - attack.credential-access
    - attack.command-and-control
    - attack.stealth
    - attack.t1218
    - attack.t1564.004
    - attack.t1552.001
    - attack.t1105
logsource:
    product: macos
    category: process_creation
detection:
    selection:
        Image|endswith: '/chflags'
        CommandLine|contains: 'hidden '
    condition: selection
falsepositives:
    - Unknown
level: medium

Known false positives

  • Unknown

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.