My site is under DDos Attacks (UDP Flooding)!
I have no access to linux shell and only cpanel is available for me! :(
Is it possible to prevent this attacks by php scripting?
Is there a way to configure cpanel to reduce or redirect attacks? How?
According to web hosting help desk: Attack is between 6 to 10 Gbit/s !!!
Is the following code useful?
<?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();
?>
Hardware firewall is too expensive.