PowerShell NTFS Alternate Data Stream Writes via set-content/add-content
Alerts on PowerShell Set/Add-Content operations that specify -Stream, indicating potential NTFS Alternate Data Stream writes.
- Product
- windows
- Category
- ps_script
- Author
- Sami Ruohonen (SigmaHQ), DRL 1.1
- Published
- 2018-07-24
- Updated
- 2026-07-31
ATT&CK techniques
Execution → 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 identifies PowerShell script blocks that write to NTFS alternate data streams by combining set-content or add-content with the -stream parameter. Attackers can use alternate data streams to hide or stage content within NTFS files, making this behavior relevant for stealthy data concealment. It relies on PowerShell Script Block Logging telemetry to capture ScriptBlockText content matching these cmdlets and the -stream argument.
Reporting behind it
- web.archive.orghttps://web.archive.org/web/20220614030603/http://www.powertheshell.com/ntfsstreams/
- github.comhttps://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1564.004/T1564.004.md
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_ntfs_ads_access.yml
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: PowerShell NTFS Alternate Data Stream Writes via set-content/add-content
id: c3150474-e6e3-45c4-aa7b-7b38201931fa
status: test
description: This rule identifies PowerShell script blocks that write to NTFS alternate data streams by combining set-content or add-content with the -stream parameter. Attackers can use alternate data streams to hide or stage content within NTFS files, making this behavior relevant for stealthy data concealment. It relies on PowerShell Script Block Logging telemetry to capture ScriptBlockText content matching these cmdlets and the -stream argument.
references:
- https://web.archive.org/web/20220614030603/http://www.powertheshell.com/ntfsstreams/
- https://github.com/redcanaryco/atomic-red-team/blob/f339e7da7d05f6057fdfcdd3742bfcf365fee2a9/atomics/T1564.004/T1564.004.md
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_ntfs_ads_access.yml
author: Sami Ruohonen, Huntrule Team
date: 2018-07-24
modified: 2022-12-25
tags:
- attack.stealth
- attack.t1564.004
- attack.execution
- attack.t1059.001
logsource:
product: windows
category: ps_script
definition: "Requirements: Script Block Logging must be enabled"
detection:
selection_content:
ScriptBlockText|contains:
- set-content
- add-content
selection_stream:
ScriptBlockText|contains: -stream
condition: all of selection*
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: 8c521530-5169-495d-a199-0a3a881ad24e
type: derived