Try this instead if you have Apache.
Here is the link
WHAT IS MOD_DOSEVASIVE ?
mod_dosevasive is an evasive maneuvers module for Apache to provide evasive
action in the event of an HTTP DoS attack. It is also designed to be a
detection tool, and can be easily modified to talk to ipchains, firewalls,
routers, and etcetera.
Detection is performed by creating an internal dynamic hash table of IP
Addresses and URIs, and denying any single IP address from any of the following:
- Requesting a single page more than a few times per second
- Making more than 50 concurrent requests on the same child per second
- Making any requests while temporarily blacklisted (on a blocking list)
This method has worked well in both single-server script attacks as well
as distributed attacks, but just like other evasive tools, is only as
useful to the point of bandwidth and processor consumption (e.g. the
amount of bandwidth and processor required to receive/process/respond
to invalid requests), which is why it's a good idea to integrate this
with your firewalls and routers.
This module instantiates for each listener individually, and therefore has
a built-in cleanup mechanism and scaling capabilities. Because of this,
legitimate requests are never compromised but only scripted attacks. Even
a user repeatedly clicking on 'reload' should not be affected unless they do
HOW IT WORKS
A web hit request comes in. The following steps take place:
- The IP address of the requestor is looked up on the temporary blacklist
- The IP address of the requestor and the URI are both hashed into a "key".
A lookup is performed in the listener's internal hash table to determine
if the same host has requested this page more than once within the past
- The IP address of the requestor is hashed into a "key".
A lookup is performed in the listerner's internal hash table to determine
if the same host has requested more than 50 objects within the past
second (from the same child).
If any of the above are true, a 403 response is sent. This conserves
bandwidth and system resources in the event of a DoS attack.
Once a single 403 incident occurs, mod_dosevasive now blocks the entire IP
address for a period of 10 seconds (configurable). If the host requests a
page within this period, it is forced to wait even longer. Since this is
triggered from requesting the same URL multiple times per second, this
again does not affect legitimate users.
The blacklist can/should be expanded to talk to your network's firewalls and/or
routers to push the attack out to the front lines, but this is not required.
WHAT IS THIS TOOL USEFUL FOR?
This tool is *excellent* at fending off small to medium-sized request-based
DoS attacks or script attacks. Its features will prevent you from wasting
bandwidth or having a few thousand CGI scripts running as a result of an attack.
This tool is also excellent at detecting a web-based DoS attack, and can
be modified to talk to your infrastructure.
If you do not have an infrastructure capable of fending off any other types
of DoS attacks, chances are this tool will only help you to the point of
your total bandwidth or server capacity for sending 403's. Without a solid
infrastructure and DoS evasion plan in place, a heavy distributed DoS will most
likely still take you offline.
Unix based hosting.