PowerShell Script Block Obfuscation via cmd/clipboard and clip.exe execution

Identifies obfuscated PowerShell script blocks launching clip.exe and chaining clipboard-related execution.

FreeReviewedSigma · High · v2
Product
windows
Category
ps_script
Author
Jonathan Cheong, oscd.community (SigmaHQ), DRL 1.1
Published
2020-10-13
Updated
2026-07-31
title: PowerShell Script Block Obfuscation via cmd/clipboard and clip.exe execution
id: 96670d2c-a77f-481e-8d47-e3040aef3156
status: test
description: This rule identifies obfuscated PowerShell script block content that uses cmd.exe with /c or /r to run clip.exe (or clip) and includes clipboard-related string formatting patterns. Attackers may use this technique to execute commands indirectly and hide intent within heavily obfuscated script text. The detection relies on PowerShell Script Block Logging telemetry to match the specific obfuscation and clip/clipboard execution pattern.
references:
  - https://github.com/SigmaHQ/sigma/issues/1009
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/powershell/powershell_script/posh_ps_invoke_obfuscation_clip.yml
author: Jonathan Cheong, oscd.community, Huntrule Team
date: 2020-10-13
modified: 2024-04-05
tags:
  - attack.stealth
  - attack.t1027
  - attack.execution
  - attack.t1059.001
logsource:
  product: windows
  category: ps_script
  definition: "Requirements: Script Block Logging must be enabled"
detection:
  selection_4104:
    ScriptBlockText|re: cmd.{0,5}(?:/c|/r).+clip(?:\.exe)?.{0,4}&&.+clipboard]::\(\s\\"\{\d\}.+-f.+"
  condition: selection_4104
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: 73e67340-0d25-11eb-adc1-0242ac120002
    type: derived