2020-02-20 23:00:16 +01:00
title : Invoke-Obfuscation Obfuscated IEX Invocation
2019-12-19 23:56:36 +01:00
id : 1b9dc62e-6e9e-42a3-8990-94d7a10007f7
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"
2019-11-27 00:02:45 +01:00
status : experimental
author : Daniel Bohannon (@Mandiant/@FireEye), oscd.community
date : 2019 /11/08
2020-08-24 23:31:26 +00:00
modified : 2020 /08/24
2019-11-27 00:02:45 +01:00
tags :
- attack.defense_evasion
- attack.t1027
2020-08-24 00:01:50 +00:00
- attack.execution
- attack.t1059.001
2020-08-25 23:51:22 +00:00
- attack.t1086 #an old one
2019-11-27 00:02:45 +01:00
logsource :
product : windows
service : powershell
2021-08-21 09:50:59 +02:00
definition : Script block logging must be enabled for 4104, Module Logging must be enabled for 4103
2019-11-27 00:02:45 +01:00
detection :
selection_1 :
EventID : 4104
selection_2 :
- ScriptBlockText|re : '\$PSHome\[\s*\d{1,3}\s*\]\s*\+\s*\$PSHome\['
- ScriptBlockText|re : '\$ShellId\[\s*\d{1,3}\s*\]\s*\+\s*\$ShellId\['
- ScriptBlockText|re : '\$env:Public\[\s*\d{1,3}\s*\]\s*\+\s*\$env:Public\['
- ScriptBlockText|re : '\$env:ComSpec\[(\s*\d{1,3}\s*,){2}'
2021-09-07 23:38:07 +02:00
- ScriptBlockText|re : '\\\\*mdr\\\\*\W\s*\)\.Name'
2019-11-27 00:02:45 +01:00
- ScriptBlockText|re : '\$VerbosePreference\.ToString\('
- ScriptBlockText|re : '\String\]\s*\$VerbosePreference'
selection_3 :
EventID : 4103
selection_4 :
- 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}'
2021-09-07 23:38:07 +02:00
- Payload|re : '\\\\*mdr\\\\*\W\s*\)\.Name'
2019-11-27 00:02:45 +01:00
- Payload|re : '\$VerbosePreference\.ToString\('
- Payload|re : '\String\]\s*\$VerbosePreference'
condition : ( selection_1 and selection_2 ) or ( selection_3 and selection_4 )
falsepositives :
- Unknown
level : high