PowerShell ScriptBlock Launching wscript.exe via PowerHold-like Code Patterns on Windows
Flags PowerShell ScriptBlock text that writes staged bytes in APPDATA and launches wscript.exe.
- 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 identifies PowerShell script block content that includes specific indicators related to writing payload bytes, locating APPDATA, defining a MainPayload function, and invoking wscript.exe. Attackers commonly use PowerShell to stage and execute secondary payloads, and wscript.exe can be leveraged to run scripts outside of PowerShell’s primary context. The detection relies on telemetry that captures PowerShell ScriptBlockText content on Windows and matches all listed substrings within the same script block.
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: PowerShell ScriptBlock Launching wscript.exe via PowerHold-like Code Patterns on Windows
id: c85512ed-0b96-4070-a853-16583d4ff585
status: test
description: This rule identifies PowerShell script block content that includes specific indicators related to writing payload bytes, locating APPDATA, defining a MainPayload function, and invoking wscript.exe. Attackers commonly use PowerShell to stage and execute secondary payloads, and wscript.exe can be leveraged to run scripts outside of PowerShell’s primary context. The detection relies on telemetry that captures PowerShell ScriptBlockText content on Windows and matches all listed substrings within the same script block.
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_powerhold.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:
- $env:APPDATA
- function MainPayload
- ::WriteAllBytes
- wscript.exe
condition: selection
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: 71c432c4-e4da-4eab-ba49-e60ea9a81bca
type: derived