|
27 | 27 | "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
28 | 28 | ), |
29 | 29 | }, |
| 30 | +{ |
| 31 | + type => "misc", |
| 32 | + comment => "libinjection SQLi - with SQLi, check capture", |
| 33 | + conf => qq( |
| 34 | + SecRuleEngine On |
| 35 | + SecDebugLog $ENV{DEBUG_LOG} |
| 36 | + SecDebugLogLevel 9 |
| 37 | + SecRequestBodyAccess On |
| 38 | + |
| 39 | + SecRule REQUEST_BODY "\@detectSQLi" "id:192372,log,deny,capture,chain" |
| 40 | + SecRule TX:0 "\@strEq s&1UE" |
| 41 | + ), |
| 42 | + match_log => { |
| 43 | + error => [ qr/String match "s&1UE" at TX:0/, 1 ], |
| 44 | + debug => [ qr/String match "s&1UE" at TX:0/, 1 ], |
| 45 | + }, |
| 46 | + match_response => { |
| 47 | + status => qr/^403$/, |
| 48 | + }, |
| 49 | + request => new HTTP::Request( |
| 50 | + POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/index.html", |
| 51 | + [ |
| 52 | + "Content-Type" => "application/x-www-form-urlencoded", |
| 53 | + ], |
| 54 | + # Args |
| 55 | + "some_variable=-1' and 1=1 union/* foo */select load_file('/etc/passwd')--" |
| 56 | + ), |
| 57 | +}, |
30 | 58 | { |
31 | 59 | type => "misc", |
32 | 60 | comment => "libinjection SQLi - without SQLi", |
|
81 | 109 | "some_variable=<a href=\"javascript:alert(1)\">" |
82 | 110 | ), |
83 | 111 | }, |
| 112 | +{ |
| 113 | + type => "misc", |
| 114 | + comment => "libinjection XSS - with XSS, check capture", |
| 115 | + conf => qq( |
| 116 | + SecRuleEngine On |
| 117 | + SecDebugLog $ENV{DEBUG_LOG} |
| 118 | + SecDebugLogLevel 9 |
| 119 | + SecRequestBodyAccess On |
| 120 | + |
| 121 | + SecRule REQUEST_BODY "\@detectXSS" "id:192372,log,deny,capture,chain" |
| 122 | + SecRule TX:0 "\@strEq some_variable=<a href='javascript:alert(1)'>" |
| 123 | + ), |
| 124 | + match_log => { |
| 125 | + error => [ qr/String match "some_variable=<a href='javascript:alert\(1\)'>" at TX:0/, 1], |
| 126 | + debug => [ qr/String match "some_variable=<a href='javascript:alert\(1\)'>" at TX:0/, 1 ], |
| 127 | + }, |
| 128 | + match_response => { |
| 129 | + status => qr/^403$/, |
| 130 | + }, |
| 131 | + request => new HTTP::Request( |
| 132 | + POST => "http://$ENV{SERVER_NAME}:$ENV{SERVER_PORT}/index.html", |
| 133 | + [ |
| 134 | + "Content-Type" => "application/x-www-form-urlencoded", |
| 135 | + ], |
| 136 | + # Args |
| 137 | + "some_variable=<a href='javascript:alert(1)'>" |
| 138 | + ), |
| 139 | +}, |
84 | 140 | { |
85 | 141 | type => "misc", |
86 | 142 | comment => "libinjection XSS - without XSS", |
|
0 commit comments