diff --git a/rules/windows/persistence_ms_office_addins_file.toml b/rules/windows/persistence_ms_office_addins_file.toml index 841cbf3ff..913adf420 100644 --- a/rules/windows/persistence_ms_office_addins_file.toml +++ b/rules/windows/persistence_ms_office_addins_file.toml @@ -18,7 +18,7 @@ note = """## Setup If enabling an EQL rule on a non-elastic-agent index (such as beats) for versions <8.2, events will not define `event.ingested` and default fallback for EQL rules was not added until 8.2, so you will need to add a custom pipeline to populate `event.ingested` to @timestamp for this rule to work. """ -references = ["https://labs.mwrinfosecurity.com/blog/add-in-opportunities-for-office-persistence/"] +references = ["https://labs.withsecure.com/publications/add-in-opportunities-for-office-persistence"] risk_score = 73 rule_id = "f44fa4b6-524c-4e87-8d9e-a32599e4fb7c" severity = "high" diff --git a/rules_building_block/defense_evasion_service_disabled_registry.toml b/rules_building_block/defense_evasion_service_disabled_registry.toml new file mode 100644 index 000000000..823b0fd01 --- /dev/null +++ b/rules_building_block/defense_evasion_service_disabled_registry.toml @@ -0,0 +1,74 @@ +[metadata] +creation_date = "2023/08/29" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "New fields added: required_fields, related_integrations, setup" +min_stack_version = "8.3.0" +updated_date = "2023/08/29" + +[rule] +author = ["Elastic"] +description = """ +Identifies attempts to modify services start settings using processes other than services.exe. Attackers may attempt to +modify security and monitoring services to avoid detection or delay response. +""" +from = "now-119m" +interval = "60m" +index = ["logs-endpoint.events.*", "endgame-*"] +language = "eql" +license = "Elastic License v2" +name = "Service Disabled via Registry Modification" +risk_score = 21 +rule_id = "75dcb176-a575-4e33-a020-4a52aaa1b593" +severity = "low" +tags = [ + "Domain: Endpoint", + "OS: Windows", + "Use Case: Threat Detection", + "Tactic: Defense Evasion", + "Data Source: Elastic Endgame", + "Data Source: Elastic Defend", + "Rule Type: BBR" +] +timestamp_override = "event.ingested" +building_block_type = "default" +type = "eql" + +query = ''' +registry where host.os.type == "windows" and event.type == "change" and + registry.path : ( + "HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\Start", + "\\REGISTRY\\MACHINE\\SYSTEM\\*ControlSet*\\Services\\*\\Start" + ) and registry.data.strings : ("3", "4") and + not + ( + process.name : "services.exe" and user.id : "S-1-5-18" + ) +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1112" +name = "Modify Registry" +reference = "https://attack.mitre.org/techniques/T1112/" + + +[rule.threat.tactic] +id = "TA0005" +name = "Defense Evasion" +reference = "https://attack.mitre.org/tactics/TA0005/" + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1489" +name = "Service Stop" +reference = "https://attack.mitre.org/techniques/T1489/" + + +[rule.threat.tactic] +id = "TA0040" +name = "Impact" +reference = "https://attack.mitre.org/tactics/TA0040/" diff --git a/rules_building_block/defense_evasion_service_path_registry.toml b/rules_building_block/defense_evasion_service_path_registry.toml new file mode 100644 index 000000000..84b841511 --- /dev/null +++ b/rules_building_block/defense_evasion_service_path_registry.toml @@ -0,0 +1,102 @@ +[metadata] +creation_date = "2023/08/29" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "New fields added: required_fields, related_integrations, setup" +min_stack_version = "8.3.0" +updated_date = "2023/08/29" + +[rule] +author = ["Elastic"] +description = """ +Identifies attempts to modify a service path by an unusual process. Attackers may attempt to modify existing services +for persistence or privilege escalation. +""" +from = "now-119m" +interval = "60m" +index = ["logs-endpoint.events.*", "endgame-*"] +language = "eql" +license = "Elastic License v2" +name = "Service Path Modification" +risk_score = 21 +rule_id = "f243fe39-83a4-46f3-a3b6-707557a102df" +severity = "low" +tags = [ + "Domain: Endpoint", + "OS: Windows", + "Use Case: Threat Detection", + "Tactic: Defense Evasion", + "Data Source: Elastic Endgame", + "Data Source: Elastic Defend", + "Rule Type: BBR" +] +timestamp_override = "event.ingested" +building_block_type = "default" +type = "eql" + +query = ''' +registry where host.os.type == "windows" and event.type == "change" and + registry.path : ( + "HKLM\\SYSTEM\\*ControlSet*\\Services\\*\\ImagePath", + "\\REGISTRY\\MACHINE\\SYSTEM\\*ControlSet*\\Services\\*\\ImagePath" + ) and not ( + process.executable : ( + "?:\\Program Files\\*.exe", + "?:\\Program Files (x86)\\*.exe", + "?:\\Windows\\System32\\services.exe", + "?:\\Windows\\WinSxS\\*" + ) + ) +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1112" +name = "Modify Registry" +reference = "https://attack.mitre.org/techniques/T1112/" + + +[rule.threat.tactic] +id = "TA0005" +name = "Defense Evasion" +reference = "https://attack.mitre.org/tactics/TA0005/" + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1543" +name = "Create or Modify System Process" +reference = "https://attack.mitre.org/techniques/T1543/" + + + [[rule.threat.technique.subtechnique]] + id = "T1543.003" + name = "Windows Service" + reference = "https://attack.mitre.org/techniques/T1543/003/" + + +[rule.threat.tactic] +id = "TA0003" +name = "Persistence" +reference = "https://attack.mitre.org/tactics/TA0003/" + +[[rule.threat]] +framework = "MITRE ATT&CK" + +[[rule.threat.technique]] +id = "T1543" +name = "Create or Modify System Process" +reference = "https://attack.mitre.org/techniques/T1543/" +[[rule.threat.technique.subtechnique]] +id = "T1543.003" +name = "Windows Service" +reference = "https://attack.mitre.org/techniques/T1543/003/" + + + +[rule.threat.tactic] +id = "TA0004" +name = "Privilege Escalation" +reference = "https://attack.mitre.org/tactics/TA0004/" diff --git a/rules_building_block/defense_evasion_services_exe_path.toml b/rules_building_block/defense_evasion_services_exe_path.toml new file mode 100644 index 000000000..05ad92ef7 --- /dev/null +++ b/rules_building_block/defense_evasion_services_exe_path.toml @@ -0,0 +1,92 @@ +[metadata] +creation_date = "2023/08/29" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "New fields added: required_fields, related_integrations, setup" +min_stack_version = "8.3.0" +updated_date = "2023/08/29" + +[rule] +author = ["Elastic"] +description = """ +Identifies attempts to modify a service path setting using sc.exe. Attackers may attempt to modify existing services for +persistence or privilege escalation. +""" +from = "now-119m" +interval = "60m" +index = ["logs-endpoint.events.*", "endgame-*"] +language = "eql" +license = "Elastic License v2" +name = "Service Path Modification via sc.exe" +risk_score = 21 +rule_id = "c5677997-f75b-4cda-b830-a75920514096" +severity = "low" +tags = [ + "Domain: Endpoint", + "OS: Windows", + "Use Case: Threat Detection", + "Tactic: Defense Evasion", + "Data Source: Elastic Endgame", + "Data Source: Elastic Defend", + "Rule Type: BBR" +] +timestamp_override = "event.ingested" +building_block_type = "default" +type = "eql" + +query = ''' +process where event.type == "start" and + process.name : "sc.exe" and process.args : "*binPath*" +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1112" +name = "Modify Registry" +reference = "https://attack.mitre.org/techniques/T1112/" + + +[rule.threat.tactic] +id = "TA0005" +name = "Defense Evasion" +reference = "https://attack.mitre.org/tactics/TA0005/" + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1543" +name = "Create or Modify System Process" +reference = "https://attack.mitre.org/techniques/T1543/" + + + [[rule.threat.technique.subtechnique]] + id = "T1543.003" + name = "Windows Service" + reference = "https://attack.mitre.org/techniques/T1543/003/" + + +[rule.threat.tactic] +id = "TA0003" +name = "Persistence" +reference = "https://attack.mitre.org/tactics/TA0003/" + +[[rule.threat]] +framework = "MITRE ATT&CK" + +[[rule.threat.technique]] +id = "T1543" +name = "Create or Modify System Process" +reference = "https://attack.mitre.org/techniques/T1543/" +[[rule.threat.technique.subtechnique]] +id = "T1543.003" +name = "Windows Service" +reference = "https://attack.mitre.org/techniques/T1543/003/" + + + +[rule.threat.tactic] +id = "TA0004" +name = "Privilege Escalation" +reference = "https://attack.mitre.org/tactics/TA0004/" diff --git a/rules_building_block/discovery_generic_account_groups.toml b/rules_building_block/discovery_generic_account_groups.toml index 30188909c..640a15c10 100644 --- a/rules_building_block/discovery_generic_account_groups.toml +++ b/rules_building_block/discovery_generic_account_groups.toml @@ -4,7 +4,7 @@ integration = ["endpoint"] maturity = "production" min_stack_comments = "New fields added: required_fields, related_integrations, setup" min_stack_version = "8.3.0" -updated_date = "2023/07/13" +updated_date = "2023/08/29" [rule] author = ["Elastic"] @@ -36,7 +36,7 @@ process where host.os.type == "windows" and event.type == "start" and (process.name : "net1.exe" or process.pe.original_file_name == "net1.exe") and not process.parent.name : "net.exe" ) - ) and process.args : ("group", "user", "localgroup") and not process.args : "/add" + ) and process.args : ("accounts", "group", "user", "localgroup") and not process.args : "/add" ) or (process.name:("dsquery.exe", "dsget.exe") and process.args:("*members*", "user")) or (process.name:"dsquery.exe" and process.args:"*filter*") or @@ -71,6 +71,11 @@ id = "T1069.002" name = "Domain Groups" reference = "https://attack.mitre.org/techniques/T1069/002/" +[[rule.threat.technique]] +id = "T1201" +name = "Password Policy Discovery" +reference = "https://attack.mitre.org/techniques/T1201/" + [[rule.threat.technique]] id = "T1087" name = "Account Discovery" diff --git a/rules_building_block/lateral_movement_rdp_conn_unusual_process.toml b/rules_building_block/lateral_movement_rdp_conn_unusual_process.toml new file mode 100644 index 000000000..2217d60ec --- /dev/null +++ b/rules_building_block/lateral_movement_rdp_conn_unusual_process.toml @@ -0,0 +1,54 @@ +[metadata] +creation_date = "2023/08/29" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "New fields added: required_fields, related_integrations, setup" +min_stack_version = "8.3.0" +updated_date = "2023/08/29" + +[rule] +author = ["Elastic"] +description = """ +Adversaries may attempt to connect to a remote system over Windows Remote Desktop Protocol (RDP) to achieve lateral +movement. Adversaries may avoid using the Microsoft Terminal Services Client (mstsc.exe) binary to establish +an RDP connection to evade detection. +""" +from = "now-119m" +interval = "60m" +index = ["logs-endpoint.events.*"] +language = "eql" +license = "Elastic License v2" +name = "Potential Outgoing RDP Connection by Unusual Process" +risk_score = 21 +rule_id = "8e39f54e-910b-4adb-a87e-494fbba5fb65" +severity = "low" +tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Lateral Movement", "Data Source: Elastic Defend"] +timestamp_override = "event.ingested" +building_block_type = "default" +type = "eql" + +query = ''' +network where host.os.type == "windows" and + event.action == "connection_attempted" and destination.port == 3389 and + not process.executable : "?:\\Windows\\System32\\mstsc.exe" and + destination.ip != "::1" and destination.ip != "127.0.0.1" +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1021" +name = "Remote Services" +reference = "https://attack.mitre.org/techniques/T1021/" +[[rule.threat.technique.subtechnique]] +id = "T1021.001" +name = "Remote Desktop Protocol" +reference = "https://attack.mitre.org/techniques/T1021/001/" + + + +[rule.threat.tactic] +id = "TA0008" +name = "Lateral Movement" +reference = "https://attack.mitre.org/tactics/TA0008/" diff --git a/rules_building_block/persistence_netsh_helper_dll.toml b/rules_building_block/persistence_netsh_helper_dll.toml new file mode 100644 index 000000000..93a0f7c9f --- /dev/null +++ b/rules_building_block/persistence_netsh_helper_dll.toml @@ -0,0 +1,68 @@ +[metadata] +creation_date = "2023/08/29" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "New fields added: required_fields, related_integrations, setup" +min_stack_version = "8.3.0" +updated_date = "2023/08/29" +bypass_bbr_timing = true + +[rule] +author = ["Elastic"] +description = """ +Identifies the addition of a Netsh Helper DLL, netsh.exe supports the addition of these DLLs to extend its functionality. +Attackers may abuse this mechanism to execute malicious payloads every time the utility is executed, which can be done +by administrators or a scheduled task. +""" +from = "now-9m" +index = ["logs-endpoint.events.*", "endgame-*"] +language = "eql" +license = "Elastic License v2" +name = "Netsh Helper DLL" +risk_score = 21 +rule_id = "b0638186-4f12-48ac-83d2-47e686d08e82" +severity = "low" +tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Persistence", "Data Source: Elastic Endgame", "Data Source: Elastic Defend", "Rule Type: BBR"] +timestamp_override = "event.ingested" +building_block_type = "default" +type = "eql" + +query = ''' +registry where event.type == "change" and + registry.path : ( + "HKLM\\Software\\Microsoft\\netsh\\*", + "\\REGISTRY\\MACHINE\\Software\\Microsoft\\netsh\\*" + ) +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1546" +name = "Event Triggered Execution" +reference = "https://attack.mitre.org/techniques/T1546/" +[[rule.threat.technique.subtechnique]] +id = "T1546.007" +name = "Netsh Helper DLL" +reference = "https://attack.mitre.org/techniques/T1546/007/" + + +[rule.threat.tactic] +id = "TA0003" +name = "Persistence" +reference = "https://attack.mitre.org/tactics/TA0003/" + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1112" +name = "Modify Registry" +reference = "https://attack.mitre.org/techniques/T1112/" + + +[rule.threat.tactic] +id = "TA0005" +name = "Defense Evasion" +reference = "https://attack.mitre.org/tactics/TA0005/" diff --git a/rules_building_block/persistence_startup_folder_lnk.toml b/rules_building_block/persistence_startup_folder_lnk.toml new file mode 100644 index 000000000..32a493ab8 --- /dev/null +++ b/rules_building_block/persistence_startup_folder_lnk.toml @@ -0,0 +1,63 @@ +[metadata] +creation_date = "2023/08/29" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "New fields added: required_fields, related_integrations, setup" +min_stack_version = "8.3.0" +updated_date = "2023/08/29" +bypass_bbr_timing = true + +[rule] +author = ["Elastic"] +description = """ +Identifies shortcut files written to or modified in the startup folder. Adversaries may use this technique to maintain +persistence. +""" +from = "now-9m" +index = ["logs-endpoint.events.*", "endgame-*"] +language = "eql" +license = "Elastic License v2" +name = "Shortcut File Written or Modified on Startup Folder" +risk_score = 21 +rule_id = "ee53d67a-5f0c-423c-a53c-8084ae562b5c" +severity = "low" +tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Persistence", "Data Source: Elastic Endgame", "Data Source: Elastic Defend", "Rule Type: BBR"] +timestamp_override = "event.ingested" +building_block_type = "default" +type = "eql" + +query = ''' +file where host.os.type == "windows" and event.type != "deletion" and file.extension == "lnk" and + file.path : ( + "C:\\Users\\*\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\*", + "C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\*" + ) and + not ( + (process.name : "ONENOTE.EXE" and process.code_signature.status: "trusted" and file.name : "Send to OneNote.lnk") or + (process.name: "OktaVerifySetup.exe" and process.code_signature.status: "trusted" and file.name : "Okta Verify.lnk") + ) +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1547" +name = "Boot or Logon Autostart Execution" +reference = "https://attack.mitre.org/techniques/T1547/" +[[rule.threat.technique.subtechnique]] +id = "T1547.001" +name = "Registry Run Keys / Startup Folder" +reference = "https://attack.mitre.org/techniques/T1547/001/" + +[[rule.threat.technique.subtechnique]] +id = "T1547.009" +name = "Shortcut Modification" +reference = "https://attack.mitre.org/techniques/T1547/009/" + + + +[rule.threat.tactic] +id = "TA0003" +name = "Persistence" +reference = "https://attack.mitre.org/tactics/TA0003/" diff --git a/rules_building_block/persistence_werfault_reflectdebugger.toml b/rules_building_block/persistence_werfault_reflectdebugger.toml new file mode 100644 index 000000000..0249570d1 --- /dev/null +++ b/rules_building_block/persistence_werfault_reflectdebugger.toml @@ -0,0 +1,62 @@ +[metadata] +creation_date = "2023/08/29" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "New fields added: required_fields, related_integrations, setup" +min_stack_version = "8.3.0" +updated_date = "2023/08/29" +bypass_bbr_timing = true + +[rule] +author = ["Elastic"] +description = """ +Identifies the registration of a Werfault Debugger. Attackers may abuse this mechanism to execute malicious payloads +every time the utility is executed with the "-pr" parameter. +""" +from = "now-9m" +index = ["logs-endpoint.events.*", "endgame-*"] +language = "eql" +license = "Elastic License v2" +name = "Werfault ReflectDebugger Persistence" +risk_score = 21 +rule_id = "205b52c4-9c28-4af4-8979-935f3278d61a" +severity = "low" +tags = ["Domain: Endpoint", "OS: Windows", "Use Case: Threat Detection", "Tactic: Persistence", "Data Source: Elastic Endgame", "Data Source: Elastic Defend", "Rule Type: BBR"] +timestamp_override = "event.ingested" +building_block_type = "default" +type = "eql" + +query = ''' +registry where event.type == "change" and + registry.path : ( + "HKLM\\Software\\Microsoft\\Windows\\Windows Error Reporting\\Hangs\\ReflectDebugger", + "\\REGISTRY\\MACHINE\\Software\\Microsoft\\Windows\\Windows Error Reporting\\Hangs\\ReflectDebugger" + ) +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1546" +name = "Event Triggered Execution" +reference = "https://attack.mitre.org/techniques/T1546/" + +[rule.threat.tactic] +id = "TA0003" +name = "Persistence" +reference = "https://attack.mitre.org/tactics/TA0003/" + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1112" +name = "Modify Registry" +reference = "https://attack.mitre.org/techniques/T1112/" + + +[rule.threat.tactic] +id = "TA0005" +name = "Defense Evasion" +reference = "https://attack.mitre.org/tactics/TA0005/"