Some more logging added for the DDoS prevention
This commit is contained in:
parent
0206f447e1
commit
51cd55c8ad
4
boot.php
4
boot.php
|
@ -2184,13 +2184,13 @@ function zrl_init(&$a) {
|
||||||
|
|
||||||
// Is it a DDoS attempt?
|
// Is it a DDoS attempt?
|
||||||
// The check fetches the cached value from gprobe to reduce the load for this system
|
// The check fetches the cached value from gprobe to reduce the load for this system
|
||||||
$urlparts = parse_url($url);
|
$urlparts = parse_url($tmp_str);
|
||||||
|
|
||||||
$result = Cache::get("gprobe:".$urlparts["host"]);
|
$result = Cache::get("gprobe:".$urlparts["host"]);
|
||||||
if (!is_null($result)) {
|
if (!is_null($result)) {
|
||||||
$result = unserialize($result);
|
$result = unserialize($result);
|
||||||
if ($result["network"] == NETWORK_FEED) {
|
if ($result["network"] == NETWORK_FEED) {
|
||||||
logger("DDoS attempt detected for ".$urlparts["host"], LOGGER_DEBUG);
|
logger("DDoS attempt detected for ".$urlparts["host"]." by ".$_SERVER["REMOTE_ADDR"].". server data: ".print_r($_SERVER, true), LOGGER_DEBUG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@ function gprobe_run(&$argv, &$argc){
|
||||||
if (!is_null($result)) {
|
if (!is_null($result)) {
|
||||||
$result = unserialize($result);
|
$result = unserialize($result);
|
||||||
if ($result["network"] == NETWORK_FEED) {
|
if ($result["network"] == NETWORK_FEED) {
|
||||||
logger("DDoS attempt detected for ".$urlparts["host"], LOGGER_DEBUG);
|
logger("DDoS attempt detected for ".$urlparts["host"]." by ".$_SERVER["REMOTE_ADDR"].". server data: ".print_r($_SERVER, true), LOGGER_DEBUG);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue