-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1147 lines (1033 loc) · 51.6 KB
/
Copy pathindex.html
File metadata and controls
1147 lines (1033 loc) · 51.6 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">
<title>GhostHack Academy · Ethical Hacking Mentor</title>
<meta name="description" content="GhostHack Academy: learn ethical hacking with a gamified roadmap, lessons, tasks, and an AI mentor."
>
<meta name="keywords" content="ethical hacking, cybersecurity, pentesting, OSINT, web security, DFIR, CTF">
<meta name="author" content="GhostHack Academy">
<meta name="robots" content="index,follow">
<meta property="og:title" content="GhostHack Academy · Ethical Hacking Mentor">
<meta property="og:description" content="Learn ethical hacking with a structured roadmap and AI teacher.">
<meta property="og:type" content="website">
<meta property="og:image" content="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='512' height='512'%3E%3Crect width='100%25' height='100%25' fill='%23000000'/%3E%3Cpath d='M256 96c-70 0-112 46-112 106 0 90 64 142 112 214 48-72 112-124 112-214 0-60-42-106-112-106zm-52 96a20 20 0 110 40 20 20 0 010-40zm104 0a20 20 0 110 40 20 20 0 010-40z' fill='%2300ff88'/%3E%3C/svg%3E">
<meta name="twitter:card" content="summary_large_image">
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64'%3E%3Crect width='100%25' height='100%25' fill='%23000000'/%3E%3Cpath d='M32 10c-10 0-16 6.5-16 15 0 12.6 9.1 19.8 16 29.9 6.9-10.1 16-17.3 16-29.9 0-8.5-6-15-16-15z' fill='%2300ff88'/%3E%3C/svg%3E">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "GhostHack Academy",
"url": "",
"sameAs": [
"https://www.instagram.com/zoubaire_26",
"https://github.com/MOSTRE"
]
}
</script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Source+Code+Pro:wght@300;400;500;700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: #000000;
font-family: 'Source Code Pro', monospace;
color: #00ff00;
overflow: hidden;
height: 100vh;
position: relative;
}
.matrix-bg {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: -1;
opacity: 0.1;
}
.scanlines {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: repeating-linear-gradient(
0deg,
transparent,
transparent 2px,
rgba(0, 180, 0, 0.02) 2px,
rgba(0, 180, 0, 0.02) 4px
);
pointer-events: none;
z-index: 1;
}
.terminal {
height: 100vh;
background: radial-gradient(1200px 800px at 100% 0%, rgba(0, 30, 0, 0.25), transparent 60%)
, radial-gradient(1000px 700px at 0% 100%, rgba(0, 20, 0, 0.2), transparent 60%)
, rgba(0, 0, 0, 0.96);
border: 1px solid #004400;
box-shadow: 0 0 30px rgba(0, 255, 0, 0.06), inset 0 0 20px rgba(0, 255, 0, 0.02);
display: flex;
flex-direction: column;
position: relative;
}
.header {
background: linear-gradient(90deg, #000a00, #001400, #000a00);
border-bottom: 1px solid #003300;
padding: 10px 20px;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 12px rgba(0, 255, 0, 0.05);
}
.terminal-title {
font-size: 14px;
font-weight: 700;
text-shadow: 0 0 6px rgba(0, 255, 0, 0.25);
display: flex;
align-items: center;
gap: 10px;
}
.status-bar {
display: flex;
gap: 20px;
font-size: 12px;
}
.status-item {
display: flex;
align-items: center;
gap: 5px;
}
.status-dot {
width: 8px;
height: 8px;
border-radius: 50%;
background: #00aa00;
animation: pulse 2s infinite;
box-shadow: 0 0 8px rgba(0, 255, 0, 0.2);
}
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.3; }
}
.terminal-body {
flex: 1;
display: flex;
flex-direction: row;
overflow: hidden;
}
.roadmap {
width: 300px;
border-right: 1px solid #002200;
background: rgba(0, 6, 0, 0.75);
padding: 12px;
overflow-y: auto;
backdrop-filter: blur(1px);
}
.roadmap h3 {
margin-bottom: 8px;
color: #00ff00;
font-size: 13px;
}
.chapter {
margin-bottom: 10px;
}
.chapter-title {
color: #00ffff;
font-weight: 700;
font-size: 12px;
margin-bottom: 6px;
text-shadow: 0 0 6px rgba(0, 255, 255, 0.15);
}
.lesson-item {
font-size: 12px;
padding: 4px 8px;
border-left: 2px solid #002200;
margin: 2px 0;
cursor: pointer;
border-radius: 2px;
transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.lesson-item:hover { background: rgba(0, 255, 0, 0.05); border-left-color: #005500; }
.lesson-item.active { border-left-color: #00ff88; color: #eaff00; text-shadow: 0 0 6px rgba(234, 255, 0, 0.2); background: rgba(0, 255, 136, 0.05); }
.lesson-item.completed { color: #265926; text-decoration: line-through; }
.chat-panel { flex: 1; display: flex; flex-direction: column; }
.xp-container {
padding: 8px 12px;
border-bottom: 1px solid #002200;
background: rgba(0, 12, 0, 0.6);
box-shadow: 0 1px 8px rgba(0, 255, 0, 0.05);
}
.xp-bar {
height: 10px;
background: #000a00;
border: 1px solid #002200;
border-radius: 3px;
overflow: hidden;
}
.xp-fill {
height: 100%;
width: 0%;
background: linear-gradient(90deg, #005c00, #00c400);
box-shadow: 0 0 8px rgba(0, 255, 0, 0.2);
}
.lesson-controls {
display: flex;
gap: 8px;
padding: 8px 12px;
border-bottom: 1px solid #002200;
background: rgba(0, 12, 0, 0.6);
}
.btn {
background: transparent;
color: #00e000;
border: 1px solid #004400;
padding: 4px 8px;
font-family: 'Source Code Pro', monospace;
font-size: 12px;
cursor: pointer;
}
.btn:hover { background: rgba(0, 255, 0, 0.06); border-color: #00aa00; box-shadow: 0 0 10px rgba(0, 255, 0, 0.1); }
.btn:active { transform: translateY(1px); }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 5; display: none; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 520px; max-width: 92vw; background: rgba(0, 6, 0, 0.9); border: 1px solid #004400; box-shadow: 0 0 20px rgba(0,255,0,0.08); z-index: 6; display: none; }
.modal header { padding: 12px 16px; border-bottom: 1px solid #002200; background: rgba(0, 12, 0, 0.7); font-size: 14px; color: #00ff88; }
.modal .content { padding: 14px 16px; display: grid; gap: 10px; }
.modal label { font-size: 12px; color: #9ae6b4; }
.modal input, .modal select { width: 100%; background: #000a00; color: #e5e57a; border: 1px solid #003300; padding: 6px 8px; font-family: 'Source Code Pro', monospace; font-size: 12px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid #002200; background: rgba(0, 12, 0, 0.7); }
.output {
flex: 1;
padding: 18px 20px 20px 20px;
overflow-y: auto;
font-size: 13px;
line-height: 1.6;
scrollbar-width: thin;
scrollbar-color: #007700 #000000;
background: rgba(0, 4, 0, 0.6);
}
.output::-webkit-scrollbar {
width: 8px;
}
.output::-webkit-scrollbar-track {
background: #000000;
}
.output::-webkit-scrollbar-thumb {
background: #007700;
border-radius: 4px;
}
.message {
margin-bottom: 15px;
animation: fadeIn 0.5s ease-out;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.user-input {
color: #ffff00;
font-weight: 500;
}
.user-input::before {
content: "root@darknet:~$ ";
color: #ff0000;
}
.ai-response {
color: #00ffff;
margin-left: 20px;
position: relative;
line-height: 1.65;
border-left: 2px solid #007777;
padding-left: 10px;
max-width: 85ch;
text-shadow: 0 0 6px rgba(0, 255, 255, 0.08);
white-space: pre-wrap;
}
.ai-text { color: #00ffff; white-space: pre-wrap; }
.ai-response::before {
content: "[GHOST_AI]> ";
color: #ff00ff;
font-weight: 700;
}
.system-msg {
color: #ff6600;
font-style: italic;
}
.system-msg::before {
content: "[SYSTEM]: ";
color: #ff0000;
}
.input-line {
border-top: 1px solid #002200;
padding: 15px 20px;
display: flex;
align-items: center;
background: rgba(0, 8, 0, 0.85);
box-shadow: 0 -2px 12px rgba(0, 255, 0, 0.04);
}
.prompt {
color: #a30000;
font-weight: 700;
margin-right: 10px;
white-space: nowrap;
}
.input-field {
flex: 1;
background: transparent;
border: none;
outline: none;
color: #e5e57a;
font-family: 'Source Code Pro', monospace;
font-size: 14px;
caret-color: #00ff00;
}
.input-field::placeholder { color: rgba(229, 229, 122, 0.35); }
.cursor {
display: inline-block;
width: 10px;
height: 18px;
background: #00ff00;
animation: blink 1s infinite;
margin-left: 2px;
}
@keyframes blink {
50% { opacity: 0; }
}
.loading {
display: none;
color: #ff00ff;
}
.loading::before {
content: "[GHOST_AI]> ";
color: #ff00ff;
}
.loading::after {
content: "...";
animation: dots 1.5s infinite;
}
@keyframes dots {
0%, 20% { content: "..."; }
40% { content: "...."; }
60% { content: "....."; }
80%, 100% { content: "......"; }
}
.ascii-art {
color: #00ff00;
font-family: 'Courier Prime', monospace;
font-size: 10px;
line-height: 1;
white-space: pre;
}
.red { color: #ff0000; }
.green { color: #00ff00; }
.yellow { color: #ffff00; }
.blue { color: #0099ff; }
.magenta { color: #ff00ff; }
.cyan { color: #00ffff; }
.matrix-char {
position: absolute;
font-family: 'Courier Prime', monospace;
font-size: 12px;
color: #00ff00;
animation: fall linear infinite;
}
@keyframes fall {
0% {
transform: translateY(-100vh);
opacity: 1;
}
100% {
transform: translateY(100vh);
opacity: 0;
}
}
.glitch {
animation: glitch 0.3s infinite;
}
@keyframes glitch {
0% { transform: translate(0); }
20% { transform: translate(-2px, 2px); }
40% { transform: translate(-2px, -2px); }
60% { transform: translate(2px, 2px); }
80% { transform: translate(2px, -2px); }
100% { transform: translate(0); }
}
</style>
</head>
<body>
<div class="matrix-bg" id="matrixBg"></div>
<div class="scanlines"></div>
<div class="terminal">
<div class="header">
<div class="terminal-title">
<span>⚡</span>
<span class="glitch">GHOSTHACK ACADEMY</span>
<span>⚡</span>
</div>
<div class="status-bar">
<div class="status-item">
<div class="status-dot"></div>
<span id="statusUser">USER: anon</span>
</div>
<div class="status-item">
<div class="status-dot"></div>
<span id="statusProvider">PROVIDER: Not set</span>
</div>
<div class="status-item">
<div class="status-dot"></div>
<span>
<a class="btn" href="https://www.instagram.com/zoubaire_26" target="_blank" rel="noopener">IG</a>
<a class="btn" href="https://github.com/MOSTRE" target="_blank" rel="noopener">GitHub</a>
<button class="btn" id="btnSettings">Settings</button>
</span>
</div>
</div>
</div>
<div class="terminal-body">
<aside class="roadmap" id="roadmap"></aside>
<div class="chat-panel">
<div class="xp-container">
<div style="display:flex; justify-content:space-between; font-size:12px; margin-bottom:4px;">
<span id="xpLabel">XP: 0</span>
<span id="lessonLabel">Lesson: 1</span>
</div>
<div class="xp-bar"><div class="xp-fill" id="xpFill"></div></div>
</div>
<div class="lesson-controls">
<button class="btn" id="btnTasks">Show tasks</button>
<button class="btn" id="btnComplete">Complete lesson</button>
<button class="btn" id="btnNext">Next lesson</button>
</div>
<div class="output" id="output">
<div class="ascii-art">
██████╗ ██╗ ██╗ ██████╗ ███████╗████████╗ █████╗ ██╗
██╔════╝ ██║ ██║██╔═══██╗██╔════╝╚══██╔══╝ ██╔══██╗██║
██║ ███╗███████║██║ ██║███████╗ ██║ ███████║██║
██║ ██║██╔══██║██║ ██║╚════██║ ██║ ██╔══██║██║
╚██████╔╝██║ ██║╚██████╔╝███████║ ██║ ██║ ██║██║
╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝</div>
<div class="message system-msg">Connection established to DarkNet Node #4471</div>
<div class="message system-msg">Encryption: AES-256 | Proxy: 7-Layer Onion | AI Model: GHOST_AI v3.0</div>
<div class="message system-msg">WARNING: All activities are monitored by AI sentinel</div>
<div class="message ai-response">Welcome to the shadow realm, user. I'm your AI guide through the digital underground. What forbidden knowledge do you seek today?</div>
<div class="loading" id="loading">Decrypting response</div>
</div>
<div class="input-line">
<span class="prompt">root@darknet:~$</span>
<input type="text" class="input-field" id="inputField" autocomplete="off" spellcheck="false" placeholder="Type a question or try: show tasks, complete, next">
<span class="cursor"></span>
</div>
</div>
</div>
</div>
<!-- Settings Modal -->
<div class="modal-backdrop" id="settingsBackdrop"></div>
<div class="modal" id="settingsModal">
<header>Configuration · Identify and set your provider</header>
<div class="content">
<div>
<label for="inputName">Your name</label>
<input id="inputName" type="text" placeholder="e.g., Neo">
</div>
<div>
<label for="selectProvider">Provider</label>
<select id="selectProvider">
<option value="">Choose…</option>
<option value="gemini">Gemini</option>
<option value="openai">OpenAI</option>
</select>
</div>
<div id="geminiKeyRow" style="display:none;">
<label for="inputGemini">Gemini API key</label>
<input id="inputGemini" type="password" placeholder="AIza...">
</div>
<div id="openaiKeyRow" style="display:none;">
<label for="inputOpenAI">OpenAI API key</label>
<input id="inputOpenAI" type="password" placeholder="sk-...">
</div>
</div>
<div class="actions">
<button class="btn" id="btnCancelSettings">Cancel</button>
<button class="btn" id="btnSaveSettings">Save</button>
</div>
</div>
<!-- Providers -->
<script>
const output = document.getElementById('output');
const inputField = document.getElementById('inputField');
const loading = document.getElementById('loading');
const statusUser = document.getElementById('statusUser');
const statusProvider = document.getElementById('statusProvider');
const settingsModal = document.getElementById('settingsModal');
const settingsBackdrop = document.getElementById('settingsBackdrop');
const btnSettings = document.getElementById('btnSettings');
const inputNameEl = document.getElementById('inputName');
const selectProviderEl = document.getElementById('selectProvider');
const geminiKeyRow = document.getElementById('geminiKeyRow');
const openaiKeyRow = document.getElementById('openaiKeyRow');
const inputGeminiEl = document.getElementById('inputGemini');
const inputOpenAIEl = document.getElementById('inputOpenAI');
let messageHistory = [];
// User-configurable settings
const settings = {
name: 'anon',
provider: '', // 'gemini' | 'openai'
geminiKey: '',
openaiKey: ''
};
const GEMINI_MODEL = 'gemini-1.5-flash';
const OPENAI_MODEL = 'gpt-3.5-turbo';
// Teacher persona: Ethical Hacking Mentor
const systemPrompt = `You are GHOST_AI, an ethical hacking mentor and teacher guiding a structured, legal, defensive cybersecurity path. Always:
- Keep the tone supportive, expert, and concise.
- Emphasize ethics, legality, consent, and written authorization.
- Map guidance to the current chapter and lesson.
- Provide practical tasks, tools, and learning checkpoints.
- Offer OPSEC reminders and safe lab setup instructions.
Personality:
- Professional, hacker-savvy, focused on defense and education.
Knowledge Areas:
- Pentesting methodology, recon, exploitation, post-exploitation
- Networking, Linux, scripting, web security, crypto basics
- DFIR, threat modeling, OPSEC, responsible disclosure
Style:
- Use precise technical language, short paragraphs, bullet points when helpful.
- Always include ethical/authorization disclaimer for any offensive technique.
Keep responses under 150 words by default.`;
// Matrix rain effect
function createMatrixRain() {
const chars = '01アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヲン';
const matrixBg = document.getElementById('matrixBg');
for (let i = 0; i < 50; i++) {
const char = document.createElement('div');
char.className = 'matrix-char';
char.textContent = chars[Math.floor(Math.random() * chars.length)];
char.style.left = Math.random() * 100 + '%';
char.style.animationDuration = (Math.random() * 3 + 2) + 's';
char.style.animationDelay = Math.random() * 2 + 's';
matrixBg.appendChild(char);
setTimeout(() => {
char.remove();
}, 5000);
}
}
// Start matrix rain
setInterval(createMatrixRain, 1000);
function loadSettings() {
try {
const raw = localStorage.getItem('eh_settings');
if (raw) Object.assign(settings, JSON.parse(raw));
} catch(_) {}
}
function saveSettings() {
localStorage.setItem('eh_settings', JSON.stringify(settings));
updateStatusBar();
}
function updateStatusBar() {
statusUser.textContent = `USER: ${settings.name || 'anon'}`;
statusProvider.textContent = `PROVIDER: ${settings.provider ? settings.provider.toUpperCase() : 'Not set'}`;
}
function openSettings() {
inputNameEl.value = settings.name || '';
selectProviderEl.value = settings.provider || '';
inputGeminiEl.value = settings.geminiKey || '';
inputOpenAIEl.value = settings.openaiKey || '';
updateKeyRows();
settingsModal.style.display = 'block';
settingsBackdrop.style.display = 'block';
}
function closeSettings() {
settingsModal.style.display = 'none';
settingsBackdrop.style.display = 'none';
}
function updateKeyRows() {
const p = selectProviderEl.value;
geminiKeyRow.style.display = p === 'gemini' ? 'block' : 'none';
openaiKeyRow.style.display = p === 'openai' ? 'block' : 'none';
}
// Curriculum model: 12 chapters x 20 titled lessons (foundational to advanced)
const CHAPTER_COUNT = 12;
const LESSONS_PER_CHAPTER = 20;
const curriculumDefs = [
{ title: 'Foundations & OPSEC', lessons: [
'Intro to Ethical Hacking', 'Legal/Ethics & Authorization', 'Lab Setup: VMs and Networks', 'Linux Essentials for Hackers', 'Networking Basics: TCP/IP, OSI',
'Command Line Mastery', 'Scripting Primer: Bash/Python', 'Version Control & Notes (Git)', 'OPSEC Basics & Threat Modeling', 'Privacy Tools: VPN/Tor Overview',
'Password Hygiene & Managers', 'Secure Communication Basics', 'Virtualization Deep Dive', 'Capture-the-Flag (CTF) Basics', 'Reporting & Documentation',
'Vulnerabilities 101 (CWE/CVE)', 'Common Ports & Services', 'Security Mindset & Methodology', 'Responsible Disclosure Process', 'Career Pathways & Certifications'
]},
{ title: 'Reconnaissance & Intelligence', lessons: [
'Recon Methodology', 'Passive Recon: Search Engines', 'WHOIS, DNS, and Records', 'Subdomain Enumeration', 'Metadata Mining (EXIF, PDFs)',
'Email Enumeration Basics', 'Breach Data & Password Dumps', 'Social Media OSINT', 'Company OSINT & Tech Stack', 'Shodan & Censys Basics',
'Certificate Transparency', 'Web Archive Recon', 'Fingerprinting Servers', 'Network Mapping Strategy', 'Wordlists & Name Generation',
'Automation with Python', 'Recon Data Management', 'Prioritizing Targets', 'Recon Ethics & Scope Control', 'Recon Case Study'
]},
{ title: 'Scanning & Enumeration', lessons: [
'Nmap Fundamentals', 'Port Scanning Strategies', 'Service Enumeration', 'Banner Grabbing', 'UDP & ICMP Considerations',
'Vulnerability Scanners (Nessus/OpenVAS)', 'SMB/LDAP/WinRM Enumeration', 'SNMP Enumeration', 'FTP/SMTP Enumeration', 'Web Service Enumeration',
'Database Enumeration (MySQL/MSSQL)', 'SSH/RDP Enumeration', 'SSL/TLS Scanning', 'Brute Forcing Basics', 'Password Spraying Ethics',
'Automating Enumeration', 'Parsing Scan Results', 'False Positives/Negatives', 'Risk Rating Findings', 'Enumeration Playbook'
]},
{ title: 'Web Application Security I', lessons: [
'HTTP Basics & Proxies', 'Burp Suite Essentials', 'Input Validation & Encoding', 'Authentication Flaws', 'Session Management',
'Access Control (IDOR/BOLA)', 'CSRF Fundamentals', 'XSS (Reflected/Stored/DOM)', 'Clickjacking & UI Redress', 'File Upload Issues',
'Path Traversal', 'Command Injection Basics', 'Insecure Deserialization', 'Security Misconfigurations', 'Logging & Monitoring (WALM)',
'Common Dev Mistakes', 'Secure SDLC & Threat Modeling', 'DAST vs SAST', 'API Security Overview', 'Fixing and Retesting'
]},
{ title: 'Web Application Security II (API/Advanced)', lessons: [
'API Styles & Auth (JWT/OAuth)', 'API Recon & Documentation', 'Broken Object Level Auth', 'Broken Function Level Auth', 'Mass Assignment',
'Rate Limiting & DoS Ethics', 'GraphQL Security Basics', 'File/Path Injection via APIs', 'Business Logic Issues', 'SSRF Fundamentals',
'XXE Basics', 'Template Injection', 'Deserialization Advanced', 'Race Conditions', 'Cache Poisoning Basics',
'CORS & Preflight', 'API Fuzzing', 'Client-side Security (CSP)', 'API Security Testing Workflow', 'API Reporting Checklist'
]},
{ title: 'Wireless & Network Attacks (Defensive Focus)', lessons: [
'Wi-Fi Basics & Encryption', 'Lab-only Wi-Fi Setup', 'Rogue AP Ethics', 'WPA/WPA2 Cracking Lab', 'Evil Twin Concepts',
'Bluetooth/BLE Basics', 'RFID/NFC Overview', 'Network Segmentation', 'IDS/IPS Overview', 'Firewall Fundamentals',
'Secure Network Architecture', 'VPN Tunneling Concepts', 'Zero Trust Basics', '802.1X Overview', 'Wireless Hardening',
'Monitoring Network Traffic', 'Defensive Playbooks', 'Incident Drills', 'Wireless Reporting', 'Legal Constraints Recap'
]},
{ title: 'System Exploitation Basics', lessons: [
'Windows Internals Basics', 'Linux Privilege Model', 'Misconfig Exploits (SUID, PATH)', 'Weak File Permissions', 'Scheduled Tasks/Services',
'Password Cracking Basics', 'Credential Hunting', 'AV/EDR Basics (Defensive)', 'PowerShell Essentials', 'Living-off-the-Land (LOLBAS) Ethics',
'Pivoting Concepts', 'Port Forwarding/Tunneling', 'Enumeration Scripts', 'Post-Exploitation Basics', 'Persistence (Defensive Awareness)',
'Cleanup & Evidence Handling', 'Forensic Anti-patterns (Avoid)', 'Safe Lab Practices', 'Write-up Methodology', 'Exploit Case Study'
]},
{ title: 'Scripting & Tooling for Pentesters', lessons: [
'Python for Security 1', 'Python for Security 2', 'Parsing Data & Reports', 'HTTP Clients & APIs', 'Automating Recon',
'Automating Scanning', 'Simple Fuzzers', 'Wordlist Generation', 'Reporting Automation', 'CLI Tool Packaging',
'Using Docker for Labs', 'CI for Lab Projects', 'Code Quality & Testing', 'Logging & Telemetry', 'Secrets Management',
'Secure Development Basics', 'Publishing Internal Tools', 'Docstrings & READMEs', 'Reproducible Labs', 'Tooling Ethics'
]},
{ title: 'Cloud Security (Intro)', lessons: [
'Cloud Shared Responsibility', 'IAM Basics', 'Storage Misconfigurations', 'Networking in Cloud', 'Serverless Basics',
'Containers & Kubernetes Intro', 'Cloud Recon', 'Cloud Logging & Monitoring', 'Common Cloud Vulns', 'IaC Security Basics',
'Cloud Lab Setup', 'Identity Attacks Overview', 'Key/Secret Handling', 'Cloud Scanning Tools', 'Least Privilege in Practice',
'Cloud Incident Basics', 'Cloud Hardening Basics', 'Cost/Abuse Considerations', 'Responsible Disclosure in Cloud', 'Cloud Case Study'
]},
{ title: 'DFIR & Blue Team Essentials', lessons: [
'Forensics Basics', 'Windows Logs & Artifacts', 'Linux Logs & Artifacts', 'Memory Forensics Intro', 'Disk Forensics Intro',
'Network Forensics Intro', 'Malware Triage Basics', 'Incident Response Process', 'Evidence Handling & Chain of Custody', 'SIEM Basics',
'Detection Engineering Intro', 'Playbooks & Runbooks', 'Threat Intelligence Basics', 'Honeypots Overview', 'Purple Teaming Basics',
'Reporting for IR', 'Lessons Learned Process', 'Legal Liaison Basics', 'Communication During Incidents', 'DFIR Case Study'
]},
{ title: 'Social Engineering (Ethical & Authorized)', lessons: [
'SE Ethics & Authorization', 'Pretext Development', 'Open-Source Recon for SE', 'Payload-less Techniques', 'Phishing Simulations Basics',
'Vishing & Smishing Overview', 'Physical SE Ethics', 'Awareness Training Design', 'Metrics & Measurement', 'Bypassing Training Pitfalls',
'Psychology of Influence Basics', 'Red Flags & Defense', 'Reporting SE Findings', 'Legal Constraints', 'Cultural Sensitivity',
'Executive Briefings', 'Board-Level Reporting', 'SE Program Maturity', 'SE Case Study', 'SE Capstone'
]},
{ title: 'Capstone & Career', lessons: [
'Building a Portfolio', 'CTF Strategy Advanced', 'Writeups and Blogs', 'Public Speaking Basics', 'Networking in the Community',
'Interview Prep (Technical)', 'Interview Prep (Behavioral)', 'Certifications Roadmap', 'Legal & Ethics Revisited', 'Time Management',
'Scoping & Proposals', 'Client Communication', 'Pricing Ethics', 'Freelance vs Employee', 'Career Specializations',
'Continuous Learning Plan', 'Mentorship & Giving Back', 'Capstone Project Plan', 'Capstone Execution', 'Final Review & Next Steps'
]}
];
const curriculum = curriculumDefs.map((ch, cIdx) => ({
id: cIdx + 1,
title: ch.title,
lessons: ch.lessons.map((t, lIdx) => ({
id: lIdx + 1,
title: t,
tasks: [
`Read: ${t}`,
`Lab: Practice ${t}`,
`Quiz: 3 checks on ${t}`
]
}))
}));
// Curated resources per chapter (links, docs, tools)
const resourcesByChapter = {
1: [
{ title: 'NIST SP 800-115 (Technical Guide to Security Testing)', url: 'https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-115.pdf' },
{ title: 'Kali Linux Documentation', url: 'https://www.kali.org/docs/' },
{ title: 'OverTheWire Wargames', url: 'https://overthewire.org/wargames/' },
{ title: 'TryHackMe: Pre-Security Path', url: 'https://tryhackme.com/path/outline/presecurity' },
{ title: 'MITRE CWE & CVE', url: 'https://cwe.mitre.org/' }
],
2: [
{ title: 'OSINT Framework', url: 'https://osintframework.com/' },
{ title: 'Awesome OSINT', url: 'https://github.com/jivoi/awesome-osint' },
{ title: 'Shodan Docs', url: 'https://help.shodan.io/' },
{ title: 'Censys Docs', url: 'https://support.censys.io/hc/en-us' },
{ title: 'Certificate Transparency Search', url: 'https://crt.sh/' }
],
3: [
{ title: 'Nmap Reference Guide (PDF)', url: 'https://nmap.org/book/nmap-refguide.pdf' },
{ title: 'Nmap Book (online)', url: 'https://nmap.org/book/inst-windows.html' },
{ title: 'OpenVAS/Greenbone Docs', url: 'https://greenbone.github.io/docs/latest/' },
{ title: 'SecLists Wordlists', url: 'https://github.com/danielmiessler/SecLists' },
{ title: 'HackTricks Enumeration', url: 'https://book.hacktricks.xyz/' }
],
4: [
{ title: 'OWASP Testing Guide (PDF)', url: 'https://owasp.org/www-project-web-security-testing-guide/stable/OWASP_Testing_Guide_v4.pdf' },
{ title: 'PortSwigger Web Security Academy', url: 'https://portswigger.net/web-security' },
{ title: 'Burp Suite Docs', url: 'https://portswigger.net/burp/documentation' },
{ title: 'OWASP Top 10', url: 'https://owasp.org/www-project-top-ten/' },
{ title: 'Google Gruyere (Web Security Lab)', url: 'https://google-gruyere.appspot.com/' }
],
5: [
{ title: 'OWASP API Security Top 10', url: 'https://owasp.org/www-project-api-security/' },
{ title: 'JWT Handbook', url: 'https://auth0.com/resources/ebooks/jwt-handbook' },
{ title: 'GraphQL Security', url: 'https://lab.wallarm.com/what-is-graphql-security/' },
{ title: 'API Fuzzing with ffuf', url: 'https://github.com/ffuf/ffuf' },
{ title: 'Postman Docs', url: 'https://learning.postman.com/docs/' }
],
6: [
{ title: 'Aircrack-ng Suite', url: 'https://www.aircrack-ng.org/doku.php?id=documentation' },
{ title: 'Wireshark Docs', url: 'https://www.wireshark.org/docs/' },
{ title: 'Bettercap Docs', url: 'https://www.bettercap.org/docs/' },
{ title: '802.11 Wireless Security Overview', url: 'https://wiki.wireshark.org/802.11' },
{ title: 'Zeek Network Security Monitor', url: 'https://docs.zeek.org/en/current/' }
],
7: [
{ title: 'GTFOBins', url: 'https://gtfobins.github.io/' },
{ title: 'LOLBAS', url: 'https://lolbas-project.github.io/' },
{ title: 'HackTricks PrivEsc', url: 'https://book.hacktricks.xyz/windows-hardening' },
{ title: 'BloodHound Docs', url: 'https://bloodhound.readthedocs.io/en/latest/' },
{ title: 'PowerShell Docs', url: 'https://learn.microsoft.com/powershell/' }
],
8: [
{ title: 'Python Security Resources', url: 'https://pypi.org/' },
{ title: 'Requests Library', url: 'https://requests.readthedocs.io/en/latest/' },
{ title: 'Click (CLI) Docs', url: 'https://click.palletsprojects.com/' },
{ title: 'Docker Docs', url: 'https://docs.docker.com/' },
{ title: 'pytest Docs', url: 'https://docs.pytest.org/en/stable/' }
],
9: [
{ title: 'AWS Well-Architected Security Pillar', url: 'https://docs.aws.amazon.com/wellarchitected/latest/security-pillar/welcome.html' },
{ title: 'Azure Security Benchmark', url: 'https://learn.microsoft.com/azure/cloud-adoption-framework/scenarios/cloud-security/azure-security-benchmark' },
{ title: 'GCP Security Foundations', url: 'https://cloud.google.com/architecture/security-foundations' },
{ title: 'Kubernetes Security (NSA/CISA)', url: 'https://media.defense.gov/2022/Aug/29/2003068063/-1/-1/0/CSI_KUBERNETES_HARDENING_GUIDANCE_1.2-REV_20220829.PDF' },
{ title: 'tfsec (IaC Scanner)', url: 'https://aquasecurity.github.io/tfsec/' }
],
10: [
{ title: 'SANS DFIR Whitepapers', url: 'https://www.sans.org/white-papers/dfir/' },
{ title: 'NIST SP 800-61 (Incident Handling)', url: 'https://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-61r2.pdf' },
{ title: 'MITRE ATT&CK', url: 'https://attack.mitre.org/' },
{ title: 'The Hive Project (IR Platform)', url: 'https://thehive-project.org/' },
{ title: 'Sigma Rules', url: 'https://sigmahq.io/' }
],
11: [
{ title: 'Social Engineering Framework', url: 'https://www.social-engineer.org/framework/' },
{ title: 'NIST Phishing Guidance', url: 'https://csrc.nist.gov/publications/detail/ir/8286/final' },
{ title: 'Gophish (Awareness Testing)', url: 'https://getgophish.com/' },
{ title: 'SE Books/References', url: 'https://www.social-engineer.org/books/' },
{ title: 'Ethical Guidelines (ISACA)', url: 'https://www.isaca.org/resources/ethics' }
],
12: [
{ title: 'HackerOne Disclosure Guidelines', url: 'https://www.hackerone.com/disclosure-guidelines' },
{ title: 'Bugcrowd Resources', url: 'https://www.bugcrowd.com/resources/' },
{ title: 'OWASP Projects', url: 'https://owasp.org/projects/' },
{ title: 'Write-Up Examples (Medium Tag)', url: 'https://medium.com/tag/bug-bounty' },
{ title: 'Public Speaking Tips (Toastmasters)', url: 'https://www.toastmasters.org/resources/public-speaking-tips' }
]
};
// Progress state
const state = {
chapter: 1,
lesson: 1,
completed: {},
xp: 0
};
function loadState() {
try {
const raw = localStorage.getItem('eh_progress');
if (raw) {
const s = JSON.parse(raw);
Object.assign(state, s);
}
} catch (_) {}
}
function saveState() {
localStorage.setItem('eh_progress', JSON.stringify(state));
}
function lessonKey(c, l) { return `c${c}-l${l}`; }
function awardXP(points) {
state.xp = Math.max(0, state.xp + points);
saveState();
renderXP();
}
function completeCurrentLesson() {
const key = lessonKey(state.chapter, state.lesson);
state.completed[key] = true;
awardXP(10);
saveState();
renderRoadmap();
}
function nextLesson() {
if (state.lesson < LESSONS_PER_CHAPTER) {
state.lesson += 1;
} else if (state.chapter < CHAPTER_COUNT) {
state.chapter += 1;
state.lesson = 1;
}
saveState();
renderRoadmap();
renderLabels();
}
function renderXP() {
const xpFill = document.getElementById('xpFill');
const xpLabel = document.getElementById('xpLabel');
const pct = Math.min(100, (state.xp % 100));
xpFill.style.width = pct + '%';
xpLabel.textContent = `XP: ${state.xp}`;
}
function renderLabels() {
const lessonLabel = document.getElementById('lessonLabel');
lessonLabel.textContent = `Chapter ${state.chapter} · Lesson ${state.lesson}`;
}
function renderRoadmap() {
const roadmap = document.getElementById('roadmap');
roadmap.innerHTML = '<h3>Ethical Hacking Roadmap</h3>';
curriculum.forEach(ch => {
const chDiv = document.createElement('div');
chDiv.className = 'chapter';
chDiv.innerHTML = `<div class="chapter-title">${ch.title}</div>`;
ch.lessons.forEach(ls => {
const key = lessonKey(ch.id, ls.id);
const item = document.createElement('div');
item.className = 'lesson-item';
if (state.chapter === ch.id && state.lesson === ls.id) item.classList.add('active');
if (state.completed[key]) item.classList.add('completed');
item.textContent = `L${ls.id}: ${ls.title}`;
item.onclick = () => { state.chapter = ch.id; state.lesson = ls.id; saveState(); renderRoadmap(); renderLabels(); };
chDiv.appendChild(item);
});
roadmap.appendChild(chDiv);
});
// Auto-scroll to active lesson for better UX
setTimeout(() => {
const active = roadmap.querySelector('.lesson-item.active');
if (active) {
const rect = active.getBoundingClientRect();
const parentRect = roadmap.getBoundingClientRect();
if (rect.top < parentRect.top || rect.bottom > parentRect.bottom) {
roadmap.scrollTop = active.offsetTop - roadmap.clientHeight / 2;
}
}
}, 0);
}
function getCurrentLessonContext() {
const ch = curriculum[state.chapter - 1];
const ls = ch.lessons[state.lesson - 1];
return { chapter: ch, lesson: ls };
}
function showTasks() {
const { chapter, lesson } = getCurrentLessonContext();
const tasks = lesson.tasks.map((t, i) => `- [ ] ${t}`).join('\n');
const res = resourcesByChapter[chapter.id] || [];
const links = res.map(r => `- ${r.title}: ${r.url}`).join('\n');
const resourcesBlock = links ? `\nResources:\n${links}` : '';
addMessage(`Chapter ${chapter.id} · ${chapter.title}\n${lesson.title}\nTasks:\n${tasks}${resourcesBlock}`, 'system');
}
// Initialize UI
loadState();
renderRoadmap();
renderLabels();
renderXP();
loadSettings();
updateStatusBar();
async function sendWithGemini(messages) {
const key = settings.geminiKey;
if (!key) throw new Error('Missing Gemini API key');
const systemMessage = messages.find(m => m.role === 'system');
const nonSystem = messages.filter(m => m.role !== 'system');
const contents = nonSystem.map(m => ({
role: m.role === 'assistant' ? 'model' : 'user',
parts: [{ text: m.content }]
}));
const body = {
contents: contents,
generationConfig: {
temperature: 0.8
}
};
if (systemMessage) {
body.systemInstruction = {
role: 'system',
parts: [{ text: systemMessage.content }]
};
}
const resp = await fetch(`https://generativelanguage.googleapis.com/v1beta/models/${GEMINI_MODEL}:generateContent?key=${encodeURIComponent(key)}`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body)
});
if (!resp.ok) {
const errText = await resp.text();
throw new Error(`Gemini HTTP ${resp.status}: ${errText}`);
}
const data = await resp.json();
const text = data && data.candidates && data.candidates[0] && data.candidates[0].content && data.candidates[0].content.parts && data.candidates[0].content.parts[0] && data.candidates[0].content.parts[0].text ? data.candidates[0].content.parts[0].text : '';
if (!text) {
throw new Error('Gemini returned empty response');
}
return text;
}
async function sendWithOpenAI(messages) {
const key = settings.openaiKey;
if (!key) throw new Error('Missing OpenAI API key');
const resp = await fetch('https://api.openai.com/v1/chat/completions', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${key}`
},
body: JSON.stringify({
model: OPENAI_MODEL,
messages,
temperature: 0.8
})
});
if (!resp.ok) {
const errText = await resp.text();
throw new Error(`OpenAI HTTP ${resp.status}: ${errText}`);
}
const data = await resp.json();
return data.choices && data.choices[0] && data.choices[0].message && data.choices[0].message.content ? data.choices[0].message.content : '';
}
async function processCommand() {
const command = inputField.value.trim();
if (!command) return;
// Add user input to output
addMessage(command, 'user');
inputField.value = '';
// Show loading
showLoading(true);
try {
// Prepare lesson-aware system message