Invoke-Obfuscation Obfuscated IEX Invocation - PowerShell Module

 Original Source: [Sigma source]
Title: Invoke-Obfuscation Obfuscated IEX Invocation - PowerShell Module
Status: test
Description:Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the code block cited in the reference section below
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:2022-12-31
Tags:
  • -'attack.stealth'
  • -'attack.t1027'
  • -'attack.execution'
  • -'attack.t1059.001'
Logsource:
  • product: windows
  • category: ps_module
  • definition: 0ad03ef1-f21b-4a79-8ce8-e6900c54b65b
Detection:
  selection_payload:
Payload|re:'\$PSHome\[\s*\d{1,3}\s*\]\s*\+\s*\$PSHome\[' Payload|re:'\$ShellId\[\s*\d{1,3}\s*\]\s*\+\s*\$ShellId\[' Payload|re:'\$env:Public\[\s*\d{1,3}\s*\]\s*\+\s*\$env:Public\[' Payload|re:'\$env:ComSpec\[(\s*\d{1,3}\s*,){2}' Payload|re:'\*mdr\*\W\s*\)\.Name' Payload|re:'\$VerbosePreference\.ToString\(' Payload|re:'\[String\]\s*\$VerbosePreference'   condition:selection_payload
Falsepositives:
  -Unknown
Level: high