mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-01 10:09:49 +00:00
Block $bad_uri_words prototype
This commit is contained in:
parent
41078a2384
commit
2bfd3073e9
3 changed files with 41 additions and 0 deletions
17
bots.d/bad-uri-words.conf
Normal file
17
bots.d/bad-uri-words.conf
Normal file
|
@ -0,0 +1,17 @@
|
|||
# EDIT THIS FILE AS YOU LIKE TO ADD OR REMOVE ANY BAD WORDS YOU WANT TO SCAN FOR ###
|
||||
|
||||
# THE RULES BELOW ARE ENABLED BY DEFAULT
|
||||
# You can disable this default list by switching the values to 0
|
||||
|
||||
# Old WordPress vulnerability
|
||||
"~*(?:\b)HelloThinkPHP(?:\b)" 1;
|
||||
|
||||
# Trigger XDebug in production
|
||||
"~*(?:\b)XDEBUG_SESSION_START(?:\b)" 1;
|
||||
|
||||
# PHPUnit exploit:
|
||||
# /vendor/phpunit/phpunit/phpunit.xsd
|
||||
# /vendor/phpunit/phpunit/build.xml
|
||||
# /vendor/phpunit/phpunit/src/Util/PHP/eval-stdin.php
|
||||
"~*(?:\b)vendor/phpunit/phpunit(?:\b)" 1;
|
||||
"~*(?:\b)phpunit/src/Util/PHP/eval-stdin\.php(?:\b)" 1;
|
|
@ -75,6 +75,14 @@ if ($bad_referer) {
|
|||
return 444;
|
||||
}
|
||||
|
||||
# ---------------------------------
|
||||
# BLOCK BAD URI WORDS
|
||||
# ---------------------------------
|
||||
|
||||
if ($bad_uri_words) {
|
||||
return 444;
|
||||
}
|
||||
|
||||
# -----------------------------
|
||||
# BLOCK IP ADDRESSES and RANGES
|
||||
# -----------------------------
|
||||
|
|
|
@ -18123,6 +18123,22 @@ geo $ratelimited {
|
|||
# END SECTION 4 - ACTIVATE BLOCKER FUNCTIONS
|
||||
# ==========================================
|
||||
|
||||
|
||||
# =============================
|
||||
# BEGIN SECTION 5 - REQUEST URI
|
||||
# =============================
|
||||
|
||||
map $request_uri $bad_uri_words {
|
||||
default 0;
|
||||
# include bots.d/whitelist-domains.conf; # ???
|
||||
include bots.d/bad-uri-words.conf;
|
||||
}
|
||||
|
||||
|
||||
# ==========================================
|
||||
# END SECTION 5 - ACTIVATE BLOCKER FUNCTIONS
|
||||
# ==========================================
|
||||
|
||||
# =====================
|
||||
# END BLOCKER FUNCTIONS
|
||||
# =====================
|
||||
|
|
Loading…
Add table
Reference in a new issue