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.
5.1 – Activate a Website Application Firewall Protection From DDoS Attacks. A Website Application Firewall (WAF) keeps the malicious traffic off your website. It is a layer of protection that sits between your website and the traffic it receives.
To protect your web application against DDoS attacks, you can use AWS Shield, a DDoS protection service that AWS provides automatically to all AWS customers at no additional charge.
Go to Security > DDoS. Next to HTTP DDoS attack protection, select Configure. In Ruleset configuration, select the action and sensitivity values for all the rules in the HTTP DDoS Attack Protection Managed Ruleset. Select Save.
First, if you are under attack, protect by sessions is not effective.
Second, if you implements an anti-dos method under php, you are adding process, and the DOS attack is ever effective.
The web server listen on TCP protocol, a udp attack is to the server, no your site, prevent the attack is on side of the server, a.k.a, your hosting provider.
Sorry my english
You will want to enable mod_qos in easy apache's exhaustive options
You will also want to install ConfigServer Firewall. That software can help detect dos attacks and block them. Link Below.
http://configserver.com/cp/csf.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With