]> git.mxchange.org Git - ctracker.git/blob - ctracker.php
Updated to allow database-less operation
[ctracker.git] / ctracker.php
1 <?php
2 /**
3  * Cracker Tracker Protection System - Enhanced Edition
4  * Created by: Christian Knerr - www.cback.de
5  * Enhanced by: Roland Haeder - www.ship-simu.org
6  * phpBB Users: Please use our complete phpBB2 Mod!
7  *
8  * @author              Roland Haeder <webmaster@ship-simu.org>
9  * @version             3.0.0
10  * @copyright   Copyright (c) 2009, 2010 Cracker Tracker Team
11  * @license             GNU GPL 3.0 or any newer version
12  * @link                http://www.ship-simu.org
13  *
14  * This program is free software: you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation, either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
22  * GNU General Public License for more details.
23  *
24  * You should have received a copy of the GNU General Public License
25  * along with this program. If not, see <http://www.gnu.org/licenses/>.
26  */
27
28 // Include files
29 include('config/db_config.php');
30 include('libs/lib_general.php');
31 include('libs/lib_detector.php');
32 include('libs/lib_connect.php');
33 include('libs/lib_updates.php');
34
35 // Init
36 initCrackerTrackerArrays();
37
38 // Get a database link
39 aquireCrackerTrackerDatabaseLink();
40
41 // Update database scheme
42 crackerTrackerUpdateDatabaseScheme();
43
44 // If it differs to original and the *whole* request string is not in whitelist
45 // then block the attempt
46 if (isCrackerTrackerWormDetected()) {
47         // Send the email, this must be the last line because it contains a die()
48         sendCrackerTrackerMail();
49 } // END - if
50
51 // Suspicious POST data detected?
52 if (isCrackerTrackerPostAttackDetected()) {
53         // Send the email, this must be the last line because it contains a die()
54         sendCrackerTrackerPostMail();
55 } // END - if
56
57 // Does the current IP produce some blocked requests but not now?
58 if ((getCrackerTrackerConfig('ctracker_alert_user') == 'Y') && (isCrackerTrackerIpSuspicious())) {
59         // This IP is suspicious, so we alert him/her
60         crackerTrackerAlertCurrentUser();
61 } // END - if
62
63 // Close any open database links
64 crackerTrackerCloseDatabaseLink();
65
66 // [EOF]
67 ?>