LokiSec.com

LokiSec.com
  • Security
    • Security Tools
    • Website Defense
    • Personal Security
    • Standards
  • Books
    • Technical

Deter unwanted scanners/crawlers using Weblabyrinth

June 30, 2011 by CyberRad

Weblabyrinth is a dynamic maze of web pages written in PHP.  The main goal of Weblabyrinth is to delay and occupy malicious web scanners to give incident handlers time to investigate and respond to threats.  Weblabyrinth is designed to show a 404 error to legitimate web crawlers based on the crawlers user-agent.  Here is how you install and configure Weblabyrinth. 

In order for this to work you will need the following installed on your box:
Apache
mod_rewrite
PHP
sqlite
PHP sqlite extension
PHP mail() support

Go to the Weblabyrinth website and download Weblabyrinth.

wget http://weblabyrinth.googlecode.com/files/weblabyrinth-0.3.2.tar.gz

Now extract the files and place them in an area that is accessible to the web.

tar zxvf weblabyrinth-0.3.2.tar.gz

cp * /var/www/labyrinth/

Rename /var/www/labyrinth/EXAMPLE.htaccess to .htaccess.

mv EXAMPLE.htaccess .htaccess

Next we will create a sqlite database and give the web user access to the database.

mkdir /opt/weblabyrinth/

cat /var/www/labyrinth/labyrinth.sql | sqlite /opt/weblabyrinth/labyrinth.db

chown -R www-data:www-data /opt/weblabyrinth

The next step is to edit the /var/www/labyrinth/config.inc.php file.  Most of the settings will not need to be changed if you follow the steps that where outlined. A few settings to note are:
'alert_levels_deep' => 3,
This is the threshold of pages that must be hit prior to triggering an alert.

'alert_email' => array(
'enabled' => 'true',
'address' => 'root@localhost'
),

As you can guess these settings determine if you would like an email, and to what address, when an alert is triggered.

'alert_ids' => array(
'enabled' => 'true',
'text' => 'honorificabilitudinitatibus'
)

Using these settings will make Weblabyrinth display honorificabilitudinitatibus on the pages it serves up to the web crawler. When used in conjunction with the following Snort rule it will generate a Snort alert. You can use this alert to block the IP of the web crawler.
alert tcp any 80 -> any any (content:"honorificabilitudinitatibus"; msg: "WebLabyrinth alert keyword detected";)
This is accomplished because Snort will see the phrase honorificabilitudinitatibus in the packets that are sent on port 80 to the web crawler.

Now we will need to setup aliases of known targets that web crawlers look for.  This all depends on how your server is setup but most likely this will be configured in the httpd.conf file in /etc/apache2. Here are the aliases I use:
Alias /admin /var/www/labyrinth/
Alias /secret /var/www/labyrinth/
Alias /pdc-only /var/www/labyrinth/
Alias /private /var/www/labyrinth/
Alias /phpmyadmin /var/www/labyrinth/
Alias /pma /var/www/labyrinth/
Alias /dbadmin /var/www/labyrinth/
Alias /phppgadmin /var/www/labyrinth/
Alias /myadmin /var/www/labyrinth/
Alias /db /var/www/labyrinth/
Alias /mysql /var/www/labyrinth/
Alias /mysqladmin /var/www/labyrinth/
Alias /phpmyadmin /var/www/labyrinth/
Alias /scripts /var/www/labyrinth/
Alias /sqlweb /var/www/labyrinth/
Alias /web /var/www/labyrinth/
Alias /webadmin /var/www/labyrinth/
Alias /webdb /var/www/labyrinth/
Alias /websql /var/www/labyrinth/

This list was composed by looking through my apache log files and looking for 404 errors that were generated by known web crawler user-agents. If you have any more please share.

Now sit back and wait for a web crawler to get caught in your trap.  If you would like to see what the web crawlers see you are more then welcome to get caught in mine.  Please visit mayhemiclabs.com to show your support for such a great piece of code.

Posted in Website Defense and tagged with aliases, apache, No, php, Snort, tutorial, user-agent, weblabyrinth. RSS 2.0 feed.
« Audit your site using w3af
Cracking the wireless network using aircrack-ng »

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Recent Posts

  • Backtrack 5 r3 has been released!
  • Metasploit: The Penetration Tester’s Guide
  • Google Hacking
  • Backtrack 5 r2 has been released!
  • Going Phishing with the Social Engineering Toolkit

Twitter Feed

  • RT @smhack1: The Space is open for the members hangout. Become a dues paying member and hangout with us. 6 days ago

  • RT @smhack1: We are participating in the Extra Life 2013 event http://t.co/aqg6mWYllF 1 week ago

  • I'm supporting @CMNHospitals through @ExtraLife4Kids! http://t.co/BtApLZUBx9 via @DonorDrive Help me reach my goal! 1 week ago

Archives

  • August 2012
  • June 2012
  • April 2012
  • March 2012
  • January 2012
  • December 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011

Tags

802.11 aircrack-ng aliases apache armitage audit Backtrack cree.py creepy flicker geolocation GUI hacker iis Linux metasploit meterpreter netcat network Nmap No Pentest php PTES Quality scan security SET Snort SQLi swiss army knife tools tutorial twitter Uber user-agent vulnerability w3af web weblabyrinth website WEP wireless WPA WPA2

Search

Spread the word!

Blogroll

  • Carnal0wnage
  • Darknet
  • DigiNinja
  • McGrew Security
  • mubix
  • PaulDotCom
  • SpyLogic
  • TaoSecurity

© 2011-2013 LokiSec.com All Rights Reserved