Windows PowerShell Script Block Matching POWERTRASH Behavior Indicators

Detects PowerShell ScriptBlock text containing POWERTRASH-related in-memory and dynamic execution indicators on Windows.

FreeReviewedSigma · High · v5
Product
windows
Category
ps_script
Author
Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2023-05-04
Updated
2026-07-31
title: Windows PowerShell Script Block Matching POWERTRASH Behavior Indicators
id: 5e5b3183-5b43-430d-8c65-28e32b6b88b1
status: test
description: This rule flags Windows PowerShell script content that includes a set of indicators commonly associated with dynamic in-memory execution patterns. Such behavior matters because attackers may embed and decode payloads (e.g., Base64), construct assemblies in memory, and invoke function pointers to run code without touching disk. The detection relies on telemetry that records PowerShell script block text and matches it against specific string components.
references:
  - https://labs.withsecure.com/publications/fin7-target-veeam-servers
  - https://github.com/SigmaHQ/sigma/blob/master/rules-emerging-threats/2023/TA/FIN7/posh_ps_apt_fin7_powertrash_execution.yml
author: Nasreddine Bencherchali (Nextron Systems), Huntrule Team
date: 2023-05-04
tags:
  - attack.execution
  - attack.t1059.001
  - attack.g0046
  - detection.emerging-threats
logsource:
  product: windows
  category: ps_script
  definition: bade5735-5ab0-4aa7-a642-a11be0e40872
detection:
  selection:
    ScriptBlockText|contains|all:
      - IO.Compression.DeflateStream
      - IO.MemoryStream
      - ::FromBase64String
      - GetDelegateForFunctionPointer
      - .Invoke()
      - GlobalAssemblyCache
  condition: selection
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: 4e19528a-f081-40dd-be09-90c39352bd64
    type: derived