0Scottzilla0 commited on
Commit
20065f5
·
verified ·
1 Parent(s): fbf6d0f

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +829 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Metalink Intelligent Metasploit Integration Framework
3
- emoji: 🏆
4
- colorFrom: blue
5
- colorTo: pink
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: metalink-intelligent-metasploit-integration-framework
3
+ emoji: 🐳
4
+ colorFrom: green
5
+ colorTo: green
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,829 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Metasploit RPC Client</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
9
+ <style>
10
+ /* Custom scrollbar */
11
+ ::-webkit-scrollbar {
12
+ width: 8px;
13
+ }
14
+ ::-webkit-scrollbar-track {
15
+ background: #1e293b;
16
+ }
17
+ ::-webkit-scrollbar-thumb {
18
+ background: #475569;
19
+ border-radius: 4px;
20
+ }
21
+ ::-webkit-scrollbar-thumb:hover {
22
+ background: #64748b;
23
+ }
24
+
25
+ /* Terminal-like font */
26
+ .terminal-font {
27
+ font-family: 'Courier New', monospace;
28
+ }
29
+
30
+ /* Blinking cursor effect */
31
+ @keyframes blink {
32
+ 0%, 100% { opacity: 1; }
33
+ 50% { opacity: 0; }
34
+ }
35
+ .cursor {
36
+ animation: blink 1s step-end infinite;
37
+ }
38
+
39
+ /* Status indicators */
40
+ .status-indicator {
41
+ width: 10px;
42
+ height: 10px;
43
+ border-radius: 50%;
44
+ display: inline-block;
45
+ margin-right: 6px;
46
+ }
47
+ .status-connected {
48
+ background-color: #10b981;
49
+ box-shadow: 0 0 6px #10b981;
50
+ }
51
+ .status-disconnected {
52
+ background-color: #ef4444;
53
+ }
54
+ .status-working {
55
+ background-color: #f59e0b;
56
+ box-shadow: 0 0 6px #f59e0b;
57
+ }
58
+
59
+ /* Command history dropdown */
60
+ .command-history {
61
+ max-height: 200px;
62
+ overflow-y: auto;
63
+ border: 1px solid #334155;
64
+ border-radius: 0.375rem;
65
+ background-color: #1e293b;
66
+ position: absolute;
67
+ width: 100%;
68
+ z-index: 10;
69
+ display: none;
70
+ }
71
+ .command-history-item {
72
+ padding: 0.5rem;
73
+ cursor: pointer;
74
+ border-bottom: 1px solid #334155;
75
+ }
76
+ .command-history-item:hover {
77
+ background-color: #334155;
78
+ }
79
+
80
+ /* Tab styling */
81
+ .tab {
82
+ padding: 0.5rem 1rem;
83
+ cursor: pointer;
84
+ border-radius: 0.375rem 0.375rem 0 0;
85
+ background-color: #334155;
86
+ margin-right: 0.25rem;
87
+ }
88
+ .tab.active {
89
+ background-color: #475569;
90
+ border-bottom: 2px solid #3b82f6;
91
+ }
92
+
93
+ /* Loading spinner */
94
+ @keyframes spin {
95
+ 0% { transform: rotate(0deg); }
96
+ 100% { transform: rotate(360deg); }
97
+ }
98
+ .spinner {
99
+ animation: spin 1s linear infinite;
100
+ }
101
+ </style>
102
+ </head>
103
+ <body class="bg-slate-900 text-slate-200 min-h-screen">
104
+ <div class="container mx-auto px-4 py-8">
105
+ <!-- Header -->
106
+ <header class="flex justify-between items-center mb-8">
107
+ <div class="flex items-center">
108
+ <i class="fas fa-bug text-3xl text-red-500 mr-3"></i>
109
+ <h1 class="text-2xl font-bold bg-gradient-to-r from-red-500 to-orange-500 bg-clip-text text-transparent">
110
+ Metasploit RPC Client
111
+ </h1>
112
+ </div>
113
+ <div class="flex items-center space-x-4">
114
+ <div id="connection-status" class="flex items-center">
115
+ <span class="status-indicator status-disconnected"></span>
116
+ <span>Disconnected</span>
117
+ </div>
118
+ <button id="connect-btn" class="bg-blue-600 hover:bg-blue-700 px-4 py-2 rounded-md font-medium transition-colors">
119
+ <i class="fas fa-plug mr-2"></i>Connect
120
+ </button>
121
+ </div>
122
+ </header>
123
+
124
+ <!-- Main Content -->
125
+ <div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
126
+ <!-- Configuration Panel -->
127
+ <div class="bg-slate-800 rounded-lg p-6 shadow-lg lg:col-span-1">
128
+ <h2 class="text-xl font-semibold mb-4 flex items-center">
129
+ <i class="fas fa-cog mr-2 text-blue-400"></i>Configuration
130
+ </h2>
131
+
132
+ <div class="space-y-4">
133
+ <div>
134
+ <label class="block text-sm font-medium mb-1">Host</label>
135
+ <input id="host-input" type="text" value="127.0.0.1"
136
+ 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">
137
+ </div>
138
+
139
+ <div>
140
+ <label class="block text-sm font-medium mb-1">Port</label>
141
+ <input id="port-input" type="number" value="55552"
142
+ 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">
143
+ </div>
144
+
145
+ <div>
146
+ <label class="block text-sm font-medium mb-1">URI</label>
147
+ <input id="uri-input" type="text" value="/api/"
148
+ 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">
149
+ </div>
150
+
151
+ <div class="flex items-center">
152
+ <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">
153
+ <label class="ml-2 text-sm">Use SSL</label>
154
+ </div>
155
+
156
+ <div>
157
+ <label class="block text-sm font-medium mb-1">Username</label>
158
+ <input id="username-input" type="text" value="msf"
159
+ 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">
160
+ </div>
161
+
162
+ <div>
163
+ <label class="block text-sm font-medium mb-1">Password</label>
164
+ <div class="relative">
165
+ <input id="password-input" type="password" value="password"
166
+ 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">
167
+ <button id="toggle-password" class="absolute right-3 top-2 text-slate-400 hover:text-slate-200">
168
+ <i class="fas fa-eye"></i>
169
+ </button>
170
+ </div>
171
+ </div>
172
+
173
+ <div>
174
+ <label class="block text-sm font-medium mb-1">Timeout (seconds)</label>
175
+ <input id="timeout-input" type="number" value="5"
176
+ 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">
177
+ </div>
178
+
179
+ <div class="pt-2">
180
+ <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">
181
+ <i class="fas fa-save mr-2"></i>Save Configuration
182
+ </button>
183
+ </div>
184
+ </div>
185
+ </div>
186
+
187
+ <!-- Console Panel -->
188
+ <div class="bg-slate-800 rounded-lg shadow-lg lg:col-span-2 flex flex-col">
189
+ <div class="p-4 border-b border-slate-700 flex justify-between items-center">
190
+ <div class="flex items-center space-x-2">
191
+ <h2 class="text-xl font-semibold flex items-center">
192
+ <i class="fas fa-terminal mr-2 text-green-400"></i>Console
193
+ </h2>
194
+ <div id="console-tabs" class="flex">
195
+ <div class="tab active" data-tab="main">Main</div>
196
+ <!-- Additional tabs will be added dynamically -->
197
+ </div>
198
+ </div>
199
+ <div class="flex space-x-2">
200
+ <button id="clear-console-btn" class="bg-slate-700 hover:bg-slate-600 px-3 py-1 rounded text-sm transition-colors">
201
+ <i class="fas fa-trash mr-1"></i>Clear
202
+ </button>
203
+ <button id="create-console-btn" class="bg-green-600 hover:bg-green-700 px-3 py-1 rounded text-sm transition-colors" disabled>
204
+ <i class="fas fa-plus mr-1"></i>New Session
205
+ </button>
206
+ </div>
207
+ </div>
208
+
209
+ <div id="console-output" class="terminal-font p-4 flex-grow overflow-y-auto max-h-96 bg-slate-900 text-green-400">
210
+ <div class="text-slate-400">// Metasploit RPC Console</div>
211
+ <div class="text-slate-400">// Connect to start a session</div>
212
+ </div>
213
+
214
+ <div class="p-4 border-t border-slate-700 relative">
215
+ <div class="flex">
216
+ <span class="text-green-400 mr-2">msf6 ></span>
217
+ <div class="flex-grow relative">
218
+ <input id="command-input" type="text"
219
+ class="w-full bg-slate-900 border-0 focus:outline-none terminal-font text-green-400 caret-white"
220
+ placeholder="Enter command..." disabled>
221
+ <span id="command-cursor" class="cursor absolute left-0 top-0 h-5 w-2 bg-green-400"></span>
222
+ <div id="command-history" class="command-history"></div>
223
+ <div id="command-suggestions" class="command-history"></div>
224
+ </div>
225
+ <button id="send-command-btn" class="ml-2 bg-blue-600 hover:bg-blue-700 px-4 py-1 rounded transition-colors" disabled>
226
+ <i class="fas fa-paper-plane"></i>
227
+ </button>
228
+ </div>
229
+ <div class="flex justify-between mt-2 text-xs text-slate-400">
230
+ <div>
231
+ <span id="command-count">0</span> commands in history
232
+ </div>
233
+ <div>
234
+ <span id="command-position">0</span>/<span id="command-total">0</span>
235
+ </div>
236
+ </div>
237
+ </div>
238
+ </div>
239
+ </div>
240
+
241
+ <!-- Session Info Panel -->
242
+ <div class="mt-6 bg-slate-800 rounded-lg p-6 shadow-lg">
243
+ <h2 class="text-xl font-semibold mb-4 flex items-center">
244
+ <i class="fas fa-info-circle mr-2 text-purple-400"></i>Session Information
245
+ </h2>
246
+
247
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
248
+ <div class="bg-slate-700 p-4 rounded-lg">
249
+ <div class="text-sm text-slate-400 mb-1">Console ID</div>
250
+ <div id="console-id" class="text-lg font-mono">N/A</div>
251
+ </div>
252
+
253
+ <div class="bg-slate-700 p-4 rounded-lg">
254
+ <div class="text-sm text-slate-400 mb-1">Authentication</div>
255
+ <div id="auth-status" class="text-lg">Not authenticated</div>
256
+ </div>
257
+
258
+ <div class="bg-slate-700 p-4 rounded-lg">
259
+ <div class="text-sm text-slate-400 mb-1">Last Command</div>
260
+ <div id="last-command" class="text-lg font-mono truncate">N/A</div>
261
+ </div>
262
+ </div>
263
+
264
+ <div class="mt-4 grid grid-cols-1 md:grid-cols-2 gap-4">
265
+ <div class="bg-slate-700 p-4 rounded-lg">
266
+ <div class="text-sm text-slate-400 mb-1">Connection Time</div>
267
+ <div id="connection-time" class="text-lg">00:00:00</div>
268
+ </div>
269
+
270
+ <div class="bg-slate-700 p-4 rounded-lg">
271
+ <div class="text-sm text-slate-400 mb-1">Session Duration</div>
272
+ <div id="session-duration" class="text-lg">00:00:00</div>
273
+ </div>
274
+ </div>
275
+ </div>
276
+
277
+ <!-- Status Bar -->
278
+ <div class="mt-4 bg-slate-800 rounded-lg p-2 text-sm text-slate-400 flex justify-between items-center">
279
+ <div>
280
+ <span id="status-message">Ready</span>
281
+ </div>
282
+ <div class="flex items-center">
283
+ <span id="memory-usage" class="mr-4">Memory: --</span>
284
+ <span id="cpu-usage">CPU: --</span>
285
+ </div>
286
+ </div>
287
+ </div>
288
+
289
+ <script>
290
+ document.addEventListener('DOMContentLoaded', function() {
291
+ // DOM Elements
292
+ const connectBtn = document.getElementById('connect-btn');
293
+ const connectionStatus = document.getElementById('connection-status');
294
+ const statusIndicator = connectionStatus.querySelector('.status-indicator');
295
+ const statusText = connectionStatus.querySelector('span:last-child');
296
+
297
+ const consoleOutput = document.getElementById('console-output');
298
+ const commandInput = document.getElementById('command-input');
299
+ const sendCommandBtn = document.getElementById('send-command-btn');
300
+ const clearConsoleBtn = document.getElementById('clear-console-btn');
301
+ const createConsoleBtn = document.getElementById('create-console-btn');
302
+
303
+ const consoleIdDisplay = document.getElementById('console-id');
304
+ const authStatusDisplay = document.getElementById('auth-status');
305
+ const lastCommandDisplay = document.getElementById('last-command');
306
+ const connectionTimeDisplay = document.getElementById('connection-time');
307
+ const sessionDurationDisplay = document.getElementById('session-duration');
308
+ const statusMessage = document.getElementById('status-message');
309
+ const memoryUsage = document.getElementById('memory-usage');
310
+ const cpuUsage = document.getElementById('cpu-usage');
311
+
312
+ // Command history elements
313
+ const commandHistory = document.getElementById('command-history');
314
+ const commandSuggestions = document.getElementById('command-suggestions');
315
+ const commandCount = document.getElementById('command-count');
316
+ const commandPosition = document.getElementById('command-position');
317
+ const commandTotal = document.getElementById('command-total');
318
+
319
+ // Configuration elements
320
+ const togglePasswordBtn = document.getElementById('toggle-password');
321
+ const passwordInput = document.getElementById('password-input');
322
+ const saveConfigBtn = document.getElementById('save-config-btn');
323
+
324
+ // State variables
325
+ let isConnected = false;
326
+ let isAuthenticated = false;
327
+ let consoleId = null;
328
+ let isWorking = false;
329
+ let connectionStartTime = null;
330
+ let sessionStartTime = null;
331
+ let commandHistoryList = [];
332
+ let currentHistoryPosition = 0;
333
+ let commandSuggestionsList = [
334
+ 'version', 'help', 'exploit', 'sessions', 'exit',
335
+ 'use exploit/multi/handler',
336
+ 'set payload windows/meterpreter/reverse_tcp',
337
+ 'set LHOST 192.168.1.1',
338
+ 'set LPORT 4444',
339
+ 'exploit -j'
340
+ ];
341
+
342
+ // Initialize the app
343
+ initApp();
344
+
345
+ function initApp() {
346
+ // Load saved configuration
347
+ loadConfiguration();
348
+
349
+ // Set up event listeners
350
+ setupEventListeners();
351
+
352
+ // Update UI to initial state
353
+ updateConnectionUI();
354
+
355
+ // Add welcome messages
356
+ addConsoleMessage('// Metasploit RPC Client Interface', 'note');
357
+ addConsoleMessage('// Connect to the RPC server to begin', 'note');
358
+
359
+ // Start system monitoring
360
+ startSystemMonitoring();
361
+ }
362
+
363
+ function loadConfiguration() {
364
+ // In a real app, this would load from localStorage or a config file
365
+ const config = {
366
+ host: '127.0.0.1',
367
+ port: '55552',
368
+ uri: '/api/',
369
+ ssl: false,
370
+ username: 'msf',
371
+ password: 'password',
372
+ timeout: '5'
373
+ };
374
+
375
+ document.getElementById('host-input').value = config.host;
376
+ document.getElementById('port-input').value = config.port;
377
+ document.getElementById('uri-input').value = config.uri;
378
+ document.getElementById('ssl-checkbox').checked = config.ssl;
379
+ document.getElementById('username-input').value = config.username;
380
+ document.getElementById('password-input').value = config.password;
381
+ document.getElementById('timeout-input').value = config.timeout;
382
+ }
383
+
384
+ function saveConfiguration() {
385
+ const config = {
386
+ host: document.getElementById('host-input').value,
387
+ port: document.getElementById('port-input').value,
388
+ uri: document.getElementById('uri-input').value,
389
+ ssl: document.getElementById('ssl-checkbox').checked,
390
+ username: document.getElementById('username-input').value,
391
+ password: document.getElementById('password-input').value,
392
+ timeout: document.getElementById('timeout-input').value
393
+ };
394
+
395
+ // In a real app, this would save to localStorage or a config file
396
+ addConsoleMessage('[+] Configuration saved', 'ok');
397
+ updateStatusMessage('Configuration saved successfully');
398
+ }
399
+
400
+ function setupEventListeners() {
401
+ // Toggle password visibility
402
+ togglePasswordBtn.addEventListener('click', togglePasswordVisibility);
403
+
404
+ // Connect/disconnect button handler
405
+ connectBtn.addEventListener('click', connectDisconnect);
406
+
407
+ // Create new console session
408
+ createConsoleBtn.addEventListener('click', createConsoleSession);
409
+
410
+ // Send command to console
411
+ sendCommandBtn.addEventListener('click', sendCommand);
412
+ commandInput.addEventListener('keydown', handleCommandInput);
413
+
414
+ // Clear console
415
+ clearConsoleBtn.addEventListener('click', clearConsole);
416
+
417
+ // Save configuration
418
+ saveConfigBtn.addEventListener('click', saveConfiguration);
419
+
420
+ // Command history and suggestions
421
+ commandInput.addEventListener('input', showCommandSuggestions);
422
+ commandInput.addEventListener('focus', showCommandSuggestions);
423
+ commandInput.addEventListener('blur', () => {
424
+ setTimeout(() => {
425
+ commandSuggestions.style.display = 'none';
426
+ }, 200);
427
+ });
428
+
429
+ // Window resize handler
430
+ window.addEventListener('resize', updateUI);
431
+ }
432
+
433
+ function togglePasswordVisibility() {
434
+ const type = passwordInput.getAttribute('type') === 'password' ? 'text' : 'password';
435
+ passwordInput.setAttribute('type', type);
436
+ togglePasswordBtn.innerHTML = type === 'password' ? '<i class="fas fa-eye"></i>' : '<i class="fas fa-eye-slash"></i>';
437
+ }
438
+
439
+ function connectDisconnect() {
440
+ if (isConnected) {
441
+ // Disconnect
442
+ startWorking();
443
+ updateStatusMessage('Disconnecting from server...');
444
+
445
+ // Simulate disconnection delay
446
+ setTimeout(() => {
447
+ addConsoleMessage('[+] Successfully disconnected from Metasploit RPC server', 'ok');
448
+
449
+ isConnected = false;
450
+ isAuthenticated = false;
451
+ consoleId = null;
452
+ connectionStartTime = null;
453
+ sessionStartTime = null;
454
+
455
+ endWorking();
456
+ updateConnectionUI();
457
+ updateStatusMessage('Disconnected from server');
458
+ }, 800);
459
+ } else {
460
+ // Connect
461
+ startWorking();
462
+ updateStatusMessage('Connecting to server...');
463
+
464
+ // Get connection parameters
465
+ const host = document.getElementById('host-input').value;
466
+ const port = document.getElementById('port-input').value;
467
+ const uri = document.getElementById('uri-input').value;
468
+ const useSSL = document.getElementById('ssl-checkbox').checked;
469
+ const username = document.getElementById('username-input').value;
470
+ const password = document.getElementById('password-input').value;
471
+ const timeout = document.getElementById('timeout-input').value;
472
+
473
+ // Simulate connection delay
474
+ setTimeout(() => {
475
+ addConsoleMessage(`[+] Connecting to ${host}:${port}${uri}`, 'note');
476
+
477
+ // Simulate successful connection
478
+ setTimeout(() => {
479
+ addConsoleMessage('[+] Connection established', 'ok');
480
+ connectionStartTime = new Date();
481
+ updateConnectionTime();
482
+
483
+ // Simulate authentication
484
+ setTimeout(() => {
485
+ if (username && password) {
486
+ addConsoleMessage('[+] Authenticating with provided credentials...', 'note');
487
+ updateStatusMessage('Authenticating...');
488
+
489
+ setTimeout(() => {
490
+ addConsoleMessage('[+] Successfully authenticated', 'ok');
491
+ isAuthenticated = true;
492
+ updateStatusMessage('Connected and authenticated');
493
+
494
+ isConnected = true;
495
+ endWorking();
496
+ updateConnectionUI();
497
+ }, 800);
498
+ } else {
499
+ addConsoleMessage('[!] No credentials provided - connected but not authenticated', 'warn');
500
+ updateStatusMessage('Connected (not authenticated)');
501
+
502
+ isConnected = true;
503
+ endWorking();
504
+ updateConnectionUI();
505
+ }
506
+ }, 500);
507
+ }, 800);
508
+ }, 1000);
509
+ }
510
+ }
511
+
512
+ function createConsoleSession() {
513
+ startWorking();
514
+ updateStatusMessage('Creating new console session...');
515
+ addConsoleMessage('[+] Creating new console session...', 'note');
516
+
517
+ // Simulate console creation
518
+ setTimeout(() => {
519
+ consoleId = Math.floor(Math.random() * 10000);
520
+ consoleIdDisplay.textContent = consoleId;
521
+ sessionStartTime = new Date();
522
+ updateSessionDuration();
523
+ addConsoleMessage(`[+] Console session created (ID: ${consoleId})`, 'ok');
524
+
525
+ // Simulate initial console output
526
+ setTimeout(() => {
527
+ addConsoleMessage('msf6 >', 'prompt');
528
+ updateStatusMessage('Console session ready');
529
+ endWorking();
530
+ updateConnectionUI();
531
+ }, 300);
532
+ }, 1200);
533
+ }
534
+
535
+ function sendCommand() {
536
+ const command = commandInput.value.trim();
537
+ if (!command || !consoleId) return;
538
+
539
+ // Add command to console and history
540
+ addConsoleMessage(command, 'command');
541
+ addToCommandHistory(command);
542
+ lastCommandDisplay.textContent = command;
543
+
544
+ // Clear input
545
+ commandInput.value = '';
546
+
547
+ // Simulate command processing
548
+ startWorking();
549
+ updateStatusMessage(`Executing command: ${command}`);
550
+
551
+ setTimeout(() => {
552
+ // Simulate command output based on command
553
+ let response = '';
554
+
555
+ if (command === 'version') {
556
+ response = 'Metasploit Framework Version: 6.3.0-dev\n';
557
+ response += 'API Version: 1.0\n';
558
+ } else if (command === 'help') {
559
+ response = 'Available commands:\n';
560
+ response += ' version - Show Metasploit version\n';
561
+ response += ' exploit - List available exploits\n';
562
+ response += ' sessions - List active sessions\n';
563
+ response += ' exit - Terminate this console\n';
564
+ } else if (command === 'exploit') {
565
+ response = 'Exploits\n';
566
+ response += '========\n\n';
567
+ response += ' # Name Disclosure Date Rank Check Description\n';
568
+ response += ' - ---- --------------- ---- ----- -----------\n';
569
+ response += ' 0 exploit/multi/handler 2011-10-21 excellent No Generic Payload Handler\n';
570
+ response += ' 1 exploit/windows/smb/ms17_010_eternalblue 2017-03-14 average Yes MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption\n';
571
+ } else if (command === 'sessions') {
572
+ response = 'Active sessions\n';
573
+ response += '===============\n\n';
574
+ response += 'No active sessions.\n';
575
+ } else if (command === 'exit') {
576
+ response = '[*] Shutting down console session...\n';
577
+ setTimeout(() => {
578
+ addConsoleMessage('[+] Console session terminated', 'ok');
579
+ consoleId = null;
580
+ consoleIdDisplay.textContent = 'N/A';
581
+ sessionStartTime = null;
582
+ updateStatusMessage('Console session terminated');
583
+ }, 500);
584
+ } else {
585
+ response = `[-] Unknown command: ${command}\n`;
586
+ response += 'Type "help" for a list of commands\n';
587
+ }
588
+
589
+ addConsoleMessage(response, 'output');
590
+ addConsoleMessage('msf6 >', 'prompt');
591
+
592
+ endWorking();
593
+ updateStatusMessage('Command executed');
594
+ updateConnectionUI();
595
+ }, 800);
596
+ }
597
+
598
+ function handleCommandInput(e) {
599
+ if (e.key === 'Enter') {
600
+ sendCommand();
601
+ } else if (e.key === 'ArrowUp') {
602
+ // Navigate command history up
603
+ if (currentHistoryPosition > 0) {
604
+ currentHistoryPosition--;
605
+ commandInput.value = commandHistoryList[currentHistoryPosition] || '';
606
+ updateCommandHistoryPosition();
607
+ }
608
+ e.preventDefault();
609
+ } else if (e.key === 'ArrowDown') {
610
+ // Navigate command history down
611
+ if (currentHistoryPosition < commandHistoryList.length - 1) {
612
+ currentHistoryPosition++;
613
+ commandInput.value = commandHistoryList[currentHistoryPosition] || '';
614
+ updateCommandHistoryPosition();
615
+ } else {
616
+ currentHistoryPosition = commandHistoryList.length;
617
+ commandInput.value = '';
618
+ updateCommandHistoryPosition();
619
+ }
620
+ e.preventDefault();
621
+ }
622
+ }
623
+
624
+ function addToCommandHistory(command) {
625
+ if (command && (!commandHistoryList.length || commandHistoryList[commandHistoryList.length - 1] !== command)) {
626
+ commandHistoryList.push(command);
627
+ currentHistoryPosition = commandHistoryList.length;
628
+ updateCommandHistory();
629
+ }
630
+ }
631
+
632
+ function updateCommandHistory() {
633
+ commandCount.textContent = commandHistoryList.length;
634
+ commandTotal.textContent = commandHistoryList.length;
635
+
636
+ // Update history dropdown
637
+ commandHistory.innerHTML = '';
638
+ if (commandHistoryList.length > 0) {
639
+ commandHistory.style.display = 'block';
640
+ commandHistoryList.slice().reverse().forEach((cmd, index) => {
641
+ const item = document.createElement('div');
642
+ item.className = 'command-history-item';
643
+ item.textContent = cmd;
644
+ item.addEventListener('click', () => {
645
+ commandInput.value = cmd;
646
+ commandHistory.style.display = 'none';
647
+ commandInput.focus();
648
+ });
649
+ commandHistory.appendChild(item);
650
+ });
651
+ } else {
652
+ commandHistory.style.display = 'none';
653
+ }
654
+ }
655
+
656
+ function updateCommandHistoryPosition() {
657
+ commandPosition.textContent = currentHistoryPosition;
658
+ }
659
+
660
+ function showCommandSuggestions() {
661
+ const input = commandInput.value.toLowerCase();
662
+ if (!input) {
663
+ commandSuggestions.style.display = 'none';
664
+ return;
665
+ }
666
+
667
+ const filtered = commandSuggestionsList.filter(cmd =>
668
+ cmd.toLowerCase().includes(input)
669
+ );
670
+
671
+ commandSuggestions.innerHTML = '';
672
+ if (filtered.length > 0) {
673
+ commandSuggestions.style.display = 'block';
674
+ filtered.forEach(cmd => {
675
+ const item = document.createElement('div');
676
+ item.className = 'command-history-item';
677
+ item.textContent = cmd;
678
+ item.addEventListener('click', () => {
679
+ commandInput.value = cmd;
680
+ commandSuggestions.style.display = 'none';
681
+ commandInput.focus();
682
+ });
683
+ commandSuggestions.appendChild(item);
684
+ });
685
+ } else {
686
+ commandSuggestions.style.display = 'none';
687
+ }
688
+ }
689
+
690
+ function clearConsole() {
691
+ consoleOutput.innerHTML = '';
692
+ addConsoleMessage('// Console cleared', 'note');
693
+ updateStatusMessage('Console cleared');
694
+ }
695
+
696
+ function addConsoleMessage(message, type = 'output') {
697
+ const div = document.createElement('div');
698
+
699
+ switch (type) {
700
+ case 'ok':
701
+ div.className = 'text-green-400';
702
+ break;
703
+ case 'fail':
704
+ div.className = 'text-red-400';
705
+ break;
706
+ case 'warn':
707
+ div.className = 'text-yellow-400';
708
+ break;
709
+ case 'note':
710
+ div.className = 'text-blue-400';
711
+ break;
712
+ case 'command':
713
+ div.className = 'text-white';
714
+ div.innerHTML = `<span class="text-purple-400">>></span> ${message}`;
715
+ consoleOutput.appendChild(div);
716
+ return;
717
+ case 'prompt':
718
+ div.className = 'text-green-400';
719
+ break;
720
+ default: // output
721
+ div.className = 'text-slate-300';
722
+ }
723
+
724
+ div.textContent = message;
725
+ consoleOutput.appendChild(div);
726
+ consoleOutput.scrollTop = consoleOutput.scrollHeight;
727
+ }
728
+
729
+ function startWorking() {
730
+ isWorking = true;
731
+ updateConnectionUI();
732
+ }
733
+
734
+ function endWorking() {
735
+ isWorking = false;
736
+ updateConnectionUI();
737
+ }
738
+
739
+ function updateConnectionUI() {
740
+ if (isWorking) {
741
+ statusIndicator.className = 'status-indicator status-working';
742
+ statusText.textContent = 'Working...';
743
+ connectBtn.disabled = true;
744
+ connectBtn.innerHTML = '<i class="fas fa-spinner spinner mr-2"></i>Working';
745
+ return;
746
+ }
747
+
748
+ if (isConnected) {
749
+ statusIndicator.className = 'status-indicator status-connected';
750
+ statusText.textContent = 'Connected';
751
+ connectBtn.innerHTML = '<i class="fas fa-power-off mr-2"></i>Disconnect';
752
+
753
+ // Enable console controls
754
+ createConsoleBtn.disabled = false;
755
+ commandInput.disabled = false;
756
+ sendCommandBtn.disabled = false;
757
+
758
+ // Update auth status
759
+ if (isAuthenticated) {
760
+ authStatusDisplay.textContent = 'Authenticated';
761
+ authStatusDisplay.className = 'text-green-400';
762
+ } else {
763
+ authStatusDisplay.textContent = 'Connected (Not authenticated)';
764
+ authStatusDisplay.className = 'text-yellow-400';
765
+ }
766
+ } else {
767
+ statusIndicator.className = 'status-indicator status-disconnected';
768
+ statusText.textContent = 'Disconnected';
769
+ connectBtn.innerHTML = '<i class="fas fa-plug mr-2"></i>Connect';
770
+
771
+ // Disable console controls
772
+ createConsoleBtn.disabled = true;
773
+ commandInput.disabled = true;
774
+ sendCommandBtn.disabled = true;
775
+
776
+ // Reset session info
777
+ consoleIdDisplay.textContent = 'N/A';
778
+ authStatusDisplay.textContent = 'Not authenticated';
779
+ authStatusDisplay.className = '';
780
+ connectionTimeDisplay.textContent = '00:00:00';
781
+ sessionDurationDisplay.textContent = '00:00:00';
782
+ }
783
+ }
784
+
785
+ function updateStatusMessage(message) {
786
+ statusMessage.textContent = message;
787
+ }
788
+
789
+ function updateConnectionTime() {
790
+ if (connectionStartTime) {
791
+ const now = new Date();
792
+ const diff = Math.floor((now - connectionStartTime) / 1000);
793
+ const hours = Math.floor(diff / 3600);
794
+ const minutes = Math.floor((diff % 3600) / 60);
795
+ const seconds = diff % 60;
796
+ connectionTimeDisplay.textContent =
797
+ `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
798
+ }
799
+ }
800
+
801
+ function updateSessionDuration() {
802
+ if (sessionStartTime) {
803
+ const now = new Date();
804
+ const diff = Math.floor((now - sessionStartTime) / 1000);
805
+ const hours = Math.floor(diff / 3600);
806
+ const minutes = Math.floor((diff % 3600) / 60);
807
+ const seconds = diff % 60;
808
+ sessionDurationDisplay.textContent =
809
+ `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}`;
810
+ }
811
+ }
812
+
813
+ function startSystemMonitoring() {
814
+ // Simulate system monitoring
815
+ setInterval(() => {
816
+ if (connectionStartTime) updateConnectionTime();
817
+ if (sessionStartTime) updateSessionDuration();
818
+
819
+ // Simulate memory and CPU usage
820
+ const memory = Math.floor(Math.random() * 30) + 10;
821
+ const cpu = Math.floor(Math.random() * 20) + 5;
822
+ memoryUsage.textContent = `Memory: ${memory}%`;
823
+ cpuUsage.textContent = `CPU: ${cpu}%`;
824
+ }, 1000);
825
+ }
826
+ });
827
+ </script>
828
+ <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>
829
+ </html>