From a4b614c681570a72bc0b618d708a6721610ec45c Mon Sep 17 00:00:00 2001 From: Ruben Groenewoud <78494512+Aegrah@users.noreply.github.com> Date: Thu, 19 Mar 2026 13:57:34 +0100 Subject: [PATCH] [New/Tuning] New DB Dump Rule & Tuning wget/curl DRs (#5832) * [Rule Tuning] Tuning wget/curl DRs * [New Rule] Potential Database Dumping Activity * Update exfiltration_potential_curl_data_exfiltration.toml * Expand URL patterns in curl data exfiltration rule * Update rules/linux/exfiltration_potential_wget_data_exfiltration.toml Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com> * Simplify process name conditions for database dumping --------- Co-authored-by: Samirbous <64742097+Samirbous@users.noreply.github.com> --- ...tion_potential_curl_data_exfiltration.toml | 31 ++++--- ...filtration_potential_database_dumping.toml | 83 +++++++++++++++++++ ...tion_potential_wget_data_exfiltration.toml | 22 ++++- ...nel_module_load_from_unusual_location.toml | 12 +-- 4 files changed, 128 insertions(+), 20 deletions(-) create mode 100644 rules/linux/exfiltration_potential_database_dumping.toml diff --git a/rules/linux/exfiltration_potential_curl_data_exfiltration.toml b/rules/linux/exfiltration_potential_curl_data_exfiltration.toml index 608fd9f61..d26ede83d 100644 --- a/rules/linux/exfiltration_potential_curl_data_exfiltration.toml +++ b/rules/linux/exfiltration_potential_curl_data_exfiltration.toml @@ -2,15 +2,14 @@ creation_date = "2025/04/29" integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"] maturity = "production" -updated_date = "2026/01/07" +updated_date = "2026/03/13" [rule] author = ["Elastic"] description = """ -Detects the use of curl to upload an archived file to an internet server. Threat actors often will collect data on a -system and compress it in an archive file before exfiltrating the file back to their C2 server for review. Many threat -actors have been seen utilizing curl to upload this archive file with the collected data to do this. Use of curl in this -way while not inherently malicious should be considered highly abnormal and suspicious activity. +Detects the use of curl to upload files to an internet server. Threat actors often will collect and exfiltrate data on a +system to their C2 server for review. Many threat actors have been observed using curl to upload the collected data. Use +of curl in this way, while not inherently malicious, should be considered highly abnormal and suspicious activity. """ from = "now-9m" index = ["logs-endpoint.events.process*", "logs-crowdstrike.fdr*", "logs-sentinel_one_cloud_funnel.*",] @@ -52,7 +51,10 @@ Curl is a command-line tool used for transferring data with URLs, commonly emplo - Review and update firewall and network security rules to block unauthorized outbound traffic, especially to suspicious or unknown external servers. - Implement enhanced monitoring and logging for curl usage and similar data transfer tools to detect and respond to future exfiltration attempts promptly. """ -references = ["https://everything.curl.dev/usingcurl/uploads"] +references = [ + "https://everything.curl.dev/usingcurl/uploads", + "https://cloud.google.com/blog/topics/threat-intelligence/disrupting-gridtide-global-espionage-campaign?hl=en" +] risk_score = 47 rule_id = "be70614d-4295-473c-a953-582aef41c865" setup = """## Setup @@ -94,11 +96,18 @@ tags = [ timestamp_override = "event.ingested" type = "eql" query = ''' -process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "ProcessRollup2", "start") and process.name == "curl" and -?process.parent.executable != null and (process.args in ("-F", "-T", "-d") or process.args like ("--data*", "--form*")) and -process.command_line like~ ("*@/*.zip*", "*@/*.gz*", "*@/*.tgz*", "*b64=@*", "*=<*") and -process.command_line like~ "*http*" and -not ?process.parent.executable == "/usr/share/untangle/bin/configuration-backup-upload-backup.sh" +process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "ProcessRollup2", "start") and +process.name == "curl" and ?process.parent.executable != null and +( + process.args in ("-T", "--upload-file") or + ( + (process.args in ("-F", "-d", "--form") or process.args like "--data*") and process.command_line like "*@*" + ) +) and +( + process.command_line like ("*http:*", "*https:*", "*ftp:*", "*ftps:*") or + process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}.*" +) ''' [[rule.threat]] diff --git a/rules/linux/exfiltration_potential_database_dumping.toml b/rules/linux/exfiltration_potential_database_dumping.toml new file mode 100644 index 000000000..c09a96d5d --- /dev/null +++ b/rules/linux/exfiltration_potential_database_dumping.toml @@ -0,0 +1,83 @@ +[metadata] +creation_date = "2026/03/13" +integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel"] +maturity = "production" +updated_date = "2026/03/13" + +[rule] +author = ["Elastic"] +description = """ +This rule detects the use of database dumping utilities to exfiltrate data from a database. Attackers +may attempt to dump the database to a file on the system and then exfiltrate the file to a remote server. +""" +from = "now-9m" +index = [ + "endgame-*", + "logs-crowdstrike.fdr*", + "logs-endpoint.events.process*", + "logs-sentinel_one_cloud_funnel.*", +] +language = "eql" +license = "Elastic License v2" +name = "Potential Database Dumping Activity" +references = [ + "https://cloud.google.com/blog/topics/threat-intelligence/disrupting-gridtide-global-espionage-campaign?hl=en" +] +risk_score = 21 +rule_id = "47fdd8e9-2f53-4648-afbf-0c6dd52f3ce5" +setup = """## Setup + +This rule requires data coming in from Elastic Defend. + +### Elastic Defend Integration Setup +Elastic Defend is integrated into the Elastic Agent using Fleet. Upon configuration, the integration allows the Elastic Agent to monitor events on your host and send data to the Elastic Security app. + +#### Prerequisite Requirements: +- Fleet is required for Elastic Defend. +- To configure Fleet Server refer to the [documentation](https://www.elastic.co/guide/en/fleet/current/fleet-server.html). + +#### The following steps should be executed in order to add the Elastic Defend integration on a Linux System: +- Go to the Kibana home page and click "Add integrations". +- In the query bar, search for "Elastic Defend" and select the integration to see more details about it. +- Click "Add Elastic Defend". +- Configure the integration name and optionally add a description. +- Select the type of environment you want to protect, either "Traditional Endpoints" or "Cloud Workloads". +- Select a configuration preset. Each preset comes with different default settings for Elastic Agent, you can further customize these later by configuring the Elastic Defend integration policy. [Helper guide](https://www.elastic.co/guide/en/security/current/configure-endpoint-integration-policy.html). +- We suggest selecting "Complete EDR (Endpoint Detection and Response)" as a configuration setting, that provides "All events; all preventions" +- Enter a name for the agent policy in "New agent policy name". If other agent policies already exist, you can click the "Existing hosts" tab and select an existing policy instead. +For more details on Elastic Agent configuration settings, refer to the [helper guide](https://www.elastic.co/guide/en/fleet/8.10/agent-policy.html). +- Click "Save and Continue". +- To complete the integration, select "Add Elastic Agent to your hosts" and continue to the next section to install the Elastic Agent on your hosts. +For more details on Elastic Defend refer to the [helper guide](https://www.elastic.co/guide/en/security/current/install-endpoint.html). +""" +severity = "low" +tags = [ + "Domain: Endpoint", + "OS: Linux", + "Use Case: Threat Detection", + "Tactic: Exfiltration", + "Data Source: Elastic Defend", + "Data Source: Crowdstrike", + "Data Source: SentinelOne", + "Data Source: Elastic Endgame", +] +timestamp_override = "event.ingested" +type = "eql" +query = ''' +process where host.os.type == "linux" and event.type == "start" and +event.action in ("exec", "exec_event", "start", "ProcessRollup2") and +process.name in ("pg_dump", "pg_dumpall", "mysqldump", "mariadb-dump", "mongodump") +''' + +[[rule.threat]] +framework = "MITRE ATT&CK" + + [rule.threat.tactic] + name = "Exfiltration" + id = "TA0010" + reference = "https://attack.mitre.org/tactics/TA0010/" + + [[rule.threat.technique]] + name = "Exfiltration Over Alternative Protocol" + id = "T1048" + reference = "https://attack.mitre.org/techniques/T1048/" diff --git a/rules/linux/exfiltration_potential_wget_data_exfiltration.toml b/rules/linux/exfiltration_potential_wget_data_exfiltration.toml index 7979e4631..e0f16b191 100644 --- a/rules/linux/exfiltration_potential_wget_data_exfiltration.toml +++ b/rules/linux/exfiltration_potential_wget_data_exfiltration.toml @@ -2,7 +2,7 @@ creation_date = "2026/01/07" integration = ["endpoint", "crowdstrike", "sentinel_one_cloud_funnel", "auditd_manager"] maturity = "production" -updated_date = "2026/01/12" +updated_date = "2026/03/13" [rule] author = ["Elastic"] @@ -54,7 +54,10 @@ This rule flags Linux processes that launch wget with options that upload a loca - Escalate to incident response and initiate wider containment if the destination domain/IP is not owned by the organization or resolves to an anonymizing/VPS service, if multiple hosts exhibit wget --post-file from non-interactive sessions, or if the uploader executed as root. - Harden by enforcing SELinux/AppArmor policies that restrict wget/curl from posting files, requiring egress web proxy allowlists for HTTP POST destinations, adding detections for wget --post-file/--body-file and curl --upload-file/-F, and removing wget from systems where it is unnecessary. """ -references = ["https://gtfobins.github.io/gtfobins/wget/"] +references = [ + "https://gtfobins.github.io/gtfobins/wget/", + "https://cloud.google.com/blog/topics/threat-intelligence/disrupting-gridtide-global-espionage-campaign?hl=en" +] risk_score = 47 rule_id = "8d8c0b55-ef27-4c20-959f-fa8dd3ac25e6" setup = """## Setup @@ -100,7 +103,20 @@ type = "eql" query = ''' process where host.os.type == "linux" and event.type == "start" and event.action in ("exec", "exec_event", "start", "ProcessRollup2", "executed", "process_started") and -process.name == "wget" and process.args like ("--post-file=*", "--body-file=*") +process.name == "wget" and ?process.parent.executable != null and ( + process.args like ("--post-file*", "--post-data*", "--body-file*") or + ( + process.command_line like ("*cat*", "*base64*") and + process.command_line like ( + "*/etc/passwd*", "*/etc/shadow*", "*~/.ssh/*", "*.env*", "*credentials*", "*/tmp/*", + "*/var/tmp/*", "*/dev/shm/*", "*/home/*/*", "*/root/*" + ) + ) +) and +( + process.command_line like ("*http:*", "*https:*") or + process.command_line regex ".*[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}.*" +) ''' [[rule.threat]] diff --git a/rules/linux/persistence_kernel_module_load_from_unusual_location.toml b/rules/linux/persistence_kernel_module_load_from_unusual_location.toml index 6b2ea50e3..6a3833831 100644 --- a/rules/linux/persistence_kernel_module_load_from_unusual_location.toml +++ b/rules/linux/persistence_kernel_module_load_from_unusual_location.toml @@ -2,7 +2,7 @@ creation_date = "2026/02/20" integration = ["endpoint"] maturity = "production" -updated_date = "2026/02/20" +updated_date = "2026/03/13" [rule] author = ["Elastic"] @@ -97,16 +97,16 @@ process where host.os.type == "linux" and event.type == "start" and event.action (process.name == "modprobe" and not process.args in ("-r", "--remove")) ) and ( process.working_directory like ( - "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/home/*/*", "/root/*", - "/var/www/*", "/boot/*", "/srv/*", "/mnt/*" + "/tmp*", "/var/tmp*", "/dev/shm*", "/run*", "/var/run*", "/home*/*", "/root*", + "/var/www*", "/boot*", "/srv*", "/mnt*", "/media*" ) or process.parent.working_directory like ( - "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/home/*/*", "/root/*", - "/var/www/*", "/boot/*", "/srv/*", "/mnt/*" + "/tmp*", "/var/tmp*", "/dev/shm*", "/run*", "/var/run*", "/home*/*", "/root*", + "/var/www*", "/boot*", "/srv*", "/mnt*", "/media*" ) or process.args like ( "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/home/*/*", "/root/*", - "/var/www/*", "/boot/*", "/srv/*", "/mnt/*", "./*" + "/var/www/*", "/boot/*", "/srv/*", "/mnt/*", "/media/*", "./*" ) ) and not (