Hi,
i wrote a Rule, but working the Exclusion "WindowsBackup" not.
Can you help me?
Regards
rule Powershell {
meta:
author = "..."
description = "Powershell Execution Policy Bypass Attack"
severity = "High"
events:
$shell.metadata.log_type = "POWERSHELL" nocase
$shell.metadata.event_type = "PROCESS_LAUNCH"
$shell.target.process.command_line != /WindowsBackup/ nocase and
re.regex ($shell.target.process.command_line, /-ep bypass/) nocase or
re.regex ($shell.target.process.command_line , /-nop/) nocase or
re.regex ($shell.target.process.command_line , /-executionpolicy bypass/) nocase or
re.regex ($shell.target.process.command_line , /-executionpolicy/) nocase
condition:
$shell
}
Best answer by herrald
I would try grouping the four re.regex lines with parentheses like this:
rule Powershell {
meta:
author = "..."
description = "Powershell Execution Policy Bypass Attack"
severity = "High"
events:
$shell.metadata.log_type = "POWERSHELL" nocase
$shell.metadata.event_type = "PROCESS_LAUNCH"
$shell.target.process.command_line != /WindowsBackup/ nocase and
(
re.regex ($shell.target.process.command_line, /-ep bypass/) nocase or
re.regex ($shell.target.process.command_line , /-nop/) nocase or
re.regex ($shell.target.process.command_line , /-executionpolicy bypass/) nocase or
re.regex ($shell.target.process.command_line , /-executionpolicy/) nocase
)
condition:
$shell
}