Skip to content

Commit f14a527

Browse files
Aegrahterrancedejesusshashank-elastic
authored
[New Rule] Web Server Potential SQL Injection Request (#5342)
* [New Rule] Web Server Potential SQL Injection Request * ++ * Update persistence_web_server_potential_sql_injection.toml * Convert to BBR * Update persistence_web_server_potential_sql_injection.toml * Update persistence_web_server_potential_sql_injection.toml * adding missing tags * Add right tag * Add network_traffic manifest and schema * Refine SQL injection rule and log sources Removed network traffic log sources and adjusted query conditions for SQL injection detection. * Get latest schemas/mappings --------- Co-authored-by: Terrance DeJesus <[email protected]> Co-authored-by: terrancedejesus <[email protected]> Co-authored-by: Shashank K S <[email protected]> Co-authored-by: shashank-elastic <[email protected]>
1 parent 046d52c commit f14a527

File tree

1 file changed

+124
-0
lines changed

1 file changed

+124
-0
lines changed
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
[metadata]
2+
bypass_bbr_timing = true
3+
creation_date = "2025/11/19"
4+
integration = ["nginx", "apache", "apache_tomcat", "iis"]
5+
maturity = "production"
6+
updated_date = "2025/11/19"
7+
8+
[rule]
9+
author = ["Elastic"]
10+
building_block_type = "default"
11+
description = """
12+
This rule detects potential SQL injection attempts in web server requests by identifying common SQL injection patterns
13+
in URLs. Such activity may indicate reconnaissance or exploitation attempts by attackers trying to manipulate backend
14+
databases or extract sensitive information.
15+
"""
16+
from = "now-9m"
17+
index = [
18+
"logs-nginx.access-*",
19+
"logs-apache.access-*",
20+
"logs-apache_tomcat.access-*",
21+
"logs-iis.access-*"
22+
]
23+
interval = "10m"
24+
language = "eql"
25+
license = "Elastic License v2"
26+
name = "Web Server Potential SQL Injection Request"
27+
risk_score = 21
28+
rule_id = "7f7a0ee1-7b6f-466a-85b4-110fb105f5e2"
29+
severity = "low"
30+
tags = [
31+
"Domain: Web",
32+
"Use Case: Threat Detection",
33+
"Tactic: Reconnaissance",
34+
"Tactic: Credential Access",
35+
"Tactic: Persistence",
36+
"Tactic: Execution",
37+
"Tactic: Command and Control",
38+
"Data Source: Nginx",
39+
"Data Source: Apache",
40+
"Data Source: Apache Tomcat",
41+
"Data Source: IIS",
42+
"Rule Type: BBR",
43+
]
44+
timestamp_override = "event.ingested"
45+
type = "eql"
46+
query = '''
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*"
56+
)
57+
'''
58+
59+
[[rule.threat]]
60+
framework = "MITRE ATT&CK"
61+
62+
[[rule.threat.technique]]
63+
id = "T1505"
64+
name = "Server Software Component"
65+
reference = "https://attack.mitre.org/techniques/T1505/"
66+
67+
[rule.threat.tactic]
68+
id = "TA0003"
69+
name = "Persistence"
70+
reference = "https://attack.mitre.org/tactics/TA0003/"
71+
72+
[[rule.threat]]
73+
framework = "MITRE ATT&CK"
74+
75+
[[rule.threat.technique]]
76+
id = "T1059"
77+
name = "Command and Scripting Interpreter"
78+
reference = "https://attack.mitre.org/techniques/T1059/"
79+
80+
[[rule.threat.technique.subtechnique]]
81+
id = "T1059.004"
82+
name = "Unix Shell"
83+
reference = "https://attack.mitre.org/techniques/T1059/004/"
84+
85+
[rule.threat.tactic]
86+
id = "TA0002"
87+
name = "Execution"
88+
reference = "https://attack.mitre.org/tactics/TA0002/"
89+
90+
[[rule.threat]]
91+
framework = "MITRE ATT&CK"
92+
93+
[[rule.threat.technique]]
94+
id = "T1071"
95+
name = "Application Layer Protocol"
96+
reference = "https://attack.mitre.org/techniques/T1071/"
97+
98+
[rule.threat.tactic]
99+
id = "TA0011"
100+
name = "Command and Control"
101+
reference = "https://attack.mitre.org/tactics/TA0011/"
102+
103+
[[rule.threat]]
104+
framework = "MITRE ATT&CK"
105+
106+
[[rule.threat.technique]]
107+
id = "T1595"
108+
name = "Active Scanning"
109+
reference = "https://attack.mitre.org/techniques/T1595/"
110+
111+
[[rule.threat.technique.subtechnique]]
112+
id = "T1595.002"
113+
name = "Vulnerability Scanning"
114+
reference = "https://attack.mitre.org/techniques/T1595/002/"
115+
116+
[[rule.threat.technique.subtechnique]]
117+
id = "T1595.003"
118+
name = "Wordlist Scanning"
119+
reference = "https://attack.mitre.org/techniques/T1595/003/"
120+
121+
[rule.threat.tactic]
122+
id = "TA0043"
123+
name = "Reconnaissance"
124+
reference = "https://attack.mitre.org/tactics/TA0043/"

0 commit comments

Comments
 (0)