Invoke-Obfuscation Obfuscated IEX Invocation - PowerShell

Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the following code block \u2014

Sigma rule (View on GitHub)

 1title: Invoke-Obfuscation Obfuscated IEX Invocation - PowerShell
 2id: 1b9dc62e-6e9e-42a3-8990-94d7a10007f7
 3status: test
 4description: Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the following code block \u2014
 5references:
 6    - https://github.com/danielbohannon/Invoke-Obfuscation/blob/f20e7f843edd0a3a7716736e9eddfa423395dd26/Out-ObfuscatedStringCommand.ps1#L873-L888
 7author: 'Daniel Bohannon (@Mandiant/@FireEye), oscd.community'
 8date: 2019/11/08
 9modified: 2022/12/31
10tags:
11    - attack.defense_evasion
12    - attack.t1027
13    - attack.execution
14    - attack.t1059.001
15logsource:
16    product: windows
17    category: ps_script
18    definition: 'Requirements: Script Block Logging must be enabled'
19detection:
20    selection_iex:
21        - ScriptBlockText|re: '\$PSHome\[\s*\d{1,3}\s*\]\s*\+\s*\$PSHome\['
22        - ScriptBlockText|re: '\$ShellId\[\s*\d{1,3}\s*\]\s*\+\s*\$ShellId\['
23        - ScriptBlockText|re: '\$env:Public\[\s*\d{1,3}\s*\]\s*\+\s*\$env:Public\['
24        - ScriptBlockText|re: '\$env:ComSpec\[(\s*\d{1,3}\s*,){2}'
25        - ScriptBlockText|re: '\*mdr\*\W\s*\)\.Name'
26        - ScriptBlockText|re: '\$VerbosePreference\.ToString\('
27    condition: selection_iex
28falsepositives:
29    - Unknown
30level: high

References

Related rules

to-top