Invoke-Obfuscation Obfuscated IEX Invocation

 Original Source: [Sigma source]
Title: Invoke-Obfuscation Obfuscated IEX Invocation
Status: test
Description:Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the following code block
References:
  -https://github.com/danielbohannon/Invoke-Obfuscation/blob/f20e7f843edd0a3a7716736e9eddfa423395dd26/Out-ObfuscatedStringCommand.ps1#L873-L888
Author: Daniel Bohannon (@Mandiant/@FireEye), oscd.community
Date: 2019-11-08
modified:2026-03-16
Tags:
  • -'attack.stealth'
  • -'attack.t1027'
  • -'attack.execution'
  • -'attack.t1059.001'
Logsource:
  • category: process_creation
  • product: windows
Detection:
  selection:
CommandLine|re:'\$PSHome\[\s*\d{1,3}\s*\]\s*\+\s*\$PSHome\[' CommandLine|re:'\$ShellId\[\s*\d{1,3}\s*\]\s*\+\s*\$ShellId\[' CommandLine|re:'\$env:Public\[\s*\d{1,3}\s*\]\s*\+\s*\$env:Public\[' CommandLine|re:'\$env:ComSpec\[(?:\s*\d{1,3}\s*,){2}' CommandLine|re:'\*mdr\*\W\s*\)\.Name' CommandLine|re:'\$VerbosePreference\.ToString\(' CommandLine|re:'\[String\]\s*\$VerbosePreference'   condition:selection
Falsepositives:
  -Unknown
Level: high