]> git.mxchange.org Git - ctracker.git/blobdiff - ctracker.php
DOCUMENT_ROOT and _SERVER added (avoid these things please)
[ctracker.git] / ctracker.php
index 5f7bf9422d8a8401bd4e98c3c6e3608600baab77..db3407bda41e7327311169d6bd410c10600848b5 100644 (file)
@@ -1,17 +1,19 @@
 <?php
 /**
- *
  * Cracker Tracker Protection System - Enhanced Edition
- * Created by: Christian Knerr - www.cback.de
+ * Initially created by Christian Knerr - www.cback.de
  * Enhanced by: Roland Haeder - www.ship-simu.org
- * phpBB Users: Please use our complete phpBB2 Mod!
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            3.0.0
- * @copyright  Copyright (c) 2009 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
@@ -31,17 +33,19 @@ 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');
 
 // Init
 initCrackerTrackerArrays();
 
-// If no email is defined, asume default. This code should be removed
-if (!defined('__CTRACKER_EMAIL')) {
-       define('__CTRACKER_EMAIL', 'webmaster@mxchange.org');
-} // END - if
+// Get a database link
+aquireCrackerTrackerDatabaseLink();
+
+// Update database scheme
+crackerTrackerUpdateDatabaseScheme();
 
 // If it differs to original and the *whole* request string is not in whitelist
-// then blog the attempt
+// then block the attempt
 if (isCrackerTrackerWormDetected()) {
        // Send the email, this must be the last line because it contains a die()
        sendCrackerTrackerMail();
@@ -53,5 +57,14 @@ if (isCrackerTrackerPostAttackDetected()) {
        sendCrackerTrackerPostMail();
 } // END - if
 
+// Does the current IP produce some blocked requests but not now?
+if ((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]
 ?>