Invoke-Obfuscation Obfuscated IEX Invocation - System

 Original Source: [Sigma source]
Title: Invoke-Obfuscation Obfuscated IEX Invocation - System
Status: test
Description:Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the code block linked in the references
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-11-27
Tags:
  • -'attack.stealth'
  • -'attack.t1027'
Logsource:
  • product: windows
  • service: system
Detection:
  selection_eid:
    EventID: '7045'
  selection_imagepath:
ImagePath|re:'\$PSHome\[\s*\d{1,3}\s*\]\s*\+\s*\$PSHome\[' ImagePath|re:'\$ShellId\[\s*\d{1,3}\s*\]\s*\+\s*\$ShellId\[' ImagePath|re:'\$env:Public\[\s*\d{1,3}\s*\]\s*\+\s*\$env:Public\[' ImagePath|re:'\$env:ComSpec\[(\s*\d{1,3}\s*,){2}' ImagePath|re:'\\*mdr\*\W\s*\)\.Name' ImagePath|re:'\$VerbosePreference\.ToString\(' ImagePath|re:'\String\]\s*\$VerbosePreference'   condition:all of selection_*
Falsepositives:
  -Unknown
Level: high