macOS: dscl Used to Append User to /Groups/admin Group

Flags dscl commands on macOS that append a user into the local admin group membership.

FreeUnreviewedSigmamediumv1
title: "macOS: dscl Used to Append User to /Groups/admin Group"
id: d5a883e1-752e-4c19-9eb2-a67cc1482b96
related:
  - id: 0c1ffcf9-efa9-436e-ab68-23a9496ebf5b
    type: obsolete
  - id: b743623c-2776-40e0-87b1-682b975d0ca5
    type: derived
status: test
description: This rule identifies process executions where dscl is used to modify local group membership by appending a user to the /Groups/admin GroupMembership. Adding accounts to the admin group grants elevated privileges and can be used for persistence or privilege escalation. It relies on macOS process creation telemetry matching dscl command-line arguments that include the append action, the admin group path, and the GroupMembership field.
references:
  - https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1078.003/T1078.003.md#atomic-test-2---create-local-account-with-admin-privileges---macos
  - https://ss64.com/osx/dscl.html
  - https://github.com/SigmaHQ/sigma/blob/master/rules/macos/process_creation/proc_creation_macos_dscl_add_user_to_admin_group.yml
author: Sohan G (D4rkCiph3r), Huntrule Team
date: 2023-03-19
tags:
  - attack.persistence
  - attack.initial-access
  - attack.privilege-escalation
  - attack.stealth
  - attack.t1078.003
logsource:
  category: process_creation
  product: macos
detection:
  selection:
    Image|endswith: /dscl
    CommandLine|contains|all:
      - " -append "
      - " /Groups/admin "
      - " GroupMembership "
  condition: selection
falsepositives:
  - Legitimate administration activities
level: medium
license: DRL-1.1

What it detects

This rule identifies process executions where dscl is used to modify local group membership by appending a user to the /Groups/admin GroupMembership. Adding accounts to the admin group grants elevated privileges and can be used for persistence or privilege escalation. It relies on macOS process creation telemetry matching dscl command-line arguments that include the append action, the admin group path, and the GroupMembership field.

Known false positives

  • Legitimate administration activities

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