From 97fa6c62cdb4a5147ced1e5dfe71545870c91d8f Mon Sep 17 00:00:00 2001 From: Samirbous <64742097+Samirbous@users.noreply.github.com> Date: Tue, 8 Dec 2020 21:28:28 +0100 Subject: [PATCH] [New Rule] Remote File Download via Powershell (#660) * [New Rule] Remote File Download via Powershell * new line * eql syntax * ecs_version * added google related FPs * Update rules/windows/command_and_control_remote_file_copy_powershell.toml Co-authored-by: Justin Ibarra * Update rules/windows/command_and_control_remote_file_copy_powershell.toml Co-authored-by: Justin Ibarra * Update rules/windows/command_and_control_remote_file_copy_powershell.toml Co-authored-by: Brent Murphy <56412096+bm11100@users.noreply.github.com> * Update rules/windows/command_and_control_remote_file_copy_powershell.toml Co-authored-by: seth-goodwin <58222969+seth-goodwin@users.noreply.github.com> * Update rules/windows/command_and_control_remote_file_copy_powershell.toml Co-authored-by: seth-goodwin <58222969+seth-goodwin@users.noreply.github.com> * relint * ecs_version removed * replaced path with name to avoid FPs for users temp folder Co-authored-by: Justin Ibarra Co-authored-by: Brent Murphy <56412096+bm11100@users.noreply.github.com> Co-authored-by: seth-goodwin <58222969+seth-goodwin@users.noreply.github.com> --- ...d_control_remote_file_copy_powershell.toml | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 rules/windows/command_and_control_remote_file_copy_powershell.toml diff --git a/rules/windows/command_and_control_remote_file_copy_powershell.toml b/rules/windows/command_and_control_remote_file_copy_powershell.toml new file mode 100644 index 000000000..63ee46ce4 --- /dev/null +++ b/rules/windows/command_and_control_remote_file_copy_powershell.toml @@ -0,0 +1,54 @@ +[metadata] +creation_date = "2020/11/30" +maturity = "production" +updated_date = "2020/11/30" + +[rule] +author = ["Elastic"] +description = "Identifies powershell.exe being used to download an executable file from an untrusted remote destination." +from = "now-9m" +index = ["winlogbeat-*", "logs-endpoint.events.*"] +language = "eql" +license = "Elastic License" +name = "Remote File Download via PowerShell" +risk_score = 47 +rule_id = "33f306e8-417c-411b-965c-c2812d6d3f4d" +severity = "medium" +tags = ["Elastic", "Host", "Windows", "Threat Detection", "Command and Control"] +type = "eql" + +query = ''' +sequence by host.id, process.entity_id with maxspan=30s + [network where process.name : "powershell.exe" and network.protocol == "dns" and + not dns.question.name : ("localhost", "*.microsoft.com", "*.azureedge.net", "*.powershellgallery.com", "*.windowsupdate.com", "metadata.google.internal") and + not user.domain : "NT AUTHORITY"] + [file where process.name : "powershell.exe" and event.type == "creation" and file.extension : ("exe", "dll", "ps1", "bat") and + not file.name : "__PSScriptPolicy*.ps1"] +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1105" +name = "Ingress Tool Transfer" +reference = "https://attack.mitre.org/techniques/T1105/" + + +[rule.threat.tactic] +id = "TA0011" +name = "Command and Control" +reference = "https://attack.mitre.org/tactics/TA0011/" +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1086" +name = "PowerShell" +reference = "https://attack.mitre.org/techniques/T1086/" + + +[rule.threat.tactic] +id = "TA0002" +name = "Execution" +reference = "https://attack.mitre.org/tactics/TA0002/" +