macOS: Base64 Decoding via /usr/bin/base64 -d

Flags macOS base64 decoding by detecting /usr/bin/base64 runs with the -d argument.

FreeUnreviewedSigmalowv1
title: "macOS: Base64 Decoding via /usr/bin/base64 -d"
id: 41cc510b-5699-4c16-9e2a-8c983024b82f
status: test
description: This rule identifies process executions of /usr/bin/base64 with the -d option, indicating base64-encoded text is being decoded. Attackers commonly use encoding/decoding to hide payloads, stage commands, or transform data before execution, so decoding activity can be a useful stealth signal. It relies on macOS process creation telemetry capturing the executed image path and command-line arguments.
references:
  - https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1027/T1027.md
  - https://github.com/SigmaHQ/sigma/blob/master/rules/macos/process_creation/proc_creation_macos_base64_decode.yml
author: Daniil Yugoslavskiy, oscd.community, Huntrule Team
date: 2020-10-19
modified: 2022-11-26
tags:
  - attack.stealth
  - attack.t1027
logsource:
  category: process_creation
  product: macos
detection:
  selection:
    Image: /usr/bin/base64
    CommandLine|contains: -d
  condition: selection
falsepositives:
  - Legitimate activities
level: low
license: DRL-1.1
related:
  - id: 719c22d7-c11a-4f2c-93a6-2cfdd5412f68
    type: derived

What it detects

This rule identifies process executions of /usr/bin/base64 with the -d option, indicating base64-encoded text is being decoded. Attackers commonly use encoding/decoding to hide payloads, stage commands, or transform data before execution, so decoding activity can be a useful stealth signal. It relies on macOS process creation telemetry capturing the executed image path and command-line arguments.

Known false positives

  • Legitimate activities

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