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.

FreeReviewedSigma · High · v2
Product
windows
Category
ps_script
Author
Sami Ruohonen (SigmaHQ), DRL 1.1
Published
2018-07-24
Updated
2026-07-31
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