|
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>Metasploit RPC Client</title> |
|
<script src="https://cdn.tailwindcss.com"></script> |
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> |
|
<style> |
|
|
|
::-webkit-scrollbar { |
|
width: 8px; |
|
} |
|
::-webkit-scrollbar-track { |
|
background: #1e293b; |
|
} |
|
::-webkit-scrollbar-thumb { |
|
background: #475569; |
|
border-radius: 4px; |
|
} |
|
::-webkit-scrollbar-thumb:hover { |
|
background: #64748b; |
|
} |
|
|
|
|
|
.terminal-font { |
|
font-family: 'Courier New', monospace; |
|
} |
|
|
|
|
|
@keyframes blink { |
|
0%, 100% { opacity: 1; } |
|
50% { opacity: 0; } |
|
} |
|
.cursor { |
|
animation: blink 1s step-end infinite; |
|
} |
|
|
|
|
|
.status-indicator { |
|
width: 10px; |
|
height: 10px; |
|
border-radius: 50%; |
|
display: inline-block; |
|
margin-right: 6px; |
|
} |
|
.status-connected { |
|
background-color: #10b981; |
|
box-shadow: 0 0 6px #10b981; |
|
} |
|
.status-disconnected { |
|
background-color: #ef4444; |
|
} |
|
.status-working { |
|
background-color: #f59e0b; |
|
box-shadow: 0 0 6px #f59e0b; |
|
} |
|
|
|
|
|
.command-history { |
|
max-height: 200px; |
|
overflow-y: auto; |
|
border: 1px solid #334155; |
|
border-radius: 0.375rem; |
|
background-color: #1e293b; |
|
position: absolute; |
|
width: 100%; |
|
z-index: 10; |
|
display: none; |
|
} |
|
.command-history-item { |
|
padding: 0.5rem; |
|
cursor: pointer; |
|
border-bottom: 1px solid #334155; |
|
} |
|
.command-history-item:hover { |
|
background-color: #334155; |
|
} |
|
|
|
|
|
.tab { |
|
padding: 0.5rem 1rem; |
|
cursor: pointer; |
|
border-radius: 0.375rem 0.375rem 0 0; |
|
background-color: #334155; |
|
margin-right: 0.25rem; |
|
} |
|
.tab.active { |
|
background-color: #475569; |
|
border-bottom: 2px solid #3b82f6; |
|
} |
|
|
|
|
|
@keyframes spin { |
|
0% { transform: rotate(0deg); } |
|
100% { transform: rotate(360deg); } |
|
} |
|
.spinner { |
|
animation: spin 1s linear infinite; |
|
} |
|
</style> |
|
</head> |
|
<body class="bg-slate-900 text-slate-200 min-h-screen"> |
|
<div class="container mx-auto px-4 py-8"> |
|
|
|
<header class="flex justify-between items-center mb-8"> |
|
<div class="flex items-center"> |
|
<i class="fas fa-bug text-3xl text-red-500 mr-3"></i> |
|
<h1 class="text-2xl font-bold bg-gradient-to-r from-red-500 to-orange-500 bg-clip-text text-transparent"> |
|
Metasploit RPC Client |
|
</h1> |
|
</div> |
|
<div class="flex items-center space-x-4"> |
|
<div id="connection-status" class="flex items-center"> |
|
<span class="status-indicator status-disconnected"></span> |
|
<span>Disconnected</span> |
|
</div> |
|
<button id="connect-btn" class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-md font-medium transition-colors"> |
|
<i class="fas fa-plug mr-2"></i>Connect |
|
</button> |
|
</div> |
|
</header> |
|
|
|
|
|
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6"> |
|
|
|
<div class="bg-slate-800 rounded-lg p-6 shadow-lg lg:col-span-1"> |
|
<h2 class="text-xl font-semibold mb-4 flex items-center"> |
|
<i class="fas fa-cog mr-2 text-blue-400"></i>Configuration |
|
</h2> |
|
|
|
<div class="space-y-4"> |
|
<div> |
|
<label class="block text-sm font-medium mb-1">Host</label> |
|
<input id="host-input" type="text" value="127.0.0.1" |
|
class="w-full bg-slate-700 border border-slate-600 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> |
|
</div> |
|
|
|
<div> |
|
<label class="block text-sm font-medium mb-1">Port</label> |
|
<input id="port-input" type="number" value="55552" |
|
class="w-full bg-slate-700 border border-slate-600 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> |
|
</div> |
|
|
|
<div> |
|
<label class="block text-sm font-medium mb-1">URI</label> |
|
<input id="uri-input" type="text" value="/api/" |
|
class="w-full bg-slate-700 border border-slate-600 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> |
|
</div> |
|
|
|
<div class="flex items-center"> |
|
<input id="ssl-checkbox" type="checkbox" class="h-4 w-4 text-blue-600 focus:ring-blue-500 border-slate-600 rounded bg-slate-700"> |
|
<label class="ml-2 text-sm">Use SSL</label> |
|
</div> |
|
|
|
<div> |
|
<label class="block text-sm font-medium mb-1">Username</label> |
|
<input id="username-input" type="text" value="msf" |
|
class="w-full bg-slate-700 border border-slate-600 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> |
|
</div> |
|
|
|
<div> |
|
<label class="block text-sm font-medium mb-1">Password</label> |
|
<div class="relative"> |
|
<input id="password-input" type="password" value="password" |
|
class="w-full bg-slate-700 border border-slate-600 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> |
|
<button id="toggle-password" class="absolute right-3 top-2 text-slate-400 hover:text-slate-200"> |
|
<i class="fas fa-eye"></i> |
|
</button> |
|
</div> |
|
</div> |
|
|
|
<div> |
|
<label class="block text-sm font-medium mb-1">Timeout (seconds)</label> |
|
<input id="timeout-input" type="number" value="5" |
|
class="w-full bg-slate-700 border border-slate-600 rounded-md px-3 py-2 focus:outline-none focus:ring-2 focus:ring-blue-500"> |
|
</div> |
|
|
|
<div class="pt-2"> |
|
<button id="save-config-btn" class="bg-green-600 hover:bg-green-700 px-4 py-2 rounded-md font-medium transition-colors w-full"> |
|
<i class="fas fa-save mr-2"></i>Save Configuration |
|
</button> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<div class="bg-slate-800 rounded-lg shadow-lg lg:col-span-2 flex flex-col"> |
|
<div class="p-4 border-b border-slate-700 flex justify-between items-center"> |
|
<div class="flex items-center space-x-2"> |
|
<h2 class="text-xl font-semibold flex items-center"> |
|
<i class="fas fa-terminal mr-2 text-green-400"></i>Console |
|
</h2> |
|
<div id="console-tabs" class="flex"> |
|
<div class="tab active" data-tab="main">Main</div> |
|
|
|
</div> |
|
</div> |
|
<div class="flex space-x-2"> |
|
<button id="clear-console-btn" class="bg-slate-700 hover:bg-slate-600 px-3 py-1 rounded text-sm transition-colors"> |
|
<i class="fas fa-trash mr-1"></i>Clear |
|
</button> |
|
<button id="create-console-btn" class="bg-green-600 hover:bg-green-700 px-3 py-1 rounded text-sm transition-colors" disabled> |
|
<i class="fas fa-plus mr-1"></i>New Session |
|
</button> |
|
</div> |
|
</div> |
|
|
|
<div id="console-output" class="terminal-font p-4 flex-grow overflow-y-auto max-h-96 bg-slate-900 text-green-400"> |
|
<div class="text-slate-400">// Metasploit RPC Console</div> |
|
<div class="text-slate-400">// Connect to start a session</div> |
|
</div> |
|
|
|
<div class="p-4 border-t border-slate-700 relative"> |
|
<div class="flex"> |
|
<span class="text-green-400 mr-2">msf6 ></span> |
|
<div class="flex-grow relative"> |
|
<input id="command-input" type="text" |
|
class="w-full bg-slate-900 border-0 focus:outline-none terminal-font text-green-400 caret-white" |
|
placeholder="Enter command..." disabled> |
|
<span id="command-cursor" class="cursor absolute left-0 top-0 h-5 w-2 bg-green-400"></span> |
|
<div id="command-history" class="command-history"></div> |
|
<div id="command-suggestions" class="command-history"></div> |
|
</div> |
|
<button id="send-command-btn" class="ml-2 bg-blue-600 hover:bg-blue-700 px-4 py-1 rounded transition-colors" disabled> |
|
<i class="fas fa-paper-plane"></i> |
|
</button> |
|
</div> |
|
<div class="flex justify-between mt-2 text-xs text-slate-400"> |
|
<div> |
|
<span id="command-count">0</span> commands in history |
|
</div> |
|
<div> |
|
<span id="command-position">0</span>/<span id="command-total">0</span> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<div class="mt-6 bg-slate-800 rounded-lg p-6 shadow-lg"> |
|
<h2 class="text-xl font-semibold mb-4 flex items-center"> |
|
<i class="fas fa-info-circle mr-2 text-purple-400"></i>Session Information |
|
</h2> |
|
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4"> |
|
<div class="bg-slate-700 p-4 rounded-lg"> |
|
<div class="text-sm text-slate-400 mb-1">Console ID</div> |
|
<div id="console-id" class="text-lg font-mono">N/A</div> |
|
</div> |
|
|
|
<div class="bg-slate-700 p-4 rounded-lg"> |
|
<div class="text-sm text-slate-400 mb-1">Authentication</div> |
|
<div id="auth-status" class="text-lg">Not authenticated</div> |
|
</div> |
|
|
|
<div class="bg-slate-700 p-4 rounded-lg"> |
|
<div class="text-sm text-slate-400 mb-1">Last Command</div> |
|
<div id="last-command" class="text-lg font-mono truncate">N/A</div> |
|
</div> |
|
</div> |
|
|
|
<div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4"> |
|
<div class="bg-slate-700 p-4 rounded-lg"> |
|
<div class="text-sm text-slate-400 mb-1">Connection Time</div> |
|
<div id="connection-time" class="text-lg">00:00:00</div> |
|
</div> |
|
|
|
<div class="bg-slate-700 p-4 rounded-lg"> |
|
<div class="text-sm text-slate-400 mb-1">Session Duration</div> |
|
<div id="session-duration" class="text-lg">00:00:00</div> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
|
|
<div class="mt-4 bg-slate-800 rounded-lg p-2 text-sm text-slate-400 flex justify-between items-center"> |
|
<div> |
|
<span id="status-message">Ready</span> |
|
</div> |
|
<div class="flex items-center"> |
|
<span id="memory-usage" class="mr-4">Memory: --</span> |
|
<span id="cpu-usage">CPU: --</span> |
|
</div> |
|
</div> |
|
</div> |
|
|
|
<script> |
|
document.addEventListener('DOMContentLoaded', function() { |
|
|
|
const connectBtn = document.getElementById('connect-btn'); |
|
const connectionStatus = document.getElementById('connection-status'); |
|
const statusIndicator = connectionStatus.querySelector('.status-indicator'); |
|
const statusText = connectionStatus.querySelector('span:last-child'); |
|
|
|
const consoleOutput = document.getElementById('console-output'); |
|
const commandInput = document.getElementById('command-input'); |
|
const sendCommandBtn = document.getElementById('send-command-btn'); |
|
const clearConsoleBtn = document.getElementById('clear-console-btn'); |
|
const createConsoleBtn = document.getElementById('create-console-btn'); |
|
|
|
const consoleIdDisplay = document.getElementById('console-id'); |
|
const authStatusDisplay = document.getElementById('auth-status'); |
|
const lastCommandDisplay = document.getElementById('last-command'); |
|
const connectionTimeDisplay = document.getElementById('connection-time'); |
|
const sessionDurationDisplay = document.getElementById('session-duration'); |
|
const statusMessage = document.getElementById('status-message'); |
|
const memoryUsage = document.getElementById('memory-usage'); |
|
const cpuUsage = document.getElementById('cpu-usage'); |
|
|
|
|
|
const commandHistory = document.getElementById('command-history'); |
|
const commandSuggestions = document.getElementById('command-suggestions'); |
|
const commandCount = document.getElementById('command-count'); |
|
const commandPosition = document.getElementById('command-position'); |
|
const commandTotal = document.getElementById('command-total'); |
|
|
|
|
|
const togglePasswordBtn = document.getElementById('toggle-password'); |
|
const passwordInput = document.getElementById('password-input'); |
|
const saveConfigBtn = document.getElementById('save-config-btn'); |
|
|
|
|
|
let isConnected = false; |
|
let isAuthenticated = false; |
|
let consoleId = null; |
|
let isWorking = false; |
|
let connectionStartTime = null; |
|
let sessionStartTime = null; |
|
let commandHistoryList = []; |
|
let currentHistoryPosition = 0; |
|
let commandSuggestionsList = [ |
|
'version', 'help', 'exploit', 'sessions', 'exit', |
|
'use exploit/multi/handler', |
|
'set payload windows/meterpreter/reverse_tcp', |
|
'set LHOST 192.168.1.1', |
|
'set LPORT 4444', |
|
'exploit -j' |
|
]; |
|
|
|
|
|
initApp(); |
|
|
|
function initApp() { |
|
|
|
loadConfiguration(); |
|
|
|
|
|
setupEventListeners(); |
|
|
|
|
|
updateConnectionUI(); |
|
|
|
|
|
addConsoleMessage('// Metasploit RPC Client Interface', 'note'); |
|
addConsoleMessage('// Connect to the RPC server to begin', 'note'); |
|
|
|
|
|
startSystemMonitoring(); |
|
} |
|
|
|
function loadConfiguration() { |
|
|
|
const config = { |
|
host: '127.0.0.1', |
|
port: '55552', |
|
uri: '/api/', |
|
ssl: false, |
|
username: 'msf', |
|
password: 'password', |
|
timeout: '5' |
|
}; |
|
|
|
document.getElementById('host-input').value = config.host; |
|
document.getElementById('port-input').value = config.port; |
|
document.getElementById('uri-input').value = config.uri; |
|
document.getElementById('ssl-checkbox').checked = config.ssl; |
|
document.getElementById('username-input').value = config.username; |
|
document.getElementById('password-input').value = config.password; |
|
document.getElementById('timeout-input').value = config.timeout; |
|
} |
|
|
|
function saveConfiguration() { |
|
const config = { |
|
host: document.getElementById('host-input').value, |
|
port: document.getElementById('port-input').value, |
|
uri: document.getElementById('uri-input').value, |
|
ssl: document.getElementById('ssl-checkbox').checked, |
|
username: document.getElementById('username-input').value, |
|
password: document.getElementById('password-input').value, |
|
timeout: document.getElementById('timeout-input').value |
|
}; |
|
|
|
|
|
addConsoleMessage('[+] Configuration saved', 'ok'); |
|
updateStatusMessage('Configuration saved successfully'); |
|
} |
|
|
|
function setupEventListeners() { |
|
|
|
togglePasswordBtn.addEventListener('click', togglePasswordVisibility); |
|
|
|
|
|
connectBtn.addEventListener('click', connectDisconnect); |
|
|
|
|
|
createConsoleBtn.addEventListener('click', createConsoleSession); |
|
|
|
|
|
sendCommandBtn.addEventListener('click', sendCommand); |
|
commandInput.addEventListener('keydown', handleCommandInput); |
|
|
|
|
|
clearConsoleBtn.addEventListener('click', clearConsole); |
|
|
|
|
|
saveConfigBtn.addEventListener('click', saveConfiguration); |
|
|
|
|
|
commandInput.addEventListener('input', showCommandSuggestions); |
|
commandInput.addEventListener('focus', showCommandSuggestions); |
|
commandInput.addEventListener('blur', () => { |
|
setTimeout(() => { |
|
commandSuggestions.style.display = 'none'; |
|
}, 200); |
|
}); |
|
|
|
|
|
window.addEventListener('resize', updateUI); |
|
} |
|
|
|
function togglePasswordVisibility() { |
|
const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password'; |
|
passwordInput.setAttribute('type', type); |
|
togglePasswordBtn.innerHTML = type === 'password' ? '<i class="fas fa-eye"></i>' : '<i class="fas fa-eye-slash"></i>'; |
|
} |
|
|
|
function connectDisconnect() { |
|
if (isConnected) { |
|
|
|
startWorking(); |
|
updateStatusMessage('Disconnecting from server...'); |
|
|
|
|
|
setTimeout(() => { |
|
addConsoleMessage('[+] Successfully disconnected from Metasploit RPC server', 'ok'); |
|
|
|
isConnected = false; |
|
isAuthenticated = false; |
|
consoleId = null; |
|
connectionStartTime = null; |
|
sessionStartTime = null; |
|
|
|
endWorking(); |
|
updateConnectionUI(); |
|
updateStatusMessage('Disconnected from server'); |
|
}, 800); |
|
} else { |
|
|
|
startWorking(); |
|
updateStatusMessage('Connecting to server...'); |
|
|
|
|
|
const host = document.getElementById('host-input').value; |
|
const port = document.getElementById('port-input').value; |
|
const uri = document.getElementById('uri-input').value; |
|
const useSSL = document.getElementById('ssl-checkbox').checked; |
|
const username = document.getElementById('username-input').value; |
|
const password = document.getElementById('password-input').value; |
|
const timeout = document.getElementById('timeout-input').value; |
|
|
|
|
|
setTimeout(() => { |
|
addConsoleMessage(`[+] Connecting to ${host}:${port}${uri}`, 'note'); |
|
|
|
|
|
setTimeout(() => { |
|
addConsoleMessage('[+] Connection established', 'ok'); |
|
connectionStartTime = new Date(); |
|
updateConnectionTime(); |
|
|
|
|
|
setTimeout(() => { |
|
if (username && password) { |
|
addConsoleMessage('[+] Authenticating with provided credentials...', 'note'); |
|
updateStatusMessage('Authenticating...'); |
|
|
|
setTimeout(() => { |
|
addConsoleMessage('[+] Successfully authenticated', 'ok'); |
|
isAuthenticated = true; |
|
updateStatusMessage('Connected and authenticated'); |
|
|
|
isConnected = true; |
|
endWorking(); |
|
updateConnectionUI(); |
|
}, 800); |
|
} else { |
|
addConsoleMessage('[!] No credentials provided - connected but not authenticated', 'warn'); |
|
updateStatusMessage('Connected (not authenticated)'); |
|
|
|
isConnected = true; |
|
endWorking(); |
|
updateConnectionUI(); |
|
} |
|
}, 500); |
|
}, 800); |
|
}, 1000); |
|
} |
|
} |
|
|
|
function createConsoleSession() { |
|
startWorking(); |
|
updateStatusMessage('Creating new console session...'); |
|
addConsoleMessage('[+] Creating new console session...', 'note'); |
|
|
|
|
|
setTimeout(() => { |
|
consoleId = Math.floor(Math.random() * 10000); |
|
consoleIdDisplay.textContent = consoleId; |
|
sessionStartTime = new Date(); |
|
updateSessionDuration(); |
|
addConsoleMessage(`[+] Console session created (ID: ${consoleId})`, 'ok'); |
|
|
|
|
|
setTimeout(() => { |
|
addConsoleMessage('msf6 >', 'prompt'); |
|
updateStatusMessage('Console session ready'); |
|
endWorking(); |
|
updateConnectionUI(); |
|
}, 300); |
|
}, 1200); |
|
} |
|
|
|
function sendCommand() { |
|
const command = commandInput.value.trim(); |
|
if (!command || !consoleId) return; |
|
|
|
|
|
addConsoleMessage(command, 'command'); |
|
addToCommandHistory(command); |
|
lastCommandDisplay.textContent = command; |
|
|
|
|
|
commandInput.value = ''; |
|
|
|
|
|
startWorking(); |
|
updateStatusMessage(`Executing command: ${command}`); |
|
|
|
setTimeout(() => { |
|
|
|
let response = ''; |
|
|
|
if (command === 'version') { |
|
response = 'Metasploit Framework Version: 6.3.0-dev\n'; |
|
response += 'API Version: 1.0\n'; |
|
} else if (command === 'help') { |
|
response = 'Available commands:\n'; |
|
response += ' version - Show Metasploit version\n'; |
|
response += ' exploit - List available exploits\n'; |
|
response += ' sessions - List active sessions\n'; |
|
response += ' exit - Terminate this console\n'; |
|
} else if (command === 'exploit') { |
|
response = 'Exploits\n'; |
|
response += '========\n\n'; |
|
response += ' # Name Disclosure Date Rank Check Description\n'; |
|
response += ' - ---- --------------- ---- ----- -----------\n'; |
|
response += ' 0 exploit/multi/handler 2011-10-21 excellent No Generic Payload Handler\n'; |
|
response += ' 1 exploit/windows/smb/ms17_010_eternalblue 2017-03-14 average Yes MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption\n'; |
|
} else if (command === 'sessions') { |
|
response = 'Active sessions\n'; |
|
response += '===============\n\n'; |
|
response += 'No active sessions.\n'; |
|
} else if (command === 'exit') { |
|
response = '[*] Shutting down console session...\n'; |
|
setTimeout(() => { |
|
addConsoleMessage('[+] Console session terminated', 'ok'); |
|
consoleId = null; |
|
consoleIdDisplay.textContent = 'N/A'; |
|
sessionStartTime = null; |
|
updateStatusMessage('Console session terminated'); |
|
}, 500); |
|
} else { |
|
response = `[-] Unknown command: ${command}\n`; |
|
response += 'Type "help" for a list of commands\n'; |
|
} |
|
|
|
addConsoleMessage(response, 'output'); |
|
addConsoleMessage('msf6 >', 'prompt'); |
|
|
|
endWorking(); |
|
updateStatusMessage('Command executed'); |
|
updateConnectionUI(); |
|
}, 800); |
|
} |
|
|
|
function handleCommandInput(e) { |
|
if (e.key === 'Enter') { |
|
sendCommand(); |
|
} else if (e.key === 'ArrowUp') { |
|
|
|
if (currentHistoryPosition > 0) { |
|
currentHistoryPosition--; |
|
commandInput.value = commandHistoryList[currentHistoryPosition] || ''; |
|
updateCommandHistoryPosition(); |
|
} |
|
e.preventDefault(); |
|
} else if (e.key === 'ArrowDown') { |
|
|
|
if (currentHistoryPosition < commandHistoryList.length - 1) { |
|
currentHistoryPosition++; |
|
commandInput.value = commandHistoryList[currentHistoryPosition] || ''; |
|
updateCommandHistoryPosition(); |
|
} else { |
|
currentHistoryPosition = commandHistoryList.length; |
|
commandInput.value = ''; |
|
updateCommandHistoryPosition(); |
|
} |
|
e.preventDefault(); |
|
} |
|
} |
|
|
|
function addToCommandHistory(command) { |
|
if (command && (!commandHistoryList.length || commandHistoryList[commandHistoryList.length - 1] !== command)) { |
|
commandHistoryList.push(command); |
|
currentHistoryPosition = commandHistoryList.length; |
|
updateCommandHistory(); |
|
} |
|
} |
|
|
|
function updateCommandHistory() { |
|
commandCount.textContent = commandHistoryList.length; |
|
commandTotal.textContent = commandHistoryList.length; |
|
|
|
|
|
commandHistory.innerHTML = ''; |
|
if (commandHistoryList.length > 0) { |
|
commandHistory.style.display = 'block'; |
|
commandHistoryList.slice().reverse().forEach((cmd, index) => { |
|
const item = document.createElement('div'); |
|
item.className = 'command-history-item'; |
|
item.textContent = cmd; |
|
item.addEventListener('click', () => { |
|
commandInput.value = cmd; |
|
commandHistory.style.display = 'none'; |
|
commandInput.focus(); |
|
}); |
|
commandHistory.appendChild(item); |
|
}); |
|
} else { |
|
commandHistory.style.display = 'none'; |
|
} |
|
} |
|
|
|
function updateCommandHistoryPosition() { |
|
commandPosition.textContent = currentHistoryPosition; |
|
} |
|
|
|
function showCommandSuggestions() { |
|
const input = commandInput.value.toLowerCase(); |
|
if (!input) { |
|
commandSuggestions.style.display = 'none'; |
|
return; |
|
} |
|
|
|
const filtered = commandSuggestionsList.filter(cmd => |
|
cmd.toLowerCase().includes(input) |
|
); |
|
|
|
commandSuggestions.innerHTML = ''; |
|
if (filtered.length > 0) { |
|
commandSuggestions.style.display = 'block'; |
|
filtered.forEach(cmd => { |
|
const item = document.createElement('div'); |
|
item.className = 'command-history-item'; |
|
item.textContent = cmd; |
|
item.addEventListener('click', () => { |
|
commandInput.value = cmd; |
|
commandSuggestions.style.display = 'none'; |
|
commandInput.focus(); |
|
}); |
|
commandSuggestions.appendChild(item); |
|
}); |
|
} else { |
|
commandSuggestions.style.display = 'none'; |
|
} |
|
} |
|
|
|
function clearConsole() { |
|
consoleOutput.innerHTML = ''; |
|
addConsoleMessage('// Console cleared', 'note'); |
|
updateStatusMessage('Console cleared'); |
|
} |
|
|
|
function addConsoleMessage(message, type = 'output') { |
|
const div = document.createElement('div'); |
|
|
|
switch (type) { |
|
case 'ok': |
|
div.className = 'text-green-400'; |
|
break; |
|
case 'fail': |
|
div.className = 'text-red-400'; |
|
break; |
|
case 'warn': |
|
div.className = 'text-yellow-400'; |
|
break; |
|
case 'note': |
|
div.className = 'text-blue-400'; |
|
break; |
|
case 'command': |
|
div.className = 'text-white'; |
|
div.innerHTML = `<span class="text-purple-400">>></span> ${message}`; |
|
consoleOutput.appendChild(div); |
|
return; |
|
case 'prompt': |
|
div.className = 'text-green-400'; |
|
break; |
|
default: |
|
div.className = 'text-slate-300'; |
|
} |
|
|
|
div.textContent = message; |
|
consoleOutput.appendChild(div); |
|
consoleOutput.scrollTop = consoleOutput.scrollHeight; |
|
} |
|
|
|
function startWorking() { |
|
isWorking = true; |
|
updateConnectionUI(); |
|
} |
|
|
|
function endWorking() { |
|
isWorking = false; |
|
updateConnectionUI(); |
|
} |
|
|
|
function updateConnectionUI() { |
|
if (isWorking) { |
|
statusIndicator.className = 'status-indicator status-working'; |
|
statusText.textContent = 'Working...'; |
|
connectBtn.disabled = true; |
|
connectBtn.innerHTML = '<i class="fas fa-spinner spinner mr-2"></i>Working'; |
|
return; |
|
} |
|
|
|
if (isConnected) { |
|
statusIndicator.className = 'status-indicator status-connected'; |
|
statusText.textContent = 'Connected'; |
|
connectBtn.innerHTML = '<i class="fas fa-power-off mr-2"></i>Disconnect'; |
|
|
|
|
|
createConsoleBtn.disabled = false; |
|
commandInput.disabled = false; |
|
sendCommandBtn.disabled = false; |
|
|
|
|
|
if (isAuthenticated) { |
|
authStatusDisplay.textContent = 'Authenticated'; |
|
authStatusDisplay.className = 'text-green-400'; |
|
} else { |
|
authStatusDisplay.textContent = 'Connected (Not authenticated)'; |
|
authStatusDisplay.className = 'text-yellow-400'; |
|
} |
|
} else { |
|
statusIndicator.className = 'status-indicator status-disconnected'; |
|
statusText.textContent = 'Disconnected'; |
|
connectBtn.innerHTML = '<i class="fas fa-plug mr-2"></i>Connect'; |
|
|
|
|
|
createConsoleBtn.disabled = true; |
|
commandInput.disabled = true; |
|
sendCommandBtn.disabled = true; |
|
|
|
|
|
consoleIdDisplay.textContent = 'N/A'; |
|
authStatusDisplay.textContent = 'Not authenticated'; |
|
authStatusDisplay.className = ''; |
|
connectionTimeDisplay.textContent = '00:00:00'; |
|
sessionDurationDisplay.textContent = '00:00:00'; |
|
} |
|
} |
|
|
|
function updateStatusMessage(message) { |
|
statusMessage.textContent = message; |
|
} |
|
|
|
function updateConnectionTime() { |
|
if (connectionStartTime) { |
|
const now = new Date(); |
|
const diff = Math.floor((now - connectionStartTime) / 1000); |
|
const hours = Math.floor(diff / 3600); |
|
const minutes = Math.floor((diff % 3600) / 60); |
|
const seconds = diff % 60; |
|
connectionTimeDisplay.textContent = |
|
`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`; |
|
} |
|
} |
|
|
|
function updateSessionDuration() { |
|
if (sessionStartTime) { |
|
const now = new Date(); |
|
const diff = Math.floor((now - sessionStartTime) / 1000); |
|
const hours = Math.floor(diff / 3600); |
|
const minutes = Math.floor((diff % 3600) / 60); |
|
const seconds = diff % 60; |
|
sessionDurationDisplay.textContent = |
|
`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`; |
|
} |
|
} |
|
|
|
function startSystemMonitoring() { |
|
|
|
setInterval(() => { |
|
if (connectionStartTime) updateConnectionTime(); |
|
if (sessionStartTime) updateSessionDuration(); |
|
|
|
|
|
const memory = Math.floor(Math.random() * 30) + 10; |
|
const cpu = Math.floor(Math.random() * 20) + 5; |
|
memoryUsage.textContent = `Memory: ${memory}%`; |
|
cpuUsage.textContent = `CPU: ${cpu}%`; |
|
}, 1000); |
|
} |
|
}); |
|
</script> |
|
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=0Scottzilla0/metalink-intelligent-metasploit-integration-framework" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> |
|
</html> |