是否可以通过cpanel配置和php脚本来防止DDos攻击?

Ahm*_*mad 4 php security ddos cpanel

我的网站受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)

硬件防火墙太贵了.

Exo*_*xos 6

首先,如果您受到攻击,会话保护无效.

其次,如果你在php下实现了反dos方法,你就是在添加进程,而且DOS攻击是有效的.

Web服务器侦听TCP协议,udp攻击是服务器,没有你的站点,防止攻击在服务器端,也就是你的托管服务提供商.

对不起我的英文