我的网站受DDos攻击(UDP泛滥)!
我无法访问linux shell,只有cpanel可供我使用!:(
是否可以通过php脚本来防止这种攻击?
有没有办法配置cpanel来减少或重定向攻击?怎么样?
根据网络托管服务台:攻击速度在6到10 Gbit/s之间!
以下代码有用吗?
<?PHP
if (!isset($_SESSION)) { session_start(); }
// anti flood protection
IF($_SESSION['last_session_request'] > time() - 2){
// users will be redirected to this page if it makes requests faster than 2 seconds
header("Location: /flood.html");
exit; }
$_SESSION['last_session_request'] = time();
?>
Run Code Online (Sandbox Code Playgroud)
硬件防火墙太贵了.