Adds support to the REQUEST_LINE variable

This commit is contained in:
Felipe Zimmerle 2015-07-22 01:57:46 -03:00
parent cb722c74b9
commit bc925e01e6
2 changed files with 48 additions and 0 deletions

View File

@ -219,6 +219,9 @@ int Assay::processURI(const char *uri, const char *protocol,
const char *pos = strchr(m_uri_decoded.c_str(), '?');
store_variable("REQUEST_LINE", std::string(protocol) + " " +
std::string(uri) + " HTTP/" + std::string(http_version));
std::string path_info;
if (pos == NULL) {
path_info = std::string(m_uri_decoded, 0);

View File

@ -0,0 +1,45 @@
[
{
"enabled":1,
"version_min":300000,
"title":"Testing Variables :: REQUEST_LINE",
"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":"*/*"
},
"uri":"/?key=value&key=other_value",
"protocol":"GET",
"http_version":1.1
},
"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: \"GET /\\?key=value\\&key=other_value HTTP/1.1\" \\(Variable: REQUEST_LINE\\)"
},
"rules":[
"SecRuleEngine On",
"SecDebugLog \/tmp\/modsec_debug.log",
"SecDebugLogLevel 9",
"SecRule REQUEST_LINE \"@contains test \" \"pass,t:trim\""
]
}
]