Здравствуйте.
Добавил такой в конфиг nginx:
## Block SQL injections
set $block_sql_injections 0;
if ($query_string ~ "union.*select.*\(") {
set $block_sql_injections 1;
}
if ($query_string ~ "union.*all.*select.*") {
set $block_sql_injections 1;
}
if ($query_string ~ "concat.*\(") {
set $block_sql_injections 1;
}
if ($block_sql_injections = 1) {
return 403;
}
В логах сайта вижу такое:
95.135.128.21 - - [24/Sep/2018:12:13:59 +0300] "GET /def-s-vysokoj-gorlovinoj?page=41111111111111%27%20UNION%20SELECT%20CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45),CHAR(45,120,51,45,81,45),CHAR(45,120,52,45,81,45),CHAR(45,120,53,45,81,45),CHAR(45,120,54,45,81,45)%20--%20/*%20order%20by%20%27as%20/* HTTP/1.1" 403 173 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0) Gecko/20100101 Firefox/34.0"
95.135.128.21 - - [24/Sep/2018:12:13:57 +0300] "GET /def-tunika-v-goroshek?page=52121121121212.1 HTTP/1.0" 200 150862 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0) Gecko/20100101 Firefox/34.0"
95.135.128.21 - - [24/Sep/2018:12:13:59 +0300] "GET /def-s-bantom?page=41111111111111%22%20UNION%20SELECT%20CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45),CHAR(45,120,51,45,81,45),CHAR(45,120,52,45,81,45),CHAR(45,120,53,45,81,45),CHAR(45,120,54,45,81,45),CHAR(45,120,55,45,81,45),CHAR(45,120,56,45,81,45)%20--%20/*%20order%20by%20%22as%20/* HTTP/1.1" 403 173 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0) Gecko/20100101 Firefox/34.0"
95.135.128.21 - - [24/Sep/2018:12:13:57 +0300] "GET /bea-rubashka-s-detalyami-iz-kogi?page=4%20%26%26%20SLEEP%283%29%20GrOup%20BY%206%20 HTTP/1.0" 200 152011 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0) Gecko/20100101 Firefox/34.0"
95.135.128.21 - - [24/Sep/2018:12:13:59 +0300] "GET /def-s-vysokoj-gorlovinoj?page=41111111111111%27%20UNION%20SELECT%20CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45),CHAR(45,120,51,45,81,45),CHAR(45,120,52,45,81,45),CHAR(45,120,53,45,81,45),CHAR(45,120,54,45,81,45),CHAR(45,120,55,45,81,45)%20--%20/*%20order%20by%20%27as%20/* HTTP/1.1" 403 173 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0) Gecko/20100101 Firefox/34.0"
95.135.128.21 - - [24/Sep/2018:12:13:59 +0300] "GET /def-s-bantom?page=41111111111111%22%20UNION%20SELECT%20CHAR(45,120,49,45,81,45),CHAR(45,120,50,45,81,45),CHAR(45,120,51,45,81,45),CHAR(45,120,52,45,81,45),CHAR(45,120,53,45,81,45),CHAR(45,120,54,45,81,45),CHAR(45,120,55,45,81,45),CHAR(45,120,56,45,81,45),CHAR(45,120,57,45,81,45)%20--%20/*%20order%20by%20%22as%20/* HTTP/1.1" 403 173 "-" "Mozilla/5.0 (Windows NT 6.0; rv:34.0) Gecko/20100101 Firefox/34.0"
Но правило не срабатывает!
Что не так?