Windows PowerShell Base64-encoded shellcode in ScriptBlockText

Flags PowerShell script blocks containing Base64 strings matching known shellcode markers.

FreeReviewedSigma · High · v2
Product
windows
Category
ps_script
Author
David Ledbetter (shellcode), Florian Roth (Nextron Systems) (SigmaHQ), DRL 1.1
Published
2018-11-17
Updated
2026-07-31
title: Windows PowerShell Base64-encoded shellcode in ScriptBlockText
id: 0483279a-782e-4c3c-b814-4a05e5fab68a
status: test
description: This rule flags PowerShell script block content that contains specific Base64-encoded sequences associated with embedded shellcode. Attackers may use Base64 to conceal payloads within otherwise normal-looking PowerShell execution, aiming to increase stealth. The detection relies on Script Block Logging telemetry by matching the presence of the defined encoded markers in the captured ScriptBlockText.
references:
  - https://twitter.com/cyb3rops/status/1063072865992523776
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_shellcode_b64.yml
author: David Ledbetter (shellcode), Florian Roth (Nextron Systems), Huntrule Team
date: 2018-11-17
modified: 2024-01-25
tags:
  - attack.privilege-escalation
  - attack.stealth
  - attack.t1055
  - attack.execution
  - attack.t1059.001
logsource:
  product: windows
  category: ps_script
  definition: "Requirements: Script Block Logging must be enabled"
detection:
  selection:
    ScriptBlockText|contains:
      - OiCAAAAYInlM
      - OiJAAAAYInlM
  condition: selection
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: 16b37b70-6fcf-4814-a092-c36bd3aafcbd
    type: derived