From ecb0ce25083a47af76117fb924f5b4eb4d1994e6 Mon Sep 17 00:00:00 2001 From: Jonhnathan <26856693+w0rk3r@users.noreply.github.com> Date: Wed, 23 Jul 2025 10:06:12 -0300 Subject: [PATCH 1/2] [New Rule] Unusual Web Config File Access --- ...dential_access_web_config_file_access.toml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 rules/windows/credential_access_web_config_file_access.toml diff --git a/rules/windows/credential_access_web_config_file_access.toml b/rules/windows/credential_access_web_config_file_access.toml new file mode 100644 index 00000000000..01363a29a9b --- /dev/null +++ b/rules/windows/credential_access_web_config_file_access.toml @@ -0,0 +1,62 @@ +[metadata] +creation_date = "2025/07/23" +integration = ["endpoint"] +maturity = "production" +updated_date = "2025/07/23" + +[rule] +author = ["Elastic"] +description = """ +Detects unusual access to the web.config file, which contains sensitive credential information such as database +connection strings, machineKey validation/decryption keys, and SAML/OAuth token settings. Attackers can use the +information extracted to forge malicious __VIEWSTATE requests for persistent RCE on the web server or pivot to the SQL +server using exposed connection strings. +""" +from = "now-9m" +index = ["logs-endpoint.events.file-*"] +language = "kuery" +license = "Elastic License v2" +name = "Unusual Web Config File Access" +references = [ + "https://unit42.paloaltonetworks.com/microsoft-sharepoint-cve-2025-49704-cve-2025-49706-cve-2025-53770/", +] +risk_score = 47 +rule_id = "5841b80f-a1f8-4c00-a966-d2cc4a7a82e4" +severity = "medium" +tags = [ + "Domain: Endpoint", + "OS: Windows", + "Use Case: Threat Detection", + "Tactic: Credential Access", + "Data Source: Elastic Defend", +] +timestamp_override = "event.ingested" +type = "new_terms" + +query = ''' +event.category:file and event.action:open and file.name:"web.config" +''' + + +[[rule.threat]] +framework = "MITRE ATT&CK" +[[rule.threat.technique]] +id = "T1003" +name = "OS Credential Dumping" +reference = "https://attack.mitre.org/techniques/T1003/" + + + +[rule.threat.tactic] +id = "TA0006" +name = "Credential Access" +reference = "https://attack.mitre.org/tactics/TA0006/" + +[rule.new_terms] +field = "new_terms_fields" +value = ["process.executable", "user.id"] +[[rule.new_terms.history_window_start]] +field = "history_window_start" +value = "now-7d" + + From 2064e45f1651f830d6586ec70f94f419778b0fc6 Mon Sep 17 00:00:00 2001 From: Jonhnathan <26856693+w0rk3r@users.noreply.github.com> Date: Tue, 29 Jul 2025 11:29:30 -0300 Subject: [PATCH 2/2] Update credential_access_web_config_file_access.toml --- rules/windows/credential_access_web_config_file_access.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rules/windows/credential_access_web_config_file_access.toml b/rules/windows/credential_access_web_config_file_access.toml index 01363a29a9b..ecf6cb4af64 100644 --- a/rules/windows/credential_access_web_config_file_access.toml +++ b/rules/windows/credential_access_web_config_file_access.toml @@ -34,7 +34,8 @@ timestamp_override = "event.ingested" type = "new_terms" query = ''' -event.category:file and event.action:open and file.name:"web.config" +event.category:file and host.os.type:windows and event.action:open and + file.name:"web.config" and file.path : *VirtualDirectories* '''