diff --git a/rules/windows/builtin/win_invoke_obfuscation_obfuscated_iex_services.yml b/rules/windows/builtin/win_invoke_obfuscation_obfuscated_iex_services.yml new file mode 100644 index 000000000..86ab2be1a --- /dev/null +++ b/rules/windows/builtin/win_invoke_obfuscation_obfuscated_iex_services.yml @@ -0,0 +1,44 @@ +--- +action: global +title: Invoke-Obfuscation obfuscated IEX invocation +description: Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the following code block — https://github.com/danielbohannon/Invoke-Obfuscation/blob/master/Out-ObfuscatedStringCommand.ps1#L873-L888 +status: experimental +author: Daniel Bohannon (@Mandiant/@FireEye), oscd.community +date: 2019/11/08 +tags: + - attack.defense_evasion + - attack.t1027 +falsepositives: + - Unknown +level: high +detection: + selection: + - 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: selection +--- +logsource: + product: windows + service: system +detection: + selection: + EventID: 7045 +--- +logsource: + product: windows + service: sysmon +detection: + selection: + EventID: 6 +--- + logsource: + product: windows + service: security + detection: + selection: + EventID: 4697 diff --git a/rules/windows/powershell/powershell_invoke_obfuscation_obfuscated_iex.yml b/rules/windows/powershell/powershell_invoke_obfuscation_obfuscated_iex.yml new file mode 100644 index 000000000..502ede577 --- /dev/null +++ b/rules/windows/powershell/powershell_invoke_obfuscation_obfuscated_iex.yml @@ -0,0 +1,36 @@ +title: Invoke-Obfuscation obfuscated IEX invocation +description: Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the following code block — https://github.com/danielbohannon/Invoke-Obfuscation/blob/master/Out-ObfuscatedStringCommand.ps1#L873-L888 +status: experimental +author: Daniel Bohannon (@Mandiant/@FireEye), oscd.community +date: 2019/11/08 +tags: + - attack.defense_evasion + - attack.t1027 +logsource: + product: windows + service: powershell +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}' + - ScriptBlockText|re: '\*mdr\*\W\s*\)\.Name' + - 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}' + - Payload|re: '\*mdr\*\W\s*\)\.Name' + - 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 diff --git a/rules/windows/process_creation/win_invoke_obfuscation_obfuscated_iex_commandline.yml b/rules/windows/process_creation/win_invoke_obfuscation_obfuscated_iex_commandline.yml new file mode 100644 index 000000000..3921bd196 --- /dev/null +++ b/rules/windows/process_creation/win_invoke_obfuscation_obfuscated_iex_commandline.yml @@ -0,0 +1,24 @@ +title: Invoke-Obfuscation obfuscated IEX invocation +description: Detects all variations of obfuscated powershell IEX invocation code generated by Invoke-Obfuscation framework from the following code block — https://github.com/danielbohannon/Invoke-Obfuscation/blob/master/Out-ObfuscatedStringCommand.ps1#L873-L888 +status: experimental +author: Daniel Bohannon (@Mandiant/@FireEye), oscd.community +date: 2019/11/08 +tags: + - attack.defense_evasion + - attack.t1027 +logsource: + product: windows + service: process_creation +detection: + selection: + - CommandLine|re: '\$PSHome\[\s*\d{1,3}\s*\]\s*\+\s*\$PSHome\[' + - CommandLine|re: '\$ShellId\[\s*\d{1,3}\s*\]\s*\+\s*\$ShellId\[' + - CommandLine|re: '\$env:Public\[\s*\d{1,3}\s*\]\s*\+\s*\$env:Public\[' + - CommandLine|re: '\$env:ComSpec\[(\s*\d{1,3}\s*,){2}' + - CommandLine|re: '\*mdr\*\W\s*\)\.Name' + - CommandLine|re: '\$VerbosePreference\.ToString\(' + - CommandLine|re: '\String\]\s*\$VerbosePreference' + condition: selection +falsepositives: + - Unknown +level: high