What is mod_evasive?
mod_evasive is an evasive maneuvers module for Apache to provide evasive action in the event of an HTTP DoS or DDoS attack or brute force attack. It is also designed to be a detection and network management tool, and can be easily configured to talk to ipchains, firewalls, routers, and etcetera. mod_evasive presently reports abuses via email and syslog facilities.
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 the same 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 for maximum protection.
This module instantiates for each listener individually, and therefore has a built-in cleanup mechanism and scaling capabilities. Because of this per-child design, legitimate requests are never compromised (even from proxies and NAT addresses) but only scripted attacks. Even a user repeatedly clicking on ‘reload’ should not be affected unless they do it maliciously. mod_evasive is fully tweakable through the Apache configuration file, easy to incorporate into your web server, and easy to use.
Downloads:
| Stable | [Â mod_evasive_1.10.1.tar.gz ] | mod_evasive for Apache v1.3 and 2.0, and NSAPI (SunONE) |
CVS Access
The mod_evasive source tree is available via CVS by using the following commands:
cvs -d :pserver:cvs@cvs.nuclearelephant.com:/usr/local/cvsroot login cvs -d :pserver:cvs@cvs.nuclearelephant.com:/usr/local/cvsroot checkout mod_evasive
Linux RPMs
The following links are not official RPMs, but have been submitted as freely downloadable.
Pingback: How Automatic System Cpanel Block Someone Download from our host? - cPanel Forums
Hi, I think I found a bug in mod_evasive, here I explain it in spanish:
http://el-blog-de-thor.blogspot.com/2009/04/fallo-de-programacion-en-modevasive.html
Summarizing you’re reseting the varible n->timestamp for each request. It’s posible that I may have misunderstood the code, if so sorry. Regards!
Hello,
I’m currently using mod_evasive, and it works beautifully. However, I’m getting a high number of false positives, since I have a script that is requested through AJAX, and since the URL is always the same, and there can be several requests per second, blacklisting becomes inevitable.
I think that the ability to override some parameters (or just disable the module) for specific and would be very desirable. Are you planning to add this in the future? Or at least a regex that allows you to whitelist some URLs… that’d be enough for most cases.
Keep up the good work!
Pingback: FractalizeR’s WebSite » FractalizeR: VBulletin 4 extensive optimization guide
Pingback: Installing mod_evasive with Sun’s Webstack | Golden Apple Enterprises Ltd.
Pingback: Sudo Make Install » Absolutely required software for dDos attacks
Is mod_evasive available for Windows installations of Apache?
Pingback: How to Stop an Apache DDoS Attack with mod_evasive | systemBash
Pingback: | GOODEALHOSTING BLOG
Pingback: Techniques for slowing down/stopping external attacks on your Apache server | random neuron misfires
Pingback: DDoS Protection and Mitigation
Pingback: Where to download modevasive? | HostGator Coupons Code
I’m trying to use mod_evasive on a cpanel server, and having a problem.
I can’t seem to find a configuration that allows us to view awstats without triggering mod_evasive. Even these settings won’t work:
DOSPageCount 1000
DOSSiteCount 1000
DOSPageInterval 1
DOSSiteInterval 1
DOSBlockingPeriod 10
I have tried defining the parameters several ways… in the cpanel pre-virtual host include, and in httpd.conf.
It seems that no matter what I set the parameters to, viewing awstats will trigger mod-evasive, causing a 403 return.
I recently discovered the DOSWhitelist parameter, and it appears to work. This would be a bit of a pain to implement, as we need awstats to be viewable from a variety of locations, most of which have dynamic addresses.
Any help would be appreciated!
Paul
Pingback: JAVA Programming » Blog Archive » Re: Does mod_dosevasive work in this situation?
Pingback: DDOS PROTECTION | HostGator Coupons Code
I have a case where the same URL is being blacklisted over and over again from different client addresses. The URL in question is for the CSS style sheet for a single web application. Could this be a false positive? What could be causing it? Network issues?
Pingback: ApacheのDoS攻撃対策でmod_evasiveをインストールとベンチワークの測定方法 | パチスロ日記と仕事メモ
Hi,
I have a problem with Whitelisting.
Only one IP to be whitelisted, so I configured
DOSWhitelist 127.0.0.1
However, it will be blocked:
+ wget http://127.0.0.1/srv/www/htdocs/ga.js
–2011-02-25 11:48:13– http://127.0.0.1/srv/www/htdocs/ga.js
Connecting to 127.0.0.1:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2011-02-25 11:48:13 ERROR 404: Not Found.
+ wget http://127.0.0.1/srv/www/htdocs/ga.js
–2011-02-25 11:48:13– http://127.0.0.1/srv/www/htdocs/ga.js
Connecting to 127.0.0.1:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2011-02-25 11:48:13 ERROR 404: Not Found.
+ wget http://127.0.0.1/srv/www/htdocs/ga.js
–2011-02-25 11:48:13– http://127.0.0.1/srv/www/htdocs/ga.js
Connecting to 127.0.0.1:80… connected.
HTTP request sent, awaiting response… 403 Forbidden
2011-02-25 11:48:13 ERROR 403: Forbidden.
Ok, some more info and some progress:
My problem is/was in httpd.conf the line
This makes all following config-options for mod_evasive20 useless.
I tried different versions, like
nothing worked.
Only removal of altogether makes the config options effective.
My stupid question: Which will work ?
I use apache2.2.15, SUSE 11.3, 32bit
Looks like the blog SW removed some info, so a 2′nd try:
apache2ctl -t -D DUMP_MODULES
….
evasive20_module (shared)
…..
The next statements in httpd.conf for apache 2.2.15 are not effective:
“”
“”
“”
Only removal of “” completely makes the config pars effective for evasive20
Which ” will work ?
WTF …
The next statements in httpd.conf for apache 2.2.15 are not effective:
IfModule mod_evasive20.c
IfModule evasive20_module
IfModule module_evasive20
Only removal of “IfModule …” makes the config pars effective for evasive20
Pingback: Optimize Vbulletin 4 [Part II]
Pingback: DDOS protection strategies | Portable Digital Video Recorder
Pingback: Prevent DoS Attacks with Mod_Evasive for Apache
Pingback: Prevent DoS Attacks with Mod_Evasive for Apache | DDoS-Protection - DoS/DDoS Attack Protection - Blog
Pingback: vBulletin 4 Optimization guide - Technyat.com
Pingback: DDOS protection on apache | HostGator Coupons Code
Pingback: vBulletin 4 Optimization guide - Technyat
Pingback: How to track DoS attack with Apache?
Pingback: Custom Opt Mod :: mod_evasive | BoatDev
Pingback: Keeping script kiddies at bay with mod_evasive and iptables | Simone Tellini
Pingback: nothingOS » Blog Archive » Mod_evasive – Prevent DDOS Attack
Pingback: :: b l a c k o n s o l e :: » :: Install mod_evasive on cPanel
i am new to linux server, please guide me how i can edit and save httpd.conf file to add configuration into it.
Hello,
is there any way to configure mod_evasive to count http sessions instead of single IP address?
I’ve a lot of clients coming from enterprise’s LAN behind a single NAT, and they get blacklisted.
Thank you
Pingback: WordPress Login Security | Sixteen Small Stones
Pingback: Limit Apache requests per IP Address with mod_limitipconn | kieranbarnes
Pingback: DDoS Protection and Mitigation - TOS HOST
Pingback: Linux tutorials » Protect Apache using Mod_Security and Mod_evasive on RHEL/CentOS & Fedora
Pingback: Securing a LAMP server (Part 1) - Ross Marks