-
Notifications
You must be signed in to change notification settings - Fork 0
mod_antiCrawl Configuration
In order to use mod_antiCrawl, mod_anticrawl.so has to be loaded in configuration file. Loading is done by LoadModule directive in configuration file as shown below.
LoadModule anticrawl_module /usr/lib/apache2/modules/mod_anticrawl.so
LoadModule directive gets two attributes. First one is the name of the module that was declared in the source code and the second is the shared object file with full path. Module parameters can be set in Apache configuration between tags as follows,
<IfModule mod_anticrawl.c> HashTableSize 3097 Count 100 Interval 3 BlockingPeriod 3600 AddOutputFilterByType INJECT text/html Inject "s|</a>|</a><a href=dontclick.html style=display:none;>link</a>|ni" </IfModule>
These HashTableSize , Count , Interval and BlockingPeriod values are configurable parameters of the module. If they are not set, default values are used by mod_antiCrawl. Their default values are set in mod_antiCrawl source code as HashTableSize is 3097, Count is 100, Interval is 3 and BlockingPeriod? is 3600. AddOutputFilterByType parameter adds the INJECT filter which is used for injecting hidden trap links. Inject parameter specifies which expression is replaced with hidden link suffix or prefix.
Inject "s|</a>|</a><a href=dontclick.html style=display:none;>link</a>|ni"
Expression defines that
</a>
tag is replaced with
</a><a href=dontclick.html style=display:none;>link</a>
and these values can be altered in order to inject hidden link into another place.
These configurations can be combined into the expression that can be stated as follows,
LoadModule anticrawl_module /usr/lib/apache2/modules/mod_anticrawl.so <IfModule mod_anticrawl.c> HashTableSize 3097 Count 100 Interval 3 BlockingPeriod 3600 AddOutputFilterByType INJECT text/html Inject "s|</a>|</a><a href=dontclick.html style=display:none;>link</a>|ni" </IfModule>