add admin cookie check

This commit is contained in:
O K
2026-03-22 09:23:41 +02:00
parent a2b7a68af0
commit 8fd0c00941
9 changed files with 570 additions and 16 deletions

View File

@@ -4,15 +4,19 @@ class HeadRequestRule implements RuleInterface
{
public function execute()
{
$ip = BotLogger::getRealIp();
if (BotLogger::isWhitelisted($ip)) {
return true;
}
// Detect HEAD request with Filter parameters
if ($_SERVER['REQUEST_METHOD'] === 'HEAD' && (Tools::getIsset('q') || Tools::getIsset('order'))) {
// Log for Fail2Ban
BotLogger::logBan($_SERVER['REMOTE_ADDR'], 'HEAD_REQUEST_SPAM');
BotLogger::logBan($ip, 'HEAD_REQUEST_SPAM');
header('HTTP/1.1 405 Method Not Allowed');
die('Method Not Allowed');
}
return true;
}
}
}