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.

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: 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