C:\xampp\htdocs\landing\wp-content\plugins\malcare-security\callback\wings\protect.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php

if (!defined('ABSPATH')) exit;
if (!
class_exists('BVProtectCallback')) :

require_once 
dirname__FILE__ ) . '/../../protect/wp/protect.php';
require_once 
dirname__FILE__ ) . '/../../protect/fw/config.php';
require_once 
dirname__FILE__ ) . '/../../protect/wp/lp/config.php';

class 
BVProtectCallback extends BVCallbackBase {
    public 
$db;
    public 
$settings;

    public function 
__construct($callback_handler) {
        
$this->db $callback_handler->db;
        
$this->settings $callback_handler->settings;
    }

    public function 
serverConfig() {
        return array(
            
'software' => $_SERVER['SERVER_SOFTWARE'],
            
'sapi' => (function_exists('php_sapi_name')) ? php_sapi_name() : false,
            
'has_apache_get_modules' => function_exists('apache_get_modules'),
            
'posix_getuid' => (function_exists('posix_getuid')) ? posix_getuid() : null,
            
'uid' => (function_exists('getmyuid')) ? getmyuid() : null,
            
'user_ini' => ini_get('user_ini.filename'),
            
'php_major_version' => PHP_MAJOR_VERSION
        
);
    }

    public function 
unBlockLogins() {
        
$this->settings->deleteTransient('bvlp_block_logins');
        
$this->settings->setTransient('bvlp_allow_logins''true'1800);
        return 
$this->settings->getTransient('bvlp_allow_logins');
    }

    public function 
blockLogins($time) {
        
$this->settings->deleteTransient('bvlp_allow_logins');
        
$this->settings->setTransient('bvlp_block_logins''true'$time);
        return 
$this->settings->getTransient('bvlp_block_logins');
    }

    public function 
unBlockIP($ip$attempts$time) {
        
$transient_name BVWPLP::$unblock_ip_transient.$ip;
        
$this->settings->setTransient($transient_name$attempts$time);
        return 
$this->settings->getTransient($transient_name);
    }

    public function 
process($request) {
        
$bvinfo = new MCInfo($this->settings);
        
$params $request->params;

        switch (
$request->method) {
        case 
"gtipprobeinfo":
            
$resp = array();
            
$headers $params['hdrs'];
            
$hdrsinfo = array();
            if (
$headers && is_array($headers)) {
                foreach(
$headers as $hdr) {
                    if (
array_key_exists($hdr$_SERVER)) {
                        
$hdrsinfo[$hdr] = $_SERVER[$hdr];
                    }
                }
            }
            
$resp["hdrsinfo"] = $hdrsinfo;
            break;
        case 
"gtrulcnf":
            
$resp = array('conf' => $this->settings->getOption('bvruleset'));
            break;
        case 
"clrrulcnf":
            
$this->settings->deleteOption('bvruleset');
            
$resp = array("clearconfig" => true);
            break;
        case 
"dorulcnf":
            
$this->settings->updateOption('bvruleset'$params['conf']);
            
$resp = array('conf' => $this->settings->getOption('bvruleset'));
            break;
        case 
"gtraddr":
            
$raddr array_key_exists('REMOTE_ADDR'$_SERVER) ? $_SERVER['REMOTE_ADDR'] : false;
            
$resp = array("raddr" => $raddr);
            break;
        case 
"svrcnf":
            
$resp = array("serverconfig" => $this->serverConfig());
            break;
        case 
"unblklogins":
            
$resp = array("unblocklogins" => $this->unBlockLogins());
            break;
        case 
"blklogins":
            
$time array_key_exists('time'$params) ? $params['time'] : 1800;
            
$resp = array("blocklogins" => $this->blockLogins($time));
            break;
        case 
"unblkip":
            
$resp = array("unblockip" => $this->unBlockIP($params['ip'], $params['attempts'], $params['time']));
            break;
        case 
"rmwatchtime":
            
$this->settings->deleteOption('bvwatchtime');
            
$resp = array("rmwatchtime" => !$bvinfo->getWatchTime());
            break;
        default:
            
$resp false;
        }

        return 
$resp;
    }
}
endif;
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586