If your redhat/cpanel server is under DDOS attack then just go to the directory /usr/local/apache/domlogs and then
use the command :
grep '408 -' *.com > output_file_name you can use the search pattern for any other domains with the extension .net .org etc...
we have to do it once by one .check out for 408 at tail -f /etc/httpd/logs/access_log if any then you can use
the command above to find the domains which are under attack.
408 Request Timed Out
---------------------------------
Successful Client Requests
200 OK
201 Created
202 Accepted
203 Non-Authorative Information
204 No Content
205 Reset Content
206 Partial Content
Client Request Redirected
300 Multiple Choices
301 Moved Permanently
302 Moved Temporarily
303 See Other
304 Not Modified
305 Use Proxy
Client Request Errors
400 Bad Request
401 Authorization Required
402 Payment Required (not used yet)
403 Forbidden
404 Not Found
405 Method Not Allowed
406 Not Acceptable (encoding)
407 Proxy Authentication Required
408 Request Timed Out
409 Conflicting Request
410 Gone
411 Content Length Required
412 Precondition Failed
413 Request Entity Too Long
414 Request URI Too Long
415 Unsupported Media Type
Server Errors
500 Internal Server Error
501 Not Implemented
502 Bad Gateway
503 Service Unavailable
504 Gateway Timeout
505 HTTP Version Not Supported
Preventing DDoS Attacks
Posted on Sunday, March 12, 2006 - 11:05 PM
spacer.gif
Articles by Blessen Cherian DDOS, or Distributed Denial of Service is an advanced version of DOS(Denial of Service) attack. Like DOS, DDOS also tries to deny important services running on a server by broadcasting packets to the destination server in a way that the Destination server cannot handle it. The speciality of the DDOS is that, it relays attacks not from a single network/host like DOS. The DDOS attack will be launched from different dynamic networks which has already been compromised.
Normally, DDOS consists of 3 parts . The Master, the slave and at last the victim. The master is the attack launcher, i.e the person/machine behind all this. The slave is the network that is being compromised by the Master and Victim is the target site/server. Master informs the compromised machines, so called slaves to launch attack on the victim's site/machine. Hence its also called co-ordinated attack.
Here is how I see it. Master is the Master Brain, Slave is said to be the launch pad for the attack and Victim is the target.
DDOS is done in 2 phases. In the first phase they try to compromise weak machines in different networks around the world. This phase is called Intrusion Phase. Its in the next phase, that they install DDOS tools and start attacking the victims machines/site. This Phase is called Distributed DoS attack phase.
What Allowed them to do it? Simple.
1. Vulnerable softwares/Applications running on a machine or network.
2. Open network setup.
3. Network/ machine setup without taking security into account.
4. No monitoring or Data Analysis are being conducted.
5. No regular Audit / Software upgrades being conducted.
What should we do if we are under DDOS attack?
Check if your machines load is high and you have large number of HTTP process running.
To find the load just use the command w or uptime -
To find if there is large number of HTTP process running use the command " ps -aux|grep HTTP|wc -l "
# ps -aux|grep HTTP|wc -l
23
In a heavy server , the number of connections will go above 100. But during DDOS attack, the number will go even higher and thats when we need to find out from which all networks are these attacks coming. In DDOS the host machine doesn't have much importance. Its the network which is of importance here because, an attacker will use any machine on the compromised network or even will use all the machines in the network. Hence network address is of importance while fighting with the attack.
If you have high load (say 5 or more ) and you have large number of HTTP process then i would request you to do the following
At command prompt execute the below command
bash#netstat -lpn|grep :80 |awk '{print $5}'|sort
Check each block of ips. Lets assume you have more than 30 connection from a single ip. Under normal cases there is no need for that many number of connection requests from a single IP. Try to identify such ips/networks from the list you get
If more than 5 host/ip connects from the same network then its a clear sign of DDOS .
No comments:
Post a Comment