X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=ctracker.php;h=b9f04d6a84dd3ea6a9ce433c064235c8c3b46a09;hb=f6f632c58580b123bdc5c8bea75a532de5f0142e;hp=1f071e39d8e78e85fd4d79fd6dd48a738a2a0892;hpb=8d7c6fd65adb38291dcb1953e10dc1d6460837e4;p=ctracker.git diff --git a/ctracker.php b/ctracker.php index 1f071e3..b9f04d6 100644 --- a/ctracker.php +++ b/ctracker.php @@ -1,16 +1,20 @@ * @version 3.0.0 - * @copyright Copyright (c) 2009, 2010 Cracker Tracker Team + * @copyright Copyright (c) 2009 - 2011 Cracker Tracker Team * @license GNU GPL 3.0 or any newer version * @link http://www.ship-simu.org * + * This program is based on Cracker Tracker Protection System - Stand-Alone + * which has been written by Christian Knerr and is heavily enhanced in + * detectection, logging and reporting of suspicious traffic. + * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or @@ -25,16 +29,21 @@ * along with this program. If not, see . */ +// XDEBUG call +//* DEBUG: */ xdebug_start_trace(); + // Include files -include('config/db_config.php'); -include('libs/lib_general.php'); -include('libs/lib_detector.php'); -include('libs/lib_connect.php'); -include('libs/lib_updates.php'); +require('libs/lib_general.php'); +require('libs/lib_detector.php'); +require('libs/lib_connect.php'); +require('libs/lib_updates.php'); // Init initCrackerTrackerArrays(); +// Load configuration, if any is found +crackerTrackerLoadConfiguration(); + // Get a database link aquireCrackerTrackerDatabaseLink(); @@ -44,24 +53,15 @@ crackerTrackerUpdateDatabaseScheme(); // If it differs to original and the *whole* request string is not in whitelist // then block the attempt if (isCrackerTrackerWormDetected()) { - // Send the email, this must be the last line because it contains a die() + // Send the email, this must be the last line in this if() block because it contains a exit() sendCrackerTrackerMail(); -} // END - if - -// Suspicious POST data detected? -if (isCrackerTrackerPostAttackDetected()) { - // Send the email, this must be the last line because it contains a die() +} elseif (isCrackerTrackerPostAttackDetected()) { + // Send the email, this must be the last line in this if() block because it contains a exit() sendCrackerTrackerPostMail(); -} // END - if - -// Does the current IP produce some blocked requests but not now? -if ((getCrackerTrackerConfig('ctracker_alert_user') == 'Y') && (isCrackerTrackerIpSuspicious())) { +} elseif ((getCrackerTrackerConfig('ctracker_alert_user') == 'Y') && (isCrackerTrackerIpSuspicious())) { // This IP is suspicious, so we alert him/her crackerTrackerAlertCurrentUser(); } // END - if // Close any open database links crackerTrackerCloseDatabaseLink(); - -// [EOF] -?>