Skip to content

Commit d1eaa04

Browse files
Update operator-detectsqli.json
1 parent b9393e7 commit d1eaa04

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

test/test-cases/regression/operator-detectsqli.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@
4444
"SecRuleEngine On",
4545
"SecRule ARGS \"@detectSQLi\" \"id:1,phase:2,capture,pass,t:trim\""
4646
]
47-
},
47+
},[
4848
{
4949
"enabled": 1,
5050
"version_min": 300000,
51-
"title": "Testing Operator :: @detectXSS :: basic script payload",
51+
"title": "Testing Operator :: @detectSQLi :: known fingerprint payload",
5252
"client": {
5353
"ip": "200.249.12.31",
5454
"port": 123
@@ -62,13 +62,13 @@
6262
"Host": "localhost",
6363
"User-Agent": "curl/7.38.0",
6464
"Accept": "*/*",
65-
"Content-Length": "45",
65+
"Content-Length": "61",
6666
"Content-Type": "application/x-www-form-urlencoded"
6767
},
6868
"uri": "/",
6969
"method": "POST",
7070
"body": [
71-
"param1=<script>alert(1)</script&param2=value2"
71+
"param1=ascii(substring(version() from 1 for 1))&param2=value2"
7272
]
7373
},
7474
"response": {
@@ -83,18 +83,18 @@
8383
]
8484
},
8585
"expected": {
86-
"debug_log": "Added DetectXSS match TX.0: <script>alert(1)</script",
86+
"debug_log": "Added DetectSQLi match TX.0: f\\(f\\(f",
8787
"http_code": 200
8888
},
8989
"rules": [
9090
"SecRuleEngine On",
91-
"SecRule ARGS \"@detectXSS\" \"id:1,phase:2,capture,pass,t:trim\""
91+
"SecRule ARGS \"@detectSQLi\" \"id:1,phase:2,capture,pass,t:trim\""
9292
]
9393
},
9494
{
9595
"enabled": 1,
9696
"version_min": 300000,
97-
"title": "Testing Operator :: @detectXSS :: trim preserves captured payload",
97+
"title": "Testing Operator :: @detectSQLi :: trim still captures fingerprint",
9898
"client": {
9999
"ip": "200.249.12.31",
100100
"port": 123
@@ -108,13 +108,13 @@
108108
"Host": "localhost",
109109
"User-Agent": "curl/7.38.0",
110110
"Accept": "*/*",
111-
"Content-Length": "53",
111+
"Content-Length": "67",
112112
"Content-Type": "application/x-www-form-urlencoded"
113113
},
114114
"uri": "/",
115115
"method": "POST",
116116
"body": [
117-
"param1= <script>alert(1)</script &param2=value2"
117+
"param1= ascii(substring(version() from 1 for 1)) &param2=value2"
118118
]
119119
},
120120
"response": {
@@ -129,18 +129,18 @@
129129
]
130130
},
131131
"expected": {
132-
"debug_log": "Added DetectXSS match TX.0: <script>alert(1)</script",
132+
"debug_log": "Added DetectSQLi match TX.0: f\\(f\\(f",
133133
"http_code": 200
134134
},
135135
"rules": [
136136
"SecRuleEngine On",
137-
"SecRule ARGS \"@detectXSS\" \"id:2,phase:2,capture,pass,t:trim\""
137+
"SecRule ARGS \"@detectSQLi\" \"id:2,phase:2,capture,pass,t:trim\""
138138
]
139139
},
140140
{
141141
"enabled": 1,
142142
"version_min": 300000,
143-
"title": "Testing Operator :: @detectXSS :: image onerror payload",
143+
"title": "Testing Operator :: @detectSQLi :: boolean style payload",
144144
"client": {
145145
"ip": "200.249.12.31",
146146
"port": 123
@@ -154,13 +154,13 @@
154154
"Host": "localhost",
155155
"User-Agent": "curl/7.38.0",
156156
"Accept": "*/*",
157-
"Content-Length": "42",
157+
"Content-Length": "31",
158158
"Content-Type": "application/x-www-form-urlencoded"
159159
},
160160
"uri": "/",
161161
"method": "POST",
162162
"body": [
163-
"param1=<img src=x onerror=alert(1)>&p=1"
163+
"param1=' or 1=1 -- &param2=x"
164164
]
165165
},
166166
"response": {
@@ -175,18 +175,17 @@
175175
]
176176
},
177177
"expected": {
178-
"debug_log": "Added DetectXSS match TX.0: <img src=x onerror=alert(1)>",
179178
"http_code": 200
180179
},
181180
"rules": [
182181
"SecRuleEngine On",
183-
"SecRule ARGS \"@detectXSS\" \"id:3,phase:2,capture,pass,t:trim\""
182+
"SecRule ARGS \"@detectSQLi\" \"id:3,phase:2,capture,pass,t:trim\""
184183
]
185184
},
186185
{
187186
"enabled": 1,
188187
"version_min": 300000,
189-
"title": "Testing Operator :: @detectXSS :: benign input should not match",
188+
"title": "Testing Operator :: @detectSQLi :: benign input should not match",
190189
"client": {
191190
"ip": "200.249.12.31",
192191
"port": 123
@@ -225,7 +224,7 @@
225224
},
226225
"rules": [
227226
"SecRuleEngine On",
228-
"SecRule ARGS \"@detectXSS\" \"id:4,phase:2,capture,pass,t:trim\""
227+
"SecRule ARGS \"@detectSQLi\" \"id:4,phase:2,capture,pass,t:trim\""
229228
]
230229
}
231230
]

0 commit comments

Comments
 (0)