Invoke-Obfuscation Obfuscated IEX Invocation - Security

Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the code block linked in the references

Sigma rule (View on GitHub)

 1title: Invoke-Obfuscation Obfuscated IEX Invocation - Security
 2id: fd0f5778-d3cb-4c9a-9695-66759d04702a
 3related:
 4    - id: 51aa9387-1c53-4153-91cc-d73c59ae1ca9
 5      type: derived
 6status: test
 7description: Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the code block linked in the references
 8references:
 9    - https://github.com/danielbohannon/Invoke-Obfuscation/blob/f20e7f843edd0a3a7716736e9eddfa423395dd26/Out-ObfuscatedStringCommand.ps1#L873-L888
10author: Daniel Bohannon (@Mandiant/@FireEye), oscd.community
11date: 2019-11-08
12modified: 2022-11-27
13tags:
14    - attack.defense-evasion
15    - attack.t1027
16logsource:
17    product: windows
18    service: security
19    definition: The 'System Security Extension' audit subcategory need to be enabled to log the EID 4697
20detection:
21    selection_eid:
22        EventID: 4697
23    selection_servicefilename:
24        - ServiceFileName|re: '\$PSHome\[\s*\d{1,3}\s*\]\s*\+\s*\$PSHome\['
25        - ServiceFileName|re: '\$ShellId\[\s*\d{1,3}\s*\]\s*\+\s*\$ShellId\['
26        - ServiceFileName|re: '\$env:Public\[\s*\d{1,3}\s*\]\s*\+\s*\$env:Public\['
27        - ServiceFileName|re: '\$env:ComSpec\[(\s*\d{1,3}\s*,){2}'
28        - ServiceFileName|re: '\\*mdr\*\W\s*\)\.Name'
29        - ServiceFileName|re: '\$VerbosePreference\.ToString\('
30        - ServiceFileName|re: '\String\]\s*\$VerbosePreference'
31    condition: all of selection_*
32falsepositives:
33    - Unknown
34level: high

References

Related rules

to-top