-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathct_functions.php
More file actions
73 lines (61 loc) · 2.36 KB
/
Copy pathct_functions.php
File metadata and controls
73 lines (61 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?php
/***************************************************************************
* ct_functions.php
* -------------------
* copyright : (C) 2005 by Christian Knerr (CBACK)
* homepage : http://www.cback.de
*
***************************************************************************/
/***************************************************************************
*
* 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 2 of the License, or
* (at your option) any later version.
*
***************************************************************************/
if ( !defined('IN_PHPBB') )
{
die("Hacking attempt");
}
function ct_filllog()
{
global $phpbb_root_path, $ctracker_config, $lang, $userdata;
//
// Collecting information about the Attack and the Attacker
//
$ctl_pmeld = 1;
$ctl_stamp = time();
$ctl_remotead = $_SERVER['REMOTE_ADDR'] . " - (" . $userdata['username'] . ")";
$ctl_referrer = $_SERVER['HTTP_REFERER'];
$ctl_agent = $_SERVER['HTTP_USER_AGENT'];
$ctr_logfile = $ctl_pmeld . '||' . $ctl_stamp . '||' . $ctl_remotead . '||' . $ctl_referrer . '||' . $ctl_agent;
$ctr_logsize = count(file($phpbb_root_path . "ctracker/logs/logfile_flood.txt"));
$ctr_maxlogs = $ctracker_config['floodlog'];
if ($ctr_logsize > $ctr_maxlogs)
{
$clog = fopen($phpbb_root_path . "ctracker/logs/logfile_flood.txt", "a");
ftruncate($clog, '0');
fwrite($clog, "0||" . $ctl_stamp . "||SYSTEM MESSAGE||AUTOMATIC LOG FILE RESET||-||CRACKERTRACKER\n" . $ctr_logfile . "\n");
fclose($clog);
$ct_counter_val = 0;
$countername = $phpbb_root_path . "ctracker/logs/counter.txt";
$ct_counter_val = @file_get_contents($countername);
$ct_counter_val = $ct_counter_val + $ctr_maxlogs;
$cfp = fopen ($countername, 'a');
ftruncate($cfp, '0');
fwrite($cfp, $ct_counter_val);
fclose($cfp);
}
else
{
$clog = fopen($phpbb_root_path . 'ctracker/logs/logfile_flood.txt', 'a');
fwrite($clog, $ctr_logfile . "\n");
fclose($clog);
}
}
//
// Response Var for System-Check
//
$cresponse100 = 'cbackctr';
?>