Skip to content
This repository has been archived by the owner on May 14, 2020. It is now read-only.

Extend sql having in rule 942230 #1674

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rules/REQUEST-942-APPLICATION-ATTACK-SQLI.conf
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAME
setvar:'tx.sql_injection_score=+%{tx.critical_anomaly_score}',\
setvar:'tx.anomaly_score_pl1=+%{tx.critical_anomaly_score}'"

SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx (?i:[\s()]case\s*?\(|\)\s*?like\s*?\(|having\s*?[^\s]+\s*?[^\w\s]|if\s?\([\d\w]\s*?[=<>~])" \
SecRule REQUEST_COOKIES|!REQUEST_COOKIES:/__utm/|REQUEST_COOKIES_NAMES|ARGS_NAMES|ARGS|XML:/* "@rx (?i:[\s()]case\s*?\(|\)\s*?like\s*?\(|select.*?having\s*?[^\s]+\s*?[^\w\s]|if\s?\([\d\w]\s*?[=<>~])" \
"id:942230,\
phase:2,\
block,\
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
meta:
author: "Christian S.J. Peron"
author: "Christian S.J. Peron, Franziska Buehler"
description: None
enabled: true
name: 942230.yaml
Expand All @@ -21,3 +21,147 @@
version: HTTP/1.0
output:
log_contains: id "942230"
-
test_title: 942230-2
desc: "conditional SQL injection attempts"
stages:
-
stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
method: GET
port: 80
uri: "/?var=%29like%28"
version: HTTP/1.0
output:
log_contains: id "942230"
-
test_title: 942230-3
desc: "conditional SQL injection attempts"
stages:
-
stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
method: GET
port: 80
uri: "/?var=I%20like%20you%21"
version: HTTP/1.0
output:
no_log_contains: id "942230"
-
test_title: 942230-4
desc: "conditional SQL injection attempts"
stages:
-
stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
method: GET
port: 80
uri: "/?var=%20case%20%28"
version: HTTP/1.0
output:
log_contains: id "942230"
-
test_title: 942230-5
desc: "conditional SQL injection attempts"
stages:
-
stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
method: GET
port: 80
uri: "/?var=having%20pain%21"
version: HTTP/1.0
output:
no_log_contains: id "942230"
-
test_title: 942230-6
desc: "conditional SQL injection attempts"
stages:
-
stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
method: GET
port: 80
uri: "/?var=SELECT%20x%20GROUP%20BY%20SOMETHING%20HAVING%20COUNT%28Id%29%20%3E%3D%209"
version: HTTP/1.0
output:
log_contains: id "942230"
-
test_title: 942230-7
desc: "conditional SQL injection attempts"
stages:
-
stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
method: GET
port: 80
uri: "/?var=SELECT%20%2A%20FROM%20%60movies%60%20GROUP%20BY%20%60category_id%60%2C%60year_released%60%20HAVING%20%60category_id%60%20%3D%208%3B"
version: HTTP/1.0
output:
log_contains: id "942230"
-
test_title: 942230-8
desc: "conditional SQL injection attempts"
stages:
-
stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
method: GET
port: 80
uri: "/?var=behaving%20badly%2F"
version: HTTP/1.0
output:
no_log_contains: id "942230"
-
test_title: 942230-9
desc: "conditional SQL injection attempts"
stages:
-
stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
method: GET
port: 80
uri: "/?var=o.havingu%40gmail.com"
version: HTTP/1.0
output:
no_log_contains: id "942230"
-
test_title: 942230-10
desc: "conditional SQL injection attempts"
stages:
-
stage:
input:
dest_addr: 127.0.0.1
headers:
Host: localhost
method: GET
port: 80
uri: "/?var=if%282%3D"
version: HTTP/1.0
output:
log_contains: id "942230"