Suspicious Invoke-Obfuscation COMPRESS OBFUSCATION - PowerShell (via ps_script)

This rule detects Obfuscated Powershell via COMPRESS OBFUSCATION

SigmamediumWindowsv1
sigma
title: Suspicious Invoke-Obfuscation COMPRESS OBFUSCATION - PowerShell (via ps_script)
id: 98c42c71-e050-59a2-8f2c-599065f0175d
status: stable
description: This rule detects Obfuscated Powershell via COMPRESS OBFUSCATION
references:
    - https://attack.mitre.org/techniques/T1059/001/
    - https://attack.mitre.org/techniques/T1027/
    - https://github.com/SigmaHQ/sigma/issues/1009
author: Huntrule Team
date: 2026-01-07
tags:
    - attack.stealth
    - attack.t1027
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    category: ps_script
    definition: 'Requirements: Script Block Logging must be enabled'
detection:
    selection_4104:
        ScriptBlockText|contains|all:
            - 'new-object'
            - 'text.encoding]::ascii'
        ScriptBlockText|contains:
            - 'system.io.compression.deflatestream'
            - 'system.io.streamreader'
        ScriptBlockText|endswith: 'readtoend'
    condition: selection_4104
falsepositives:
    - Unknown
level: medium

Known false positives

  • Unknown

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