title: Invoke-Obfuscation Obfuscated IEX Invocation author: Daniel Bohannon (@Mandiant/@FireEye), oscd.community date: 2019/11/08 description: "Detects all variations of obfuscated powershell IEX invocation code\ \ generated by Invoke-Obfuscation framework from the following code block \u2014\ \ https://github.com/danielbohannon/Invoke-Obfuscation/blob/master/Out-ObfuscatedStringCommand.ps1#L873-L888" detection: SELECTION_1: Payload|re: \$PSHome\[\s*\d{1,3}\s*\]\s*\+\s*\$PSHome\[ SELECTION_2: Payload|re: \$ShellId\[\s*\d{1,3}\s*\]\s*\+\s*\$ShellId\[ SELECTION_3: Payload|re: \$env:Public\[\s*\d{1,3}\s*\]\s*\+\s*\$env:Public\[ SELECTION_4: Payload|re: \$env:ComSpec\[(\s*\d{1,3}\s*,){2} SELECTION_5: Payload|re: \\\\*mdr\\\\*\W\s*\)\.Name SELECTION_6: Payload|re: \$VerbosePreference\.ToString\( SELECTION_7: Payload|re: \String\]\s*\$VerbosePreference condition: (SELECTION_1 or SELECTION_2 or SELECTION_3 or SELECTION_4 or SELECTION_5 or SELECTION_6 or SELECTION_7) falsepositives: - Unknown id: 2f211361-7dce-442d-b78a-c04039677378 level: high logsource: category: ps_module definition: PowerShell Module Logging must be enabled product: windows modified: 2021/10/16 related: - id: 1b9dc62e-6e9e-42a3-8990-94d7a10007f7 type: derived status: experimental tags: - attack.defense_evasion - attack.t1027 - attack.execution - attack.t1059.001 - attack.t1086 yml_filename: powershell_invoke_obfuscation_obfuscated_iex.yml yml_path: /Users/user/Documents/YamatoSecurity/sigma/rules/windows/powershell/powershell_module