mod_anticrack
mod_anticrack
module is designed to thwart attempts at cracking into
password protected paths of your web site. The module uses a MySQL server database to
store invalid login attempts from IP addresses. After a cracker exceeds the configured threshold, they are
given 403 HTTP codes no matter what they enter. This effectively blocks their access and stops the
possibility of them gaining access to your password protected sites.
This module was compiled and tested against Apache 2.0.48 on SuSE 8.2. Installation instructions are discussed here.
The most current version of mod_anticrack
can be found at:
http://www.UglyBoxIndustries.com/
Please contact Joseph Benden <joe at thrallingpenguin.com> with any questions, concerns, or suggestions regarding this module.
The AntiCrackLevel
directive sets the threshold at which a cracker will be
denied further attempts at entering your web site. A reasonable value is about 20. This gives
the user a few wrong tries, but definitely stops automated cracking.
NOTE: Some browsers send the 401 and 403 HTTP codes along with requests for the
pages graphics. If you set this value too low and have many graphics on your page, then you
can ban users before they've even TRIED to enter a username and password. Be careful!
The AntiCrackExpires
directive sets the number of seconds an entry in the attempted
cracking table is kept. After this number of seconds, the entries are purged from the database table.
A reasonable value is about 600. This effectively stops the attack, but frees the entry up. You may want
to set a higher value, but keep in mind that many users are DHCP assigned, and a valid customer may actually
be assigned a valid IP address that a previous cracker used.
The AntiCrackPermit
directive may appear multiple times and adds IP addresses that will
never be banned.
Free Tip: Add yourself to the configuration.
The AntiCrackDebug
directive sets how much information is logged to the Apache
log. If it's set to on, then a verbose amount of debugging information is logged.
The AntiCrackHost
directive sets the host name of the MySQL server.
The AntiCrackDB
directive sets the database name used.
The AntiCrackTable
directive sets the database table used.
The AntiCrackUser
directive sets the username used to connect to the database server.
The AntiCrackPass
directive sets the password used to connect to the database server.
# Load the anticrack module LoadModule mod_anticrack /usr/lib/apache2/mod_anticrack.so <Directory "/var/www/htdocs/mywebsite/members"> AntiCrackHost localhost AntiCrackDB ban_mywebsite AntiCrackUser root AntiCrackPass shhh-quiet AntiCrackTable ban AntiCrackLevel 20 AntiCrackDebug on AntiCrackPermit 216.206.238.17 </Directory>
mod_anticrack
:make
CREATE TABLE `anticrack` ( `id` int(8) unsigned NOT NULL auto_increment, `lastattempt` timestamp(14) NOT NULL, `counter` int(8) unsigned NOT NULL default '0', `ipaddr` char(24) NOT NULL default '', `noRemove` tinyint(1) default '0', `auth` tinyint(1) default '0', PRIMARY KEY (`id`), KEY `ipaddr` (`ipaddr`) ) TYPE=MyISAM;