Skip to content

Instantly share code, notes, and snippets.

@airween
Created September 18, 2019 12:23
Show Gist options
  • Save airween/8deacdbe5fbea76642c61b2e3c710c1e to your computer and use it in GitHub Desktop.
Save airween/8deacdbe5fbea76642c61b2e3c710c1e to your computer and use it in GitHub Desktop.
ModSecurity3 resgression test for REQUEST_BODY
[
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: REQUEST_BODY with XML",
"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":"330",
"Content-Type":"application/xml"
},
"uri":"/",
"method":"POST",
"body":[
"<?xml version=\"1.0\"?><xml><data>foobar</data></xml>"
]
},
"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":"",
"http_code": 200
},
"rules":[
"SecRuleEngine On",
"SecRequestBodyAccess On",
"SecRule REQUEST_BODY \"@rx foobar\" \"id:1,phase:2,block,deny\""
]
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment