Beispiel #1
0
 */
include_once 'config.inc.php';
include_once 'labyrinth.inc.php';
include_once 'dissociated-press.inc.php';
$labyrinth_handle = new Labyrinth($_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']);
// Obviously, a search engine spider hitting this will be like an unstoppable
// force striking an immovable object. If the user agent appears to be a
// search engine return a 404 error and serenade them with some Tom Petty.
if ($labyrinth_handle->CheckForSearchEngines()) {
    header("HTTP/1.0 404 Not Found");
    print "o/~ Whatever you're looking for... / Hey! Don't come around here no more... o/~";
    exit;
}
// Randomly generate an error just to "Keep it real"
// This was mainly done to fool w3af
$labyrinth_handle->SpinTheWheelOfErrors();
// If index.php is in the request URI, lob it off. Otherwise, lob off the trailing slash.
if (preg_match("/index.php/", $_SERVER['REQUEST_URI'])) {
    $directory = dirname($_SERVER['REQUEST_URI']);
} else {
    $directory = rtrim($_SERVER['REQUEST_URI'], "/");
}
// Alert
$base_level = sizeof(explode('/', rtrim($config['web_path'], '/')));
$uri_level = sizeof(explode('/', $directory));
//Log the crawler to the database
$labyrinth_handle->LogCrawler();
if ($uri_level - $base_level >= $config['alert_levels_deep']) {
    $labyrinth_handle->GenerateAlert("Crawler Ensnared!");
}
// Read the text into a variable for processing by the dissociated press class.