C:\xampp\htdocs\landing\wp-content\plugins\malcare-security\callback\wings\info.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<?php

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

class 
BVInfoCallback extends BVCallbackBase {
    public 
$db;
    public 
$settings;
    public 
$siteinfo;
    public 
$bvinfo;

    public function 
__construct($callback_handler) {
        
$this->db $callback_handler->db;
        
$this->siteinfo $callback_handler->siteinfo;
        
$this->settings $callback_handler->settings;
        
$this->bvinfo = new MCInfo($this->settings);
    }

    public function 
getPosts($post_type$count 5) {
        
$output = array();
        
$args = array('numberposts' => $count'post_type' => $post_type);
        
$posts get_posts($args);
        
$keys = array('post_title''guid''ID''post_date');
        
$result = array();
        foreach (
$posts as $post) {
            
$pdata = array();
            
$post_array get_object_vars($post);
            foreach (
$keys as $key) {
                
$pdata[$key] = $post_array[$key];
            }
            
$result["posts"][] = $pdata;
        }
        return 
$result;
    }

    public function 
getStats() {
        return array(
            
"posts" => get_object_vars(wp_count_posts()),
            
"pages" => get_object_vars(wp_count_posts("page")),
            
"comments" => get_object_vars(wp_count_comments())
        );
    }

    public function 
getPlugins() {
        if (!
function_exists('get_plugins')) {
            require_once (
ABSPATH."wp-admin/includes/plugin.php");
        }
        
$plugins get_plugins();
        
$result = array();
        foreach (
$plugins as $plugin_file => $plugin_data) {
            
$pdata = array(
                
'file' => $plugin_file,
                
'title' => $plugin_data['Title'],
                
'version' => $plugin_data['Version'],
                
'active' => is_plugin_active($plugin_file),
                
'network' => $plugin_data['Network']
            );
            
$result["plugins"][] = $pdata;
        }
        return 
$result;
    }

    public function 
themeToArray($theme) {
        if (
is_object($theme)) {
            
$pdata = array(
                
'name' => $theme->Name,
                
'title' => $theme->Title,
                
'stylesheet' => $theme->get_stylesheet(),
                
'template' => $theme->Template,
                
'version' => $theme->Version
            
);
        } else {
            
$pdata = array(
                
'name' => $theme["Name"],
                
'title' => $theme["Title"],
                
'stylesheet' => $theme["Stylesheet"],
                
'template' => $theme["Template"],
                
'version' => $theme["Version"]
            );
        }
        return 
$pdata;
    }

    public function 
getThemes() {
        
$result = array();
        
$themes function_exists('wp_get_themes') ? wp_get_themes() : get_themes();
        foreach(
$themes as $theme) {
            
$pdata $this->themeToArray($theme);
            
$result["themes"][] = $pdata;
        }
        
$theme function_exists('wp_get_theme') ? wp_get_theme() : get_current_theme();
        
$pdata $this->themeToArray($theme);
        
$result["currenttheme"] = $pdata;
        return 
$result;
    }

    public function 
getSystemInfo() {
        
$sys_info = array(
            
'host' => $_SERVER['HTTP_HOST'],
            
'phpversion' => phpversion(),
            
'AF_INET6' => defined('AF_INET6')
        );
        if (
array_key_exists('SERVER_ADDR'$_SERVER)) {
            
$sys_info['serverip'] = $_SERVER['SERVER_ADDR'];
        }
        if (
function_exists('get_current_user')) {
            
$sys_info['user'] = get_current_user();
        }
        if (
function_exists('getmygid')) {
            
$sys_info['gid'] = getmygid();
        }
        if (
function_exists('getmyuid')) {
            
$sys_info['uid'] = getmyuid();
        }
        if (
function_exists('posix_getuid')) {
            
$sys_info['webuid'] = posix_getuid();
            
$sys_info['webgid'] = posix_getgid();
        }
        return array(
"sys" => $sys_info);
    }

    public function 
getWpInfo() {
        global 
$wp_version$wp_db_version$wp_local_package;
        
$siteinfo $this->siteinfo;
        
$db $this->db;
        
$upload_dir wp_upload_dir();

        
$wp_info = array(
            
'dbprefix' => $db->dbprefix(),
            
'wpmu' => $siteinfo->isMultisite(),
            
'mainsite' => $siteinfo->isMainSite(),
            
'main_site_id' => $siteinfo->getMainSiteId(),
            
'name' => get_bloginfo('name'),
            
'siteurl' => $siteinfo->siteurl(),
            
'homeurl' => $siteinfo->homeurl(),
            
'charset' => get_bloginfo('charset'),
            
'wpversion' => $wp_version,
            
'dbversion' => $wp_db_version,
            
'mysql_version' => $db->getMysqlVersion(),
            
'abspath' => ABSPATH,
            
'bvpluginpath' => defined('MCBASEPATH') ? MCBASEPATH null,
            
'uploadpath' => $upload_dir['basedir'],
            
'uploaddir' => wp_upload_dir(),
            
'contentdir' => defined('WP_CONTENT_DIR') ? WP_CONTENT_DIR null,
            
'contenturl' => defined('WP_CONTENT_URL') ? WP_CONTENT_URL null,
            
'plugindir' => defined('WP_PLUGIN_DIR') ? WP_PLUGIN_DIR null,
            
'dbcharset' => defined('DB_CHARSET') ? DB_CHARSET null,
            
'disallow_file_edit' => defined('DISALLOW_FILE_EDIT'),
            
'disallow_file_mods' => defined('DISALLOW_FILE_MODS'),
            
'custom_users' => defined('CUSTOM_USER_TABLE') ? CUSTOM_USER_TABLE null,
            
'custom_usermeta' => defined('CUSTOM_USERMETA_TABLE') ? CUSTOM_USERMETA_TABLE null,
            
'locale' => get_locale(),
            
'wp_local_string' => $wp_local_package,
            
'charset_collate' => $db->getCharsetCollate()
        );
        return array(
"wp" => $wp_info);
    }

    public function 
getUsers($args = array(), $full) {
        
$results = array();
        
$users get_users($args);
        if (
'true' == $full) {
            
$results $this->objectToArray($users);
        } else {
            foreach( (array) 
$users as $user) {
                
$result = array();
                
$result['user_email'] = $user->user_email;
                
$result['ID'] = $user->ID;
                
$result['roles'] = $user->roles;
                
$result['user_login'] = $user->user_login;
                
$result['display_name'] = $user->display_name;
                
$result['user_registered'] = $user->user_registered;
                
$result['user_status'] = $user->user_status;
                
$result['user_url'] = $user->url;

                
$results[] = $result;
            }
        }
        return array(
"users" => $results);
    }
    
    public function 
availableFunctions(&$info) {
        if (
extension_loaded('openssl')) {
            
$info['openssl'] = "1";
        }
        if (
function_exists('is_ssl') && is_ssl()) {
            
$info['https'] = "1";
        }
        if (
function_exists('openssl_public_encrypt')) {
            
$info['openssl_public_encrypt'] = "1";
        }
        if (
function_exists('openssl_public_decrypt')) {
            
$info['openssl_public_decrypt'] = "1";
        }
        
$info['sha1'] = "1";
        
$info['apissl'] = "1";
        if (
function_exists('base64_encode')) {
            
$info['b64encode'] = true;
        }
        if (
function_exists('base64_decode')) {
            
$info['b64decode'] = true;
        }
        return 
$info;
    }
    
    public function 
servicesInfo(&$data) {
        
$settings $this->settings;
        
$data['dynsync'] = $settings->getOption('bvDynSyncActive');
        
$data['woodyn'] = $settings->getOption('bvWooDynSync');
        
$data['dynplug'] = $settings->getOption('bvdynplug');
        
$data['protect'] = $settings->getOption('bvptconf');
        
$data['brand'] = $settings->getOption($this->bvinfo->brand_option);
        
$data['badgeinfo'] = $settings->getOption($this->bvinfo->badgeinfo);
        
$data[$this->bvinfo->services_option_name] = $this->bvinfo->config;
    }

    public function 
dbconf(&$info) {
        
$db $this->db;
        if (
defined('DB_CHARSET'))
            
$info['dbcharset'] = DB_CHARSET;
        
$info['dbprefix'] = $db->dbprefix();
        
$info['charset_collate'] = $db->getCharsetCollate();
        return 
$info;
    }

    public function 
cookieInfo() {
        
$resp = array();
        if (
defined('COOKIEPATH'))
            
$resp['cookiepath'] = COOKIEPATH;
        if (
defined('COOKIE_DOMAIN'))
            
$resp['cookiedomain'] = COOKIE_DOMAIN;
        return array(
'cookieinfo' => $resp);
    }
    
    public function 
activate() {
        
$resp = array();
        
$this->siteinfo->basic($resp);
        
$this->servicesInfo($resp);
        
$this->dbconf($resp);
        
$this->availableFunctions($resp);
        return array(
'actinfo' => $resp);
    }

    public function 
getHostInfo() {
        
$host_info $_SERVER;
        
$host_info['PHP_SERVER_NAME'] = php_uname('\n');
        if (
array_key_exists('IS_PRESSABLE'get_defined_constants())) {
            
$host_info['IS_PRESSABLE'] = true;
        }
        return array(
'host_info' => $host_info);
    }

    public function 
process($request) {
        
$db $this->db;
        
$params $request->params;
        switch (
$request->method) {
        case 
"activateinfo":
            
$resp $this->activate();
            break;
        case 
"ckeyinfo":
            
$resp $this->cookieInfo();
            break;
        case 
"gtpsts":
            
$count 5;
            if (
array_key_exists('count'$params))
                
$count $params['count'];
            
$resp $this->getPosts($params['post_type'], $count);
            break;
        case 
"gtsts":
            
$resp $this->getStats();
            break;
        case 
"gtplgs":
            
$resp $this->getPlugins();
            break;
        case 
"gtthms":
            
$resp $this->getThemes();
            break;
        case 
"gtsym":
            
$resp $this->getSystemInfo();
            break;
        case 
"gtwp":
            
$resp $this->getWpInfo();
            break;
        case 
"gtallhdrs":
            
$data = (function_exists('getallheaders')) ? getallheaders() : false;
            
$resp = array("allhdrs" => $data);
            break;
        case 
"gtsvr":
            
$resp = array("svr" => $_SERVER);
            break;
        case 
"getoption":
            
$resp = array("option" => $this->settings->getOption($params['name']));
            break;
        case 
"gtusrs":
            
$full false;
            if (
array_key_exists('full'$params))
                
$full true;
            
$resp $this->getUsers($params['args'], $full);
            break;
        case 
"gttrnsnt":
            
$transient $this->settings->getTransient($params['name']);
            if (
$transient && array_key_exists('asarray'$params))
                
$transient $this->objectToArray($transient);
            
$resp = array("transient" => $transient);
            break;
        case 
"gthost":
            
$resp $this->getHostInfo();
            break;    
        case 
"gtplinfo":
            
$args = array(
                
'slug' => wp_unslash($params['slug'])
            );
            
$action $params['action'];
            
$args = (object) $args;
            
$args apply_filters('plugins_api_args'$args$action);
            
$data apply_filters('plugins_api'false$action$args);
            
$resp = array("plugins_info" => $data);
            break;
        default:
            
$resp false;
        }
        return 
$resp;
    }
}
endif;
x

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