Improves the method fill the ARGS collection

This commit is contained in:
Felipe Zimmerle
2016-01-15 10:35:24 -03:00
parent 98f45f357a
commit a102b5ce2c
2 changed files with 169 additions and 12 deletions

View File

@@ -2,7 +2,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ARGS - GET (1/4)",
"title":"Testing Variables :: ARGS - GET (1/7)",
"client":{
"ip":"200.249.12.31",
"port":123
@@ -43,7 +43,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ARGS - GET (2/4)",
"title":"Testing Variables :: ARGS - GET (2/7)",
"client":{
"ip":"200.249.12.31",
"port":123
@@ -84,7 +84,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ARGS - POST (3/4)",
"title":"Testing Variables :: ARGS - POST (3/7)",
"client":{
"ip":"200.249.12.31",
"port":123
@@ -130,7 +130,7 @@
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ARGS - POST (4/4)",
"title":"Testing Variables :: ARGS - POST (4/7)",
"client":{
"ip":"200.249.12.31",
"port":123
@@ -172,6 +172,144 @@
"SecDebugLogLevel 9",
"SecRule ARGS \"@contains test \" \"id:1,phase:3,pass,t:trim\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ARGS - POST (5/7)",
"client":{
"ip":"200.249.12.31",
"port":123
},
"server":{
"ip":"200.249.12.31",
"port":80
},
"request":{
"headers":{
"Host":"localhost",
"User-Agent":"curl/7.38.0",
"Accept":"*/*",
"Content-Length": "27",
"Content-Type": "application/x-www-form-urlencoded"
},
"uri":"/",
"method":"POST",
"body": [
"param1=value1=morevalue1&param2=value2"
]
},
"response":{
"headers":{
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
"Content-Type":"text/html"
},
"body":[
"no need."
]
},
"expected":{
"debug_log":"Target value: \"value1=morevalue1\""
},
"rules":[
"SecRuleEngine On",
"SecDebugLog \/tmp\/modsec_debug.log",
"SecDebugLogLevel 9",
"SecRule ARGS \"@contains test \" \"id:1,phase:3,pass,t:trim\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ARGS - POST (6/7)",
"client":{
"ip":"200.249.12.31",
"port":123
},
"server":{
"ip":"200.249.12.31",
"port":80
},
"request":{
"headers":{
"Host":"localhost",
"User-Agent":"curl/7.38.0",
"Accept":"*/*",
"Content-Length": "27",
"Content-Type": "application/x-www-form-urlencoded"
},
"uri":"/",
"method":"POST",
"body": [
"param1=value1=morevalue1&param2=value2&param3="
]
},
"response":{
"headers":{
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
"Content-Type":"text/html"
},
"body":[
"no need."
]
},
"expected":{
"debug_log":"Target value: \"\" \\(Variable: ARGS:param3\\)"
},
"rules":[
"SecRuleEngine On",
"SecDebugLog \/tmp\/modsec_debug.log",
"SecDebugLogLevel 9",
"SecRule ARGS:param3 \"@contains test \" \"id:1,phase:3,pass,t:trim\""
]
},
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: ARGS - POST (7/7)",
"client":{
"ip":"200.249.12.31",
"port":123
},
"server":{
"ip":"200.249.12.31",
"port":80
},
"request":{
"headers":{
"Host":"localhost",
"User-Agent":"curl/7.38.0",
"Accept":"*/*",
"Content-Length": "27",
"Content-Type": "application/x-www-form-urlencoded"
},
"uri":"/",
"method":"POST",
"body": [
"param1=value1=morevalue1&param2=value2&&&&&"
]
},
"response":{
"headers":{
"Date":"Mon, 13 Jul 2015 20:02:41 GMT",
"Last-Modified":"Sun, 26 Oct 2014 22:33:37 GMT",
"Content-Type":"text/html"
},
"body":[
"no need."
]
},
"expected":{
"debug_log":"Target value: \"value2\" \\(Variable: ARGS:param2\\)"
},
"rules":[
"SecRuleEngine On",
"SecDebugLog \/tmp\/modsec_debug.log",
"SecDebugLogLevel 9",
"SecRule ARGS:param2 \"@contains test \" \"id:1,phase:3,pass,t:trim\""
]
}
]