macOS: Process commands with trailing space in filename to evade matching
Alerts on macOS processes whose command line and image path end with a trailing space, a common filename masquerading trick.
- Product
- macos
- Category
- process_creation
- Author
- remotephone (SigmaHQ), DRL 1.1
- Published
- 2021-11-20
- Updated
- 2026-07-31
ATT&CK techniques
Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags process creation events where either the full command line or the executed image path ends with a trailing space. Attackers can use trailing whitespace to masquerade as legitimate filenames while evading naive string matching and filters. The detection relies on process creation telemetry that includes the process Image path and the CommandLine text.
Reporting behind it
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "macOS: Process commands with trailing space in filename to evade matching"
id: cf0ccb7b-66c5-4250-8acd-00d4c55cf105
status: test
description: This rule flags process creation events where either the full command line or the executed image path ends with a trailing space. Attackers can use trailing whitespace to masquerade as legitimate filenames while evading naive string matching and filters. The detection relies on process creation telemetry that includes the process Image path and the CommandLine text.
references:
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1036.006/T1036.006.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/macos/process_creation/proc_creation_macos_space_after_filename.yml
author: remotephone, Huntrule Team
date: 2021-11-20
modified: 2023-01-04
tags:
- attack.stealth
- attack.t1036.006
logsource:
product: macos
category: process_creation
detection:
selection1:
CommandLine|endswith: " "
selection2:
Image|endswith: " "
condition: 1 of selection*
falsepositives:
- Mistyped commands or legitimate binaries named to match the pattern
level: low
license: DRL-1.1
related:
- id: b6e2a2e3-2d30-43b1-a4ea-071e36595690
type: derived