-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstarter.php
79 lines (60 loc) · 1.89 KB
/
starter.php
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
74
75
76
77
78
79
<?php
/**
* @author @Fatal@
* @copyright 2012
*/
/*
if ($_SERVER['SERVER_ADDR'] !== $_SERVER['REMOTE_ADDR'])
exit();
*/
set_time_limit(0);
ignore_user_abort(true);
if(!isset($_GET['connected']))
{//LiteSpeed hack to work with ignore_user_abort()
ob_start();//start buffer output
echo "start posting";
session_write_close();//close session file on server side to avoid blocking other requests
header("Content-Length: ".ob_get_length());//send length header
header("Connection: close");
ob_end_flush();flush();//really send content, can't change the order:1.ob buffer to normal buffer, 2.normal buffer to output
}
//continue do something on server side
ob_start();
require_once ('inc/functions.php');
function starter()
{
/** Plugin occupation level **/
$cookPath = 'other/cooks/';
$cooks = scandir($cookPath);
$maxLifeTime = 300;
clearstatcache();
foreach($cooks as $key => $cook) { //Clear old cookies
if($cook == '..' || $cook == '.') unset($cooks[$key]);
else {
$time = filemtime($filename);
if($time && (time() - $time) > $maxLifeTime) {
unlink($cookPath.$cook);
unset($cooks[$key]);
}
}
}
$cooks = count($cooks) - 2;
/****************************/
if ($cooks >= 5) die();
if (get_magic_quotes_gpc())
$_GET = array_map('sp_strip', $_GET);
require ('inc/key.php');
if ($start_key === $_GET['sec'] || is_sapi())
{
require_once ('inc/crypt.php');
require_once ('inc/core/cURL.class.php');
require_once ('inc/core/sp_files.class.php');
require_once ('inc/core/status.class.php');
require_once ('inc/core/starter.class.php');
$starter = new starter();
if(!isset($_GET['connected'])) die();
}
}
starter();
ob_end_clean();
?>