This commit is contained in:
Dumitru Uzun 2025-08-24 11:47:55 +00:00 committed by GitHub
commit 0c2ee35e52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 41 additions and 0 deletions

17
bots.d/bad-uri-words.conf Normal file
View 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;

View file

@ -79,6 +79,14 @@ if ($bad_referer) {
return 444; # << Response Code Issued May Be Modified to Whatever you Choose ie. 404 but 444 wastes less of Nginxs time
}
# ---------------------------------
# BLOCK BAD URI WORDS
# ---------------------------------
if ($bad_uri_words) {
return 444;
}
# -----------------------------
# BLOCK IP ADDRESSES and RANGES
# -----------------------------

View file

@ -19423,6 +19423,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
# =====================