Windows PowerShell Process Creation: COMPRESS OBFUSCATION with ASCII Encoding and DeflateStream

Flags PowerShell process creation command lines that use ASCII encoding plus compression/stream-reading patterns associated with obfuscation.

FreeReviewedSigma · Medium · v2
Product
windows
Category
process_creation
Author
Timur Zinniatullin, oscd.community (SigmaHQ), DRL 1.1
Published
2020-10-18
Updated
2026-07-31
title: "Windows PowerShell Process Creation: COMPRESS OBFUSCATION with ASCII Encoding and DeflateStream"
id: fb2709c0-f040-4bb4-a1bb-3d6be982ae98
status: test
description: Identifies PowerShell commands that include obfuscation-related patterns for data compression and ASCII encoding, specifically using DeflateStream and stream reading. Attackers may use these constructs to reduce readability of in-memory content and hinder analysis during execution. The rule relies on process creation telemetry, matching command-line substrings for PowerShell usage (new-object, ASCII encoding, DeflateStream, StreamReader, and ReadToEnd).
references:
  - https://github.com/SigmaHQ/sigma/issues/1009
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_hktl_invoke_obfuscation_via_compress.yml
author: Timur Zinniatullin, oscd.community, Huntrule Team
date: 2020-10-18
modified: 2022-12-29
tags:
  - attack.stealth
  - attack.t1027
  - attack.execution
  - attack.t1059.001
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    CommandLine|contains|all:
      - new-object
      - text.encoding]::ascii
    CommandLine|contains:
      - system.io.compression.deflatestream
      - system.io.streamreader
      - readtoend(
  condition: selection
falsepositives:
  - Unknown
level: medium
license: DRL-1.1
related:
  - id: 7eedcc9d-9fdb-4d94-9c54-474e8affc0c7
    type: derived