Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to prevent DDos Attack by cpanel configuration and php scripting?

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.

like image 570
Ahmad Avatar asked Jul 30 '12 20:07

Ahmad


People also ask

Which software is used to prevent the host computers from the DDoS attack?

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.

Which of the following can be used to protect against DoS attacks?

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.

How do I configure anti DDoS?

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.


2 Answers

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

like image 72
Exos Avatar answered Sep 25 '22 20:09

Exos


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

like image 41
Citizen Kepler Avatar answered Sep 22 '22 20:09

Citizen Kepler