From 9807bebd8e2f89413146c60a591be9a103fe398b Mon Sep 17 00:00:00 2001 From: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:18:48 +0200 Subject: [PATCH] [New BBR] Unix Socket Communication (#3072) * [New Rule] Unix Socket Communication * Update rules_building_block/execution_unix_socket_communication.toml Co-authored-by: Isai <59296946+imays11@users.noreply.github.com> * Update rules_building_block/execution_unix_socket_communication.toml --------- Co-authored-by: Isai <59296946+imays11@users.noreply.github.com> --- .../execution_unix_socket_communication.toml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 rules_building_block/execution_unix_socket_communication.toml diff --git a/rules_building_block/execution_unix_socket_communication.toml b/rules_building_block/execution_unix_socket_communication.toml new file mode 100644 index 000000000..6e33fe6a8 --- /dev/null +++ b/rules_building_block/execution_unix_socket_communication.toml @@ -0,0 +1,50 @@ +[metadata] +creation_date = "2023/09/04" +integration = ["endpoint"] +maturity = "production" +min_stack_comments = "New fields added: required_fields, related_integrations, setup" +min_stack_version = "8.3.0" +updated_date = "2023/09/04" +bypass_bbr_timing = true + +[rule] +author = ["Elastic"] +description = """ +This rule monitors for inter-process communication via Unix sockets. Adversaries may attempt to communicate with local +Unix sockets to enumerate application details, find vulnerabilities/configuration mistakes and potentially escalate +privileges or set up malicious communication channels via Unix sockets for inter-process communication to attempt to +evade detection. +""" +from = "now-9m" +index = ["logs-endpoint.events.*"] +language = "eql" +license = "Elastic License v2" +name = "Unix Socket Connection" +risk_score = 21 +rule_id = "41284ba3-ed1a-4598-bfba-a97f75d9aba2" +severity = "low" +tags = ["Domain: Endpoint", "OS: Linux", "Use Case: Threat Detection", "Tactic: Execution", "Data Source: Elastic Defend", "Rule Type: BBR"] +timestamp_override = "event.ingested" +building_block_type = "default" +type = "eql" +query = ''' +process where host.os.type == "linux" and event.action == "exec" and event.type == "start" and ( + (process.name in ("nc", "ncat", "netcat", "nc.openbsd") and + process.args == "-U" and process.args : ("/usr/local/*", "/run/*", "/var/run/*")) or + (process.name == "socat" and + process.args == "-" and process.args : ("UNIX-CLIENT:/usr/local/*", "UNIX-CLIENT:/run/*", "UNIX-CLIENT:/var/run/*")) +) +''' + +[[rule.threat]] +framework = "MITRE ATT&CK" + +[[rule.threat.technique]] +id = "T1559" +name = "Inter-Process Communication" +reference = "https://attack.mitre.org/techniques/T1559/" + +[rule.threat.tactic] +id = "TA0002" +name = "Execution" +reference = "https://attack.mitre.org/tactics/TA0002/"