Skip to content

Commit 7ab5a14

Browse files
authored
Refine SQL injection rule and log sources
Removed network traffic log sources and adjusted query conditions for SQL injection detection.
1 parent a4d29db commit 7ab5a14

File tree

1 file changed

+10
-26
lines changed

1 file changed

+10
-26
lines changed

rules_building_block/persistence_web_server_potential_sql_injection.toml

Lines changed: 10 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[metadata]
22
bypass_bbr_timing = true
33
creation_date = "2025/11/19"
4-
integration = ["nginx", "apache", "apache_tomcat", "iis", "network_traffic"]
4+
integration = ["nginx", "apache", "apache_tomcat", "iis"]
55
maturity = "production"
66
updated_date = "2025/11/19"
77

@@ -15,8 +15,6 @@ databases or extract sensitive information.
1515
"""
1616
from = "now-9m"
1717
index = [
18-
"logs-network_traffic.http-*",
19-
"logs-network_traffic.tls-*",
2018
"logs-nginx.access-*",
2119
"logs-apache.access-*",
2220
"logs-apache_tomcat.access-*",
@@ -31,14 +29,12 @@ rule_id = "7f7a0ee1-7b6f-466a-85b4-110fb105f5e2"
3129
severity = "low"
3230
tags = [
3331
"Domain: Web",
34-
"Domain: Network",
3532
"Use Case: Threat Detection",
3633
"Tactic: Reconnaissance",
3734
"Tactic: Credential Access",
3835
"Tactic: Persistence",
3936
"Tactic: Execution",
4037
"Tactic: Command and Control",
41-
"Data Source: Network Traffic",
4238
"Data Source: Nginx",
4339
"Data Source: Apache",
4440
"Data Source: Apache Tomcat",
@@ -48,27 +44,15 @@ tags = [
4844
timestamp_override = "event.ingested"
4945
type = "eql"
5046
query = '''
51-
any where (
52-
url.original like~ (
53-
"*%20order%20by%*", "*dbms_pipe.receive_message%28chr%*", "*waitfor%20delay%20*", "*%28select%20*from%20pg_sleep%285*", "*%28select%28sleep%285*", "*%3bselect%20pg_sleep%285*",
54-
"*select%20concat%28concat*", "*xp_cmdshell*", "*select*case*when*", "*and*extractvalue*select*", "*from*information_schema.tables*", "*boolean*mode*having*", "*extractvalue*concat*",
55-
"*case*when*sleep*", "*select*sleep*", "*dbms_lock.sleep*", "*and*sleep*", "*like*sleep*", "*csleep*", "*pgsleep*", "*char*char*char*", "*union*select*", "*concat*select*",
56-
"*select*else*drop*", "*having*like*", "*case*else*end*", "*if*sleep*", "*where*and*select*", "*or*1=1*", """*"1"="1"*""", "*or*'a'='a*", "*into*outfile*", "*pga_sleep*",
57-
"*into%20outfile*", "*into*dumpfile*", "*load_file%28*", "*load%5ffile%28*", "*cast%28*", "*convert%28*", "*cast%28%*", "*convert%28%*", "*@@version*", "*@@version_comment*",
58-
"*version%28*", "*user%28*", "*current_user%28*", "*database%28*", "*schema_name%28*", "*information_schema.columns*", "*information_schema.columns*", "*table_schema*",
59-
"*column_name*", "*dbms_pipe*", "*dbms_lock%2e*sleep*", "*dbms_lock.sleep*", "*sp_executesql*", "*sp_executesql*", "*load%20data*", "*information_schema*", "*pg_slp*",
60-
"*information_schema.tables*"
61-
) or
62-
url.full like~ (
63-
"*%20order%20by%*", "*dbms_pipe.receive_message%28chr%*", "*waitfor%20delay%20*", "*%28select%20*from%20pg_sleep%285*", "*%28select%28sleep%285*", "*%3bselect%20pg_sleep%285*",
64-
"*select%20concat%28concat*", "*xp_cmdshell*", "*select*case*when*", "*and*extractvalue*select*", "*from*information_schema.tables*", "*boolean*mode*having*", "*extractvalue*concat*",
65-
"*case*when*sleep*", "*select*sleep*", "*dbms_lock.sleep*", "*and*sleep*", "*like*sleep*", "*csleep*", "*pgsleep*", "*char*char*char*", "*union*select*", "*concat*select*",
66-
"*select*else*drop*", "*having*like*", "*case*else*end*", "*if*sleep*", "*where*and*select*", "*or*1=1*", """*"1"="1"*""", "*or*'a'='a*", "*into*outfile*", "*pga_sleep*",
67-
"*into%20outfile*", "*into*dumpfile*", "*load_file%28*", "*load%5ffile%28*", "*cast%28*", "*convert%28*", "*cast%28%*", "*convert%28%*", "*@@version*", "*@@version_comment*",
68-
"*version%28*", "*user%28*", "*current_user%28*", "*database%28*", "*schema_name%28*", "*information_schema.columns*", "*information_schema.columns*", "*table_schema*",
69-
"*column_name*", "*dbms_pipe*", "*dbms_lock%2e*sleep*", "*dbms_lock.sleep*", "*sp_executesql*", "*sp_executesql*", "*load%20data*", "*information_schema*", "*pg_slp*",
70-
"*information_schema.tables*"
71-
)
47+
any where url.original like~ (
48+
"*%20order%20by%*", "*dbms_pipe.receive_message%28chr%*", "*waitfor%20delay%20*", "*%28select%20*from%20pg_sleep%285*", "*%28select%28sleep%285*", "*%3bselect%20pg_sleep%285*",
49+
"*select%20concat%28concat*", "*xp_cmdshell*", "*select*case*when*", "*and*extractvalue*select*", "*from*information_schema.tables*", "*boolean*mode*having*", "*extractvalue*concat*",
50+
"*case*when*sleep*", "*select*sleep*", "*dbms_lock.sleep*", "*and*sleep*", "*like*sleep*", "*csleep*", "*pgsleep*", "*char*char*char*", "*union*select*", "*concat*select*",
51+
"*select*else*drop*", "*having*like*", "*case*else*end*", "*if*sleep*", "*where*and*select*", "*or*1=1*", "*\"1\"=\"1\"*", "*or*'a'='a*", "*into*outfile*", "*pga_sleep*",
52+
"*into%20outfile*", "*into*dumpfile*", "*load_file%28*", "*load%5ffile%28*", "*cast%28*", "*convert%28*", "*cast%28%*", "*convert%28%*", "*@@version*", "*@@version_comment*",
53+
"*version%28*", "*user%28*", "*current_user%28*", "*database%28*", "*schema_name%28*", "*information_schema.columns*", "*information_schema.columns*", "*table_schema*",
54+
"*column_name*", "*dbms_pipe*", "*dbms_lock%2e*sleep*", "*dbms_lock.sleep*", "*sp_executesql*", "*sp_executesql*", "*load%20data*", "*information_schema*", "*pg_slp*",
55+
"*information_schema.tables*"
7256
)
7357
'''
7458

0 commit comments

Comments
 (0)