My site is under DDos Attacks (UDP Flooding)!
I do not have access to the Linux shell, and only cpanel is available to me !: (
Is it possible to prevent attacks using php scripts?
Is there a way to configure cpanel to reduce or redirect attacks? How?
According to the web hosting support service: The attack is from 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(); ?>
A hardware firewall is too expensive.
Ahmad source share