Beispiel #1
0
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 * 
 */
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'], '/')));