Windows PowerShell Script Block Matching POWERTRASH Behavior Indicators
Detects PowerShell ScriptBlock text containing POWERTRASH-related in-memory and dynamic execution indicators on Windows.
- Product
- windows
- Category
- ps_script
- Author
- Nasreddine Bencherchali (Nextron Systems) (SigmaHQ), DRL 1.1
- Published
- 2023-05-04
- Updated
- 2026-07-31
ATT&CK techniques
ExecutionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
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.
Reporting behind it
Changelog
v5- v5Candidate ingested via manual entry.2026-07-31
- v4Candidate ingested via manual entry.2026-07-31
- v3Candidate ingested via manual entry.2026-07-31
- 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: 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