mirror of
https://github.com/fabriziosalmi/patterns.git
synced 2025-12-17 17:55:48 +00:00
17 lines
358 B
Plaintext
17 lines
358 B
Plaintext
# Nginx WAF rules for RFI
|
|
location / {
|
|
set $attack_detected 0;
|
|
|
|
if ($request_uri ~* "!@endsWith .%{request_headers.host}") {
|
|
set $attack_detected 1;
|
|
}
|
|
|
|
if ($request_uri ~* "^(?i:file|ftps?|https?)://(?:d{1,3}.d{1,3}.d{1,3}.d{1,3})") {
|
|
set $attack_detected 1;
|
|
}
|
|
|
|
if ($attack_detected = 1) {
|
|
return 403;
|
|
}
|
|
}
|