From 85f05f928bb23dd1435cb76cc70ad2b54074a6d2 Mon Sep 17 00:00:00 2001 From: Jonhnathan Date: Fri, 4 Feb 2022 15:44:27 -0300 Subject: [PATCH] [New Rule] PowerShell Script Block Logging Disabled (#1749) * PowerShell Script Block Logging Disabled * Update rules/windows/defense_evasion_disable_posh_scriptblocklogging.toml Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com> * Update defense_evasion_disable_posh_scriptblocklogging.toml * Apply suggestions from code review Co-authored-by: Justin Ibarra Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com> Co-authored-by: Justin Ibarra (cherry picked from commit 7dac52f1cff03f4a84873c74a473ce29b9e3b7d5) --- ...asion_disable_posh_scriptblocklogging.toml | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 rules/windows/defense_evasion_disable_posh_scriptblocklogging.toml diff --git a/rules/windows/defense_evasion_disable_posh_scriptblocklogging.toml b/rules/windows/defense_evasion_disable_posh_scriptblocklogging.toml new file mode 100644 index 000000000..23d6c7492 --- /dev/null +++ b/rules/windows/defense_evasion_disable_posh_scriptblocklogging.toml @@ -0,0 +1,53 @@ +[metadata] +creation_date = "2022/01/31" +maturity = "production" +updated_date = "2022/01/31" + +[rule] +author = ["Elastic"] +description = """ +Identifies attempts to disable PowerShell Script Block Logging via registry modification. Attackers may disable +this logging to conceal their activities in the host and evade detection. +""" +from = "now-9m" +index = ["winlogbeat-*", "logs-endpoint.events.*", "logs-windows.*"] +language = "eql" +license = "Elastic License v2" +name = "PowerShell Script Block Logging Disabled" +references = [ + "https://admx.help/?Category=Windows_10_2016&Policy=Microsoft.Policies.PowerShell::EnableScriptBlockLogging", +] +risk_score = 47 +rule_id = "818e23e6-2094-4f0e-8c01-22d30f3506c6" +severity = "medium" +tags = ["Elastic", "Host", "Windows", "Threat Detection", "Defense Evasion"] +timestamp_override = "event.ingested" +type = "eql" + +query = ''' +registry where event.type == "change" and + registry.path : + "HKLM\\SOFTWARE\\Policies\\Microsoft\\Windows\\PowerShell\\ScriptBlockLogging\\EnableScriptBlockLogging" + and registry.data.strings : ("0", "0x00000000") +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" + +[[rule.threat.technique]] +id = "T1562" +reference = "https://attack.mitre.org/techniques/T1562/" +name = "Impair Defenses" + + [[rule.threat.technique.subtechnique]] + id = "T1562.002" + name = "Disable Windows Event Logging" + reference = "https://attack.mitre.org/techniques/T1562/002/" + + +[rule.threat.tactic] +id = "TA0005" +reference = "https://attack.mitre.org/tactics/TA0005/" +name = "Defense Evasion" +