mitchellkrogza / nginx-ultimate-bad-bot-blocker

Nginx Block Bad Bots, Spam Referrer Blocker, Vulnerability Scanners, User-Agents, Malware, Adware, Ransomware, Malicious Sites, with anti-DDOS, Wordpress Theme Detector Blocking and Fail2Ban Jail for Repeat Offenders
Other
3.82k stars 472 forks source link

[BUG] Bad Referrer words or Bad Query words? #405

Open AmibeWebsites opened 3 years ago

AmibeWebsites commented 3 years ago

Describe the bug

Bad referrer words are assessed against $http_referer, which is fine if the list is meant to be checked against referrer URLs, but it doesn't check against the requested URL or it's query string.

This is a little confusing in terms of the example give with mb_ereg_replace.

Perhaps bad-request-words.conf can be a new file that gets mapped against $request_uri?

To Reproduce

Added to bad-referrer-words.conf: "~*(?:\b|)(wp-)?config\.php(?:\b|)" 1;

Expected behavior

Expected any requested URL that contains wp-config.php in the query string to be blocked.