-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathgraph.html
More file actions
935 lines (858 loc) · 38 KB
/
graph.html
File metadata and controls
935 lines (858 loc) · 38 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
---
layout: null
title: Knowledge Graph
permalink: /graph/
---
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTB Knowledge Graph - Interactive Machine & Technique Map</title>
<script src="https://d3js.org/d3.v7.min.js"></script>
<style>
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: #1e1e2e;
color: #cdd6f4;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
overflow: hidden;
height: 100vh;
width: 100vw;
}
/* ---- HEADER ---- */
#header {
position: fixed;
top: 0; left: 0; right: 0;
height: 56px;
background: #181825;
border-bottom: 2px solid #9fef00;
display: flex;
align-items: center;
padding: 0 24px;
z-index: 100;
gap: 16px;
}
#header h1 {
font-size: 18px;
font-weight: 700;
color: #9fef00;
white-space: nowrap;
letter-spacing: 0.5px;
}
#header .subtitle {
font-size: 12px;
color: #6c7086;
margin-left: 4px;
}
#header .stats {
margin-left: auto;
font-size: 12px;
color: #a6adc8;
display: flex;
gap: 16px;
}
#header .stats span { color: #9fef00; font-weight: 600; }
#back-link {
color: #9fef00;
text-decoration: none;
font-size: 13px;
border: 1px solid #9fef0044;
padding: 4px 12px;
border-radius: 4px;
transition: background 0.2s;
}
#back-link:hover { background: #9fef0022; }
/* ---- SIDEBAR / FILTER PANEL ---- */
#sidebar {
position: fixed;
top: 56px; left: 0; bottom: 0;
width: 280px;
background: #181825;
border-right: 1px solid #313244;
padding: 16px;
overflow-y: auto;
z-index: 90;
transition: transform 0.3s ease;
}
#sidebar.collapsed { transform: translateX(-280px); }
#sidebar h3 {
font-size: 11px;
text-transform: uppercase;
letter-spacing: 1.2px;
color: #9fef00;
margin: 16px 0 8px 0;
padding-bottom: 4px;
border-bottom: 1px solid #313244;
}
#sidebar h3:first-child { margin-top: 0; }
#search-box {
width: 100%;
padding: 8px 12px;
background: #11111b;
border: 1px solid #313244;
border-radius: 6px;
color: #cdd6f4;
font-size: 13px;
outline: none;
transition: border-color 0.2s;
}
#search-box:focus { border-color: #9fef00; }
#search-box::placeholder { color: #585b70; }
.filter-group { margin-bottom: 4px; }
.filter-group label {
display: flex;
align-items: center;
gap: 8px;
padding: 4px 0;
font-size: 13px;
cursor: pointer;
color: #bac2de;
transition: color 0.15s;
}
.filter-group label:hover { color: #cdd6f4; }
.filter-group input[type="checkbox"] {
accent-color: #9fef00;
width: 14px;
height: 14px;
cursor: pointer;
}
.color-dot {
width: 10px; height: 10px;
border-radius: 50%;
display: inline-block;
flex-shrink: 0;
}
#toggle-sidebar {
position: fixed;
top: 64px; left: 280px;
z-index: 95;
background: #181825;
border: 1px solid #313244;
border-left: none;
color: #9fef00;
padding: 8px 6px;
cursor: pointer;
border-radius: 0 6px 6px 0;
font-size: 14px;
transition: left 0.3s ease;
}
#toggle-sidebar.shifted { left: 0; }
/* ---- LEGEND ---- */
#legend {
position: fixed;
bottom: 16px; right: 16px;
background: #181825ee;
border: 1px solid #313244;
border-radius: 8px;
padding: 12px 16px;
z-index: 90;
font-size: 12px;
}
#legend h4 {
color: #9fef00;
font-size: 11px;
text-transform: uppercase;
letter-spacing: 1px;
margin-bottom: 8px;
}
.legend-item {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 4px;
color: #a6adc8;
}
.legend-circle {
width: 12px; height: 12px;
border-radius: 50%;
flex-shrink: 0;
}
.legend-diamond {
width: 12px; height: 12px;
flex-shrink: 0;
transform: rotate(45deg);
}
.legend-star {
width: 12px; height: 12px;
flex-shrink: 0;
background: #f9e2af;
clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
/* ---- TOOLTIP ---- */
#tooltip {
position: fixed;
pointer-events: none;
background: #181825f0;
border: 1px solid #9fef0066;
border-radius: 8px;
padding: 12px 16px;
font-size: 13px;
max-width: 320px;
z-index: 200;
opacity: 0;
transition: opacity 0.15s;
backdrop-filter: blur(8px);
box-shadow: 0 4px 20px #00000066;
}
#tooltip.visible { opacity: 1; }
#tooltip .tt-name {
font-weight: 700;
font-size: 15px;
margin-bottom: 6px;
}
#tooltip .tt-row {
display: flex;
gap: 6px;
margin-bottom: 2px;
color: #a6adc8;
}
#tooltip .tt-label { color: #6c7086; min-width: 80px; }
#tooltip .tt-techniques {
margin-top: 6px;
display: flex;
flex-wrap: wrap;
gap: 4px;
}
#tooltip .tt-tag {
background: #31324488;
border: 1px solid #45475a;
border-radius: 4px;
padding: 2px 6px;
font-size: 11px;
color: #89dceb;
}
/* ---- SVG CANVAS ---- */
#graph-container {
position: fixed;
top: 56px; left: 280px; right: 0; bottom: 0;
transition: left 0.3s ease;
}
#graph-container.expanded { left: 0; }
#graph-container svg { width: 100%; height: 100%; display: block; }
/* ---- NODE STYLES ---- */
.node { cursor: pointer; }
.node text {
font-size: 10px;
fill: #cdd6f4;
pointer-events: none;
text-anchor: middle;
dominant-baseline: central;
}
.link {
stroke-opacity: 0.25;
transition: stroke-opacity 0.2s;
}
.link.highlighted { stroke-opacity: 0.8; }
.node.dimmed circle,
.node.dimmed rect,
.node.dimmed polygon { opacity: 0.1; }
.node.dimmed text { opacity: 0.1; }
.link.dimmed { stroke-opacity: 0.03; }
/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
#sidebar { width: 240px; }
#toggle-sidebar { left: 240px; }
#graph-container { left: 0; }
#sidebar { transform: translateX(-240px); }
#toggle-sidebar { left: 0; }
#header h1 { font-size: 14px; }
#header .subtitle { display: none; }
#legend { bottom: 8px; right: 8px; padding: 8px 12px; }
}
/* scrollbar */
#sidebar::-webkit-scrollbar { width: 6px; }
#sidebar::-webkit-scrollbar-track { background: transparent; }
#sidebar::-webkit-scrollbar-thumb { background: #313244; border-radius: 3px; }
#sidebar::-webkit-scrollbar-thumb:hover { background: #45475a; }
</style>
</head>
<body>
<!-- HEADER -->
<div id="header">
<a id="back-link" href="/htb-writeups/">Back to Writeups</a>
<h1>HTB Knowledge Graph</h1>
<span class="subtitle">Interactive Machine & Technique Map</span>
<div class="stats">
<div>Machines: <span id="stat-machines">0</span></div>
<div>Techniques: <span id="stat-techniques">0</span></div>
<div>Connections: <span id="stat-links">0</span></div>
</div>
</div>
<!-- SIDEBAR -->
<button id="toggle-sidebar" title="Toggle filter panel">☰</button>
<div id="sidebar">
<h3>Search</h3>
<input type="text" id="search-box" placeholder="Search machines...">
<h3>Difficulty</h3>
<div class="filter-group" id="filter-difficulty">
<label><input type="checkbox" value="Easy" checked><span class="color-dot" style="background:#a6e3a1"></span> Easy</label>
<label><input type="checkbox" value="Medium" checked><span class="color-dot" style="background:#fab387"></span> Medium</label>
<label><input type="checkbox" value="Hard" checked><span class="color-dot" style="background:#f38ba8"></span> Hard</label>
<label><input type="checkbox" value="Insane" checked><span class="color-dot" style="background:#cba6f7"></span> Insane</label>
</div>
<h3>Operating System</h3>
<div class="filter-group" id="filter-os">
<label><input type="checkbox" value="Linux" checked> Linux</label>
<label><input type="checkbox" value="Windows" checked> Windows</label>
</div>
<h3>Node Types</h3>
<div class="filter-group" id="filter-types">
<label><input type="checkbox" value="machine" checked> Machines</label>
<label><input type="checkbox" value="technique" checked><span class="color-dot" style="background:#89dceb"></span> Techniques</label>
<label><input type="checkbox" value="certification" checked><span class="color-dot" style="background:#f9e2af"></span> Certifications</label>
</div>
<h3>Technique Categories</h3>
<div class="filter-group" id="filter-technique-cat"></div>
</div>
<!-- TOOLTIP -->
<div id="tooltip">
<div class="tt-name"></div>
<div class="tt-details"></div>
</div>
<!-- LEGEND -->
<div id="legend">
<h4>Legend</h4>
<div class="legend-item"><div class="legend-circle" style="background:#a6e3a1"></div> Easy Machine</div>
<div class="legend-item"><div class="legend-circle" style="background:#fab387"></div> Medium Machine</div>
<div class="legend-item"><div class="legend-circle" style="background:#f38ba8"></div> Hard Machine</div>
<div class="legend-item"><div class="legend-circle" style="background:#cba6f7"></div> Insane Machine</div>
<div class="legend-item"><div class="legend-diamond" style="background:#89dceb"></div> Technique</div>
<div class="legend-item"><div class="legend-star"></div> Certification</div>
</div>
<!-- GRAPH CONTAINER -->
<div id="graph-container"></div>
<script>
// ===========================================================================
// DATA
// ===========================================================================
const baseUrl = "/htb-writeups";
const DIFFICULTY_COLORS = {
"Easy": "#a6e3a1",
"Medium": "#fab387",
"Hard": "#f38ba8",
"Insane": "#cba6f7"
};
const TECHNIQUE_COLOR = "#89dceb";
const CERT_COLOR = "#f9e2af";
const TECHNIQUE_CATEGORIES = {
"Web": ["SQL Injection", "XSS", "SSRF", "SSTI", "LFI/RFI", "Command Injection", "File Upload", "Deserialization", "XXE", "Web Shell"],
"Active Directory": ["Kerberoasting", "AS-REP Roasting", "DCSync", "ADCS", "Pass-the-Hash", "BloodHound", "Constrained Delegation", "RBCD", "Password Spraying"],
"Privilege Escalation": ["Token Impersonation", "JuicyPotato", "Kernel Exploit", "Sudo Abuse", "Cron Abuse", "SUID/Capability", "GTFOBins", "Buffer Overflow"],
"Network": ["Phishing", "Pivoting", "Port Forwarding", "DNS Exploitation", "SNMP", "LDAP", "SMB/Samba", "FTP", "Redis"],
"Services": ["Default Credentials", "Jenkins", "Tomcat", "WordPress", "Drupal", "ColdFusion"]
};
const machines = [
// ---- EASY ----
{ name: "Lame", os: "Linux", difficulty: "Easy", techniques: ["SMB/Samba"], writeup: "https://0xdf.gitlab.io/2020/04/07/htb-lame.html" },
{ name: "Legacy", os: "Windows", difficulty: "Easy", techniques: ["SMB/Samba"], writeup: "https://0xdf.gitlab.io/2019/02/21/htb-legacy.html" },
{ name: "Blue", os: "Windows", difficulty: "Easy", techniques: ["SMB/Samba"], writeup: "https://0xdf.gitlab.io/2021/05/11/htb-blue.html" },
{ name: "Devel", os: "Windows", difficulty: "Easy", techniques: ["FTP", "File Upload", "Web Shell", "Kernel Exploit"], writeup: "https://0xdf.gitlab.io/2019/03/05/htb-devel.html" },
{ name: "Optimum", os: "Windows", difficulty: "Easy", techniques: ["Kernel Exploit"], writeup: "https://0xdf.gitlab.io/2021/03/17/htb-optimum.html" },
{ name: "Shocker", os: "Linux", difficulty: "Easy", techniques: ["Command Injection"], writeup: "https://0xdf.gitlab.io/2021/05/25/htb-shocker.html" },
{ name: "Nibbles", os: "Linux", difficulty: "Easy", techniques: ["File Upload", "Sudo Abuse"], writeup: "https://0xdf.gitlab.io/2018/06/30/htb-nibbles.html" },
{ name: "Bashed", os: "Linux", difficulty: "Easy", techniques: ["Web Shell", "Cron Abuse"], writeup: "https://0xdf.gitlab.io/2018/04/29/htb-bashed.html" },
{ name: "Valentine", os: "Linux", difficulty: "Easy", techniques: [], writeup: "https://0xdf.gitlab.io/2018/07/28/htb-valentine.html" },
{ name: "Arctic", os: "Windows", difficulty: "Easy", techniques: ["ColdFusion", "JuicyPotato"], writeup: "https://0xdf.gitlab.io/2020/05/19/htb-arctic.html" },
{ name: "Grandpa", os: "Windows", difficulty: "Easy", techniques: ["Token Impersonation"], writeup: "https://0xdf.gitlab.io/2020/05/28/htb-grandpa.html" },
{ name: "Jerry", os: "Windows", difficulty: "Easy", techniques: ["Tomcat", "Default Credentials"], writeup: "https://0xdf.gitlab.io/2018/11/17/htb-jerry.html" },
{ name: "Active", os: "Windows", difficulty: "Easy", techniques: ["Kerberoasting"], writeup: "https://0xdf.gitlab.io/2018/12/08/htb-active.html" },
{ name: "Forest", os: "Windows", difficulty: "Easy", techniques: ["AS-REP Roasting", "DCSync", "BloodHound"], writeup: "https://0xdf.gitlab.io/2020/03/21/htb-forest.html" },
{ name: "Sauna", os: "Windows", difficulty: "Easy", techniques: ["AS-REP Roasting"], writeup: "https://0xdf.gitlab.io/2020/07/18/htb-sauna.html" },
{ name: "Buff", os: "Windows", difficulty: "Easy", techniques: ["Buffer Overflow"], writeup: "https://0xdf.gitlab.io/2020/11/21/htb-buff.html" },
{ name: "Love", os: "Windows", difficulty: "Easy", techniques: ["SSRF"], writeup: "https://0xdf.gitlab.io/2021/08/07/htb-love.html" },
{ name: "Cap", os: "Linux", difficulty: "Easy", techniques: ["SUID/Capability"], writeup: "https://0xdf.gitlab.io/2021/10/02/htb-cap.html" },
{ name: "Knife", os: "Linux", difficulty: "Easy", techniques: ["GTFOBins"], writeup: "https://0xdf.gitlab.io/2021/08/28/htb-knife.html" },
{ name: "Netmon", os: "Windows", difficulty: "Easy", techniques: ["FTP", "Default Credentials"], writeup: "https://0xdf.gitlab.io/2019/06/29/htb-netmon.html" },
{ name: "Irked", os: "Linux", difficulty: "Easy", techniques: [], writeup: "https://0xdf.gitlab.io/2019/04/27/htb-irked.html" },
{ name: "Beep", os: "Linux", difficulty: "Easy", techniques: ["LFI/RFI", "Command Injection"], writeup: "https://0xdf.gitlab.io/2021/02/23/htb-beep.html" },
{ name: "Blocky", os: "Linux", difficulty: "Easy", techniques: ["Sudo Abuse"], writeup: "https://0xdf.gitlab.io/2020/06/30/htb-blocky.html" },
{ name: "Mirai", os: "Linux", difficulty: "Easy", techniques: ["Default Credentials"], writeup: "https://0xdf.gitlab.io/2022/05/18/htb-mirai.html" },
{ name: "Sense", os: "FreeBSD", difficulty: "Easy", techniques: [], writeup: "https://0xdf.gitlab.io/2021/03/11/htb-sense.html" },
{ name: "Traverxec", os: "Linux", difficulty: "Easy", techniques: [], writeup: "https://0xdf.gitlab.io/2020/04/11/htb-traverxec.html" },
{ name: "Postman", os: "Linux", difficulty: "Easy", techniques: ["Redis"], writeup: "https://0xdf.gitlab.io/2020/03/14/htb-postman.html" },
{ name: "OpenAdmin", os: "Linux", difficulty: "Easy", techniques: ["GTFOBins"], writeup: "https://0xdf.gitlab.io/2020/05/02/htb-openadmin.html" },
{ name: "Traceback", os: "Linux", difficulty: "Easy", techniques: ["Web Shell"], writeup: "https://0xdf.gitlab.io/2020/08/15/htb-traceback.html" },
// ---- MEDIUM ----
{ name: "Cronos", os: "Linux", difficulty: "Medium", techniques: ["DNS Exploitation", "SQL Injection", "Cron Abuse"], writeup: "https://0xdf.gitlab.io/2020/04/14/htb-cronos.html" },
{ name: "SolidState", os: "Linux", difficulty: "Medium", techniques: ["Cron Abuse"], writeup: "https://0xdf.gitlab.io/2020/04/30/htb-solidstate.html" },
{ name: "Poison", os: "FreeBSD", difficulty: "Medium", techniques: ["LFI/RFI", "Port Forwarding"], writeup: "https://0xdf.gitlab.io/2018/09/08/htb-poison.html" },
{ name: "Bastard", os: "Windows", difficulty: "Medium", techniques: ["Drupal", "JuicyPotato"], writeup: "https://0xdf.gitlab.io/2019/03/12/htb-bastard.html" },
{ name: "Bounty", os: "Windows", difficulty: "Easy", techniques: ["File Upload", "JuicyPotato"], writeup: "https://0xdf.gitlab.io/2018/10/27/htb-bounty.html" },
{ name: "Jeeves", os: "Windows", difficulty: "Medium", techniques: ["Jenkins"], writeup: "https://0xdf.gitlab.io/2022/04/14/htb-jeeves.html" },
{ name: "Conceal", os: "Windows", difficulty: "Hard", techniques: ["SNMP", "JuicyPotato"], writeup: "https://0xdf.gitlab.io/2019/05/18/htb-conceal.html" },
{ name: "DevOops", os: "Linux", difficulty: "Medium", techniques: ["XXE"], writeup: "https://0xdf.gitlab.io/2018/10/13/htb-devoops.html" },
{ name: "Monteverde", os: "Windows", difficulty: "Medium", techniques: ["Password Spraying"], writeup: "https://0xdf.gitlab.io/2020/06/13/htb-monteverde.html" },
{ name: "Resolute", os: "Windows", difficulty: "Medium", techniques: ["DNS Exploitation"], writeup: "https://0xdf.gitlab.io/2020/05/30/htb-resolute.html" },
{ name: "Cascade", os: "Windows", difficulty: "Medium", techniques: ["LDAP"], writeup: "https://0xdf.gitlab.io/2020/07/25/htb-cascade.html" },
{ name: "Intelligence", os: "Windows", difficulty: "Medium", techniques: ["DNS Exploitation", "Constrained Delegation"], writeup: "https://0xdf.gitlab.io/2021/11/27/htb-intelligence.html" },
{ name: "StreamIO", os: "Windows", difficulty: "Medium", techniques: ["SQL Injection", "LDAP"], writeup: "https://0xdf.gitlab.io/2022/09/17/htb-streamio.html" },
{ name: "Escape", os: "Windows", difficulty: "Medium", techniques: ["ADCS"], writeup: "https://0xdf.gitlab.io/2023/06/17/htb-escape.html" },
{ name: "Sniper", os: "Windows", difficulty: "Medium", techniques: ["LFI/RFI"], writeup: "https://0xdf.gitlab.io/2020/03/28/htb-sniper.html" },
{ name: "Worker", os: "Windows", difficulty: "Medium", techniques: [], writeup: "https://0xdf.gitlab.io/2021/01/30/htb-worker.html" },
{ name: "Atom", os: "Windows", difficulty: "Medium", techniques: [], writeup: "https://0xdf.gitlab.io/2021/07/10/htb-atom.html" },
{ name: "Pit", os: "Linux", difficulty: "Medium", techniques: ["SNMP"], writeup: "https://0xdf.gitlab.io/2021/09/25/htb-pit.html" },
{ name: "Pikaboo", os: "Linux", difficulty: "Hard", techniques: ["LDAP"], writeup: "https://0xdf.gitlab.io/2021/12/04/htb-pikaboo.html" },
{ name: "Pandora", os: "Linux", difficulty: "Easy", techniques: ["SNMP", "SQL Injection"], writeup: "https://0xdf.gitlab.io/2022/05/21/htb-pandora.html" },
{ name: "Late", os: "Linux", difficulty: "Easy", techniques: ["SSTI"], writeup: "https://0xdf.gitlab.io/2022/07/30/htb-late.html" },
{ name: "Awkward", os: "Linux", difficulty: "Medium", techniques: ["SSRF"], writeup: "https://0xdf.gitlab.io/2023/02/25/htb-awkward.html" },
// ---- HARD ----
{ name: "Reel", os: "Windows", difficulty: "Hard", techniques: ["Phishing"], writeup: "https://0xdf.gitlab.io/2018/11/10/htb-reel.html" },
{ name: "Mantis", os: "Windows", difficulty: "Hard", techniques: ["Kerberoasting"], writeup: "https://0xdf.gitlab.io/2020/09/03/htb-mantis.html" },
{ name: "Sizzle", os: "Windows", difficulty: "Insane", techniques: ["ADCS", "Kerberoasting"], writeup: "https://0xdf.gitlab.io/2019/06/01/htb-sizzle.html" },
{ name: "Multimaster", os: "Windows", difficulty: "Insane", techniques: ["SQL Injection", "BloodHound"], writeup: "https://0xdf.gitlab.io/2020/09/19/htb-multimaster.html" },
{ name: "APT", os: "Windows", difficulty: "Insane", techniques: [], writeup: "https://0xdf.gitlab.io/2021/04/10/htb-apt.html" },
{ name: "Blackfield", os: "Windows", difficulty: "Hard", techniques: ["AS-REP Roasting"], writeup: "https://0xdf.gitlab.io/2020/10/03/htb-blackfield.html" },
{ name: "Object", os: "Windows", difficulty: "Hard", techniques: ["BloodHound"], writeup: "https://0xdf.gitlab.io/2022/02/28/htb-object.html" },
{ name: "Cerberus", os: "Windows", difficulty: "Hard", techniques: ["ADCS"], writeup: "https://0xdf.gitlab.io/2023/07/29/htb-cerberus.html" },
{ name: "Rebound", os: "Windows", difficulty: "Insane", techniques: ["Kerberoasting", "RBCD"], writeup: "https://0xdf.gitlab.io/2024/03/30/htb-rebound.html" },
{ name: "Hathor", os: "Windows", difficulty: "Insane", techniques: [], writeup: "https://0xdf.gitlab.io/2022/11/19/htb-hathor.html" },
{ name: "Anubis", os: "Windows", difficulty: "Insane", techniques: ["ADCS"], writeup: "https://0xdf.gitlab.io/2022/01/29/htb-anubis.html" },
{ name: "Search", os: "Windows", difficulty: "Hard", techniques: ["Kerberoasting"], writeup: "https://0xdf.gitlab.io/2022/04/30/htb-search.html" },
{ name: "Absolute", os: "Windows", difficulty: "Insane", techniques: ["LDAP", "BloodHound"], writeup: "https://0xdf.gitlab.io/2023/05/27/htb-absolute.html" },
{ name: "Vintage", os: "Windows", difficulty: "Hard", techniques: ["Kerberoasting"], writeup: "https://0xdf.gitlab.io/2025/04/26/htb-vintage.html" },
{ name: "Certificate", os: "Windows", difficulty: "Hard", techniques: ["ADCS"], writeup: "https://0xdf.gitlab.io/2025/10/04/htb-certificate.html" },
// ---- INSANE ----
{ name: "Sink", os: "Linux", difficulty: "Insane", techniques: ["SSRF"], writeup: "https://0xdf.gitlab.io/2021/09/18/htb-sink.html" },
{ name: "Response", os: "Linux", difficulty: "Insane", techniques: ["SSRF"], writeup: "https://0xdf.gitlab.io/2023/02/04/htb-response.html" },
{ name: "Sekhmet", os: "Windows", difficulty: "Insane", techniques: ["ADCS"], writeup: "https://0xdf.gitlab.io/2023/04/01/htb-sekhmet.html" },
{ name: "Fulcrum", os: "Linux", difficulty: "Insane", techniques: ["XXE", "Pivoting"], writeup: "https://0xdf.gitlab.io/2022/05/11/htb-fulcrum.html" },
{ name: "Stacked", os: "Linux", difficulty: "Insane", techniques: ["XSS"], writeup: "https://0xdf.gitlab.io/2022/03/19/htb-stacked.html" }
];
const techniqueList = [
"SQL Injection", "XSS", "SSRF", "SSTI", "LFI/RFI", "Command Injection",
"File Upload", "Deserialization", "XXE", "Kerberoasting", "AS-REP Roasting",
"DCSync", "ADCS", "Pass-the-Hash", "BloodHound", "Constrained Delegation",
"RBCD", "Token Impersonation", "JuicyPotato", "Kernel Exploit", "Sudo Abuse",
"Cron Abuse", "SUID/Capability", "GTFOBins", "Buffer Overflow", "Phishing",
"Pivoting", "Port Forwarding", "Password Spraying", "Default Credentials",
"Web Shell", "DNS Exploitation", "SNMP", "LDAP", "SMB/Samba", "FTP",
"Redis", "Jenkins", "Tomcat", "WordPress", "Drupal", "ColdFusion"
];
const certifications = [
{ name: "OSCP", machines: [
"Lame","Legacy","Blue","Devel","Optimum","Shocker","Nibbles","Bashed","Valentine",
"Arctic","Grandpa","Jerry","Active","Forest","Sauna","Buff","Love","Cap","Knife",
"Netmon","Irked","Beep","Blocky","Mirai","Sense","Traverxec","Postman","OpenAdmin",
"Traceback","Cronos","SolidState","Poison","Bastard","Bounty","Jeeves","Conceal",
"DevOops","Monteverde","Resolute","Cascade"
]},
{ name: "CPTS", machines: [
"Active","Forest","Sauna","Monteverde","Resolute","Cascade","Intelligence",
"StreamIO","Escape","Multimaster","Blackfield","Object","Cerberus","Rebound",
"Search","Absolute","Vintage","Certificate"
]},
{ name: "CRTO", machines: ["Reel","Mantis","Sizzle","Multimaster","APT"] },
{ name: "CRTE", machines: ["Blackfield","Multimaster","Object","Cerberus","Rebound"] },
{ name: "eWPT", machines: [
"Cronos","DevOops","Pikaboo","Late","Awkward","Sniper","Bastard",
"Love","Shocker","Beep","Stacked","Sink","Response"
]}
];
// ===========================================================================
// BUILD GRAPH DATA
// ===========================================================================
const nodes = [];
const links = [];
const nodeMap = {};
// Machine nodes
machines.forEach(m => {
const id = "machine:" + m.name;
const node = {
id, name: m.name, type: "machine", os: m.os,
difficulty: m.difficulty, techniques: m.techniques,
color: DIFFICULTY_COLORS[m.difficulty],
url: m.writeup || (baseUrl + "/machines/" + m.difficulty.toLowerCase() + "/" + m.name + "/"),
radius: 10
};
nodes.push(node);
nodeMap[id] = node;
});
// Technique nodes
techniqueList.forEach(t => {
const id = "technique:" + t;
let cat = "Other";
for (const [c, list] of Object.entries(TECHNIQUE_CATEGORIES)) {
if (list.includes(t)) { cat = c; break; }
}
const node = {
id, name: t, type: "technique", category: cat,
color: TECHNIQUE_COLOR, radius: 8
};
nodes.push(node);
nodeMap[id] = node;
});
// Certification nodes
certifications.forEach(c => {
const id = "cert:" + c.name;
const node = {
id, name: c.name, type: "certification",
color: CERT_COLOR, radius: 14
};
nodes.push(node);
nodeMap[id] = node;
});
// Machine -> Technique links
machines.forEach(m => {
m.techniques.forEach(t => {
const src = "machine:" + m.name;
const tgt = "technique:" + t;
if (nodeMap[src] && nodeMap[tgt]) {
links.push({ source: src, target: tgt, type: "machine-technique" });
}
});
});
// Certification -> Machine links
certifications.forEach(c => {
c.machines.forEach(mName => {
const src = "cert:" + c.name;
const tgt = "machine:" + mName;
if (nodeMap[src] && nodeMap[tgt]) {
links.push({ source: src, target: tgt, type: "cert-machine" });
}
});
});
// ===========================================================================
// STATS
// ===========================================================================
document.getElementById("stat-machines").textContent = machines.length;
document.getElementById("stat-techniques").textContent = techniqueList.length;
document.getElementById("stat-links").textContent = links.length;
// ===========================================================================
// POPULATE TECHNIQUE CATEGORY FILTERS
// ===========================================================================
const techCatContainer = document.getElementById("filter-technique-cat");
Object.keys(TECHNIQUE_CATEGORIES).concat(["Other"]).forEach(cat => {
const label = document.createElement("label");
const cb = document.createElement("input");
cb.type = "checkbox"; cb.value = cat; cb.checked = true;
label.appendChild(cb);
label.appendChild(document.createTextNode(" " + cat));
techCatContainer.appendChild(label);
});
// ===========================================================================
// D3 FORCE GRAPH
// ===========================================================================
const container = document.getElementById("graph-container");
const width = container.clientWidth;
const height = container.clientHeight;
const svg = d3.select("#graph-container")
.append("svg")
.attr("width", "100%")
.attr("height", "100%")
.attr("viewBox", [0, 0, width, height]);
const defs = svg.append("defs");
// Glow filter for hovered nodes
const filter = defs.append("filter").attr("id", "glow");
filter.append("feGaussianBlur").attr("stdDeviation", "3").attr("result", "coloredBlur");
const feMerge = filter.append("feMerge");
feMerge.append("feMergeNode").attr("in", "coloredBlur");
feMerge.append("feMergeNode").attr("in", "SourceGraphic");
const g = svg.append("g");
// Zoom
const zoom = d3.zoom()
.scaleExtent([0.1, 8])
.on("zoom", (event) => {
g.attr("transform", event.transform);
});
svg.call(zoom);
// Simulation
const simulation = d3.forceSimulation(nodes)
.force("link", d3.forceLink(links).id(d => d.id).distance(d => {
if (d.type === "cert-machine") return 150;
return 80;
}).strength(d => {
if (d.type === "cert-machine") return 0.1;
return 0.3;
}))
.force("charge", d3.forceManyBody().strength(-120).distanceMax(400))
.force("center", d3.forceCenter(width / 2, height / 2))
.force("collision", d3.forceCollide().radius(d => d.radius + 4))
.force("x", d3.forceX(width / 2).strength(0.03))
.force("y", d3.forceY(height / 2).strength(0.03));
// Links
const linkElements = g.append("g")
.selectAll("line")
.data(links)
.join("line")
.attr("class", "link")
.attr("stroke", d => d.type === "cert-machine" ? "#f9e2af" : "#45475a")
.attr("stroke-width", d => d.type === "cert-machine" ? 0.5 : 1);
// Node groups
const nodeElements = g.append("g")
.selectAll("g")
.data(nodes)
.join("g")
.attr("class", "node")
.call(d3.drag()
.on("start", dragstarted)
.on("drag", dragged)
.on("end", dragended));
// Draw shapes based on type
nodeElements.each(function(d) {
const el = d3.select(this);
if (d.type === "machine") {
el.append("circle")
.attr("r", d.radius)
.attr("fill", d.color)
.attr("stroke", "#11111b")
.attr("stroke-width", 1.5);
} else if (d.type === "technique") {
// Diamond shape
el.append("rect")
.attr("width", d.radius * 1.6)
.attr("height", d.radius * 1.6)
.attr("x", -d.radius * 0.8)
.attr("y", -d.radius * 0.8)
.attr("transform", "rotate(45)")
.attr("fill", d.color)
.attr("stroke", "#11111b")
.attr("stroke-width", 1.5)
.attr("rx", 1);
} else if (d.type === "certification") {
// Star / larger circle with distinct look
el.append("circle")
.attr("r", d.radius)
.attr("fill", d.color)
.attr("stroke", "#11111b")
.attr("stroke-width", 2);
el.append("text")
.attr("dy", "0.35em")
.attr("text-anchor", "middle")
.attr("font-size", "8px")
.attr("font-weight", "700")
.attr("fill", "#11111b")
.text(d.name);
}
});
// Labels for machines and techniques
nodeElements.filter(d => d.type !== "certification")
.append("text")
.attr("dy", d => d.radius + 12)
.attr("font-size", d => d.type === "technique" ? "9px" : "10px")
.attr("fill", d => d.type === "technique" ? "#89dceb" : "#cdd6f4")
.attr("font-weight", d => d.type === "technique" ? "400" : "600")
.text(d => d.name);
// ===========================================================================
// TOOLTIP
// ===========================================================================
const tooltip = document.getElementById("tooltip");
nodeElements.on("mouseover", function(event, d) {
// Build tooltip content
const ttName = tooltip.querySelector(".tt-name");
const ttDetails = tooltip.querySelector(".tt-details");
ttName.style.color = d.color;
if (d.type === "machine") {
ttName.textContent = d.name;
let html = `
<div class="tt-row"><span class="tt-label">OS:</span> ${d.os}</div>
<div class="tt-row"><span class="tt-label">Difficulty:</span> <span style="color:${d.color}">${d.difficulty}</span></div>
`;
if (d.techniques.length > 0) {
html += `<div class="tt-techniques">`;
d.techniques.forEach(t => { html += `<span class="tt-tag">${t}</span>`; });
html += `</div>`;
}
ttDetails.innerHTML = html;
} else if (d.type === "technique") {
ttName.textContent = d.name;
const connectedMachines = links
.filter(l => {
const sid = typeof l.source === "object" ? l.source.id : l.source;
const tid = typeof l.target === "object" ? l.target.id : l.target;
return (sid === d.id || tid === d.id) && (sid.startsWith("machine:") || tid.startsWith("machine:"));
})
.map(l => {
const sid = typeof l.source === "object" ? l.source.id : l.source;
const tid = typeof l.target === "object" ? l.target.id : l.target;
const mId = sid === d.id ? tid : sid;
return mId.replace("machine:", "");
});
let html = `<div class="tt-row"><span class="tt-label">Category:</span> ${d.category || "Other"}</div>`;
html += `<div class="tt-row"><span class="tt-label">Machines:</span> ${connectedMachines.length}</div>`;
if (connectedMachines.length > 0) {
html += `<div class="tt-techniques">`;
connectedMachines.forEach(m => { html += `<span class="tt-tag">${m}</span>`; });
html += `</div>`;
}
ttDetails.innerHTML = html;
} else {
ttName.textContent = d.name;
const connectedMachines = links
.filter(l => {
const sid = typeof l.source === "object" ? l.source.id : l.source;
return sid === d.id;
})
.map(l => {
const tid = typeof l.target === "object" ? l.target.id : l.target;
return tid.replace("machine:", "");
});
ttDetails.innerHTML = `<div class="tt-row"><span class="tt-label">Type:</span> Certification</div>
<div class="tt-row"><span class="tt-label">Machines:</span> ${connectedMachines.length} linked</div>`;
}
tooltip.classList.add("visible");
// Highlight connected
highlightConnected(d);
})
.on("mousemove", function(event) {
let x = event.clientX + 16;
let y = event.clientY + 16;
const tw = tooltip.offsetWidth;
const th = tooltip.offsetHeight;
if (x + tw > window.innerWidth - 8) x = event.clientX - tw - 16;
if (y + th > window.innerHeight - 8) y = event.clientY - th - 16;
tooltip.style.left = x + "px";
tooltip.style.top = y + "px";
})
.on("mouseout", function() {
tooltip.classList.remove("visible");
resetHighlight();
});
// Click: open writeup
nodeElements.on("click", function(event, d) {
if (d.type === "machine" && d.url) {
window.open(d.url, "_blank");
}
});
// ===========================================================================
// HIGHLIGHTING
// ===========================================================================
function highlightConnected(d) {
const connectedIds = new Set([d.id]);
links.forEach(l => {
const sid = typeof l.source === "object" ? l.source.id : l.source;
const tid = typeof l.target === "object" ? l.target.id : l.target;
if (sid === d.id) connectedIds.add(tid);
if (tid === d.id) connectedIds.add(sid);
});
nodeElements.classed("dimmed", n => !connectedIds.has(n.id));
linkElements.classed("dimmed", l => {
const sid = typeof l.source === "object" ? l.source.id : l.source;
const tid = typeof l.target === "object" ? l.target.id : l.target;
return sid !== d.id && tid !== d.id;
});
linkElements.classed("highlighted", l => {
const sid = typeof l.source === "object" ? l.source.id : l.source;
const tid = typeof l.target === "object" ? l.target.id : l.target;
return sid === d.id || tid === d.id;
});
// Glow on hovered node
d3.select(nodeElements.nodes()[nodes.indexOf(d)])
.select("circle, rect")
.attr("filter", "url(#glow)");
}
function resetHighlight() {
nodeElements.classed("dimmed", false);
linkElements.classed("dimmed", false).classed("highlighted", false);
nodeElements.selectAll("circle, rect").attr("filter", null);
}
// ===========================================================================
// TICK
// ===========================================================================
simulation.on("tick", () => {
linkElements
.attr("x1", d => d.source.x)
.attr("y1", d => d.source.y)
.attr("x2", d => d.target.x)
.attr("y2", d => d.target.y);
nodeElements.attr("transform", d => `translate(${d.x},${d.y})`);
});
// ===========================================================================
// DRAG
// ===========================================================================
function dragstarted(event, d) {
if (!event.active) simulation.alphaTarget(0.3).restart();
d.fx = d.x; d.fy = d.y;
}
function dragged(event, d) {
d.fx = event.x; d.fy = event.y;
}
function dragended(event, d) {
if (!event.active) simulation.alphaTarget(0);
d.fx = null; d.fy = null;
}
// ===========================================================================
// FILTERS
// ===========================================================================
function applyFilters() {
const selectedDifficulties = new Set(
[...document.querySelectorAll("#filter-difficulty input:checked")].map(cb => cb.value)
);
const selectedOS = new Set(
[...document.querySelectorAll("#filter-os input:checked")].map(cb => cb.value)
);
const selectedTypes = new Set(
[...document.querySelectorAll("#filter-types input:checked")].map(cb => cb.value)
);
const selectedTechCats = new Set(
[...document.querySelectorAll("#filter-technique-cat input:checked")].map(cb => cb.value)
);
const searchTerm = document.getElementById("search-box").value.toLowerCase().trim();
const visibleNodeIds = new Set();
nodes.forEach(n => {
let visible = true;
if (n.type === "machine") {
if (!selectedTypes.has("machine")) visible = false;
if (!selectedDifficulties.has(n.difficulty)) visible = false;
if (!selectedOS.has(n.os)) visible = false;
if (searchTerm && !n.name.toLowerCase().includes(searchTerm)) visible = false;
} else if (n.type === "technique") {
if (!selectedTypes.has("technique")) visible = false;
if (!selectedTechCats.has(n.category || "Other")) visible = false;
} else if (n.type === "certification") {
if (!selectedTypes.has("certification")) visible = false;
}
if (visible) visibleNodeIds.add(n.id);
});
nodeElements.style("display", d => visibleNodeIds.has(d.id) ? null : "none");
linkElements.style("display", d => {
const sid = typeof d.source === "object" ? d.source.id : d.source;
const tid = typeof d.target === "object" ? d.target.id : d.target;
return (visibleNodeIds.has(sid) && visibleNodeIds.has(tid)) ? null : "none";
});
}
// Attach filter listeners
document.querySelectorAll("#sidebar input[type='checkbox']").forEach(cb => {
cb.addEventListener("change", applyFilters);
});
document.getElementById("search-box").addEventListener("input", applyFilters);
// ===========================================================================
// SIDEBAR TOGGLE
// ===========================================================================
const sidebar = document.getElementById("sidebar");
const toggleBtn = document.getElementById("toggle-sidebar");
const graphContainer = document.getElementById("graph-container");
toggleBtn.addEventListener("click", () => {
sidebar.classList.toggle("collapsed");
toggleBtn.classList.toggle("shifted");
graphContainer.classList.toggle("expanded");
});
// ===========================================================================
// INITIAL ZOOM TO FIT
// ===========================================================================
simulation.on("end", () => {
// Once simulation settles, zoom to fit
const bounds = g.node().getBBox();
const dx = bounds.width;
const dy = bounds.height;
const cx = bounds.x + dx / 2;
const cy = bounds.y + dy / 2;
const containerW = container.clientWidth;
const containerH = container.clientHeight;
const scale = 0.85 / Math.max(dx / containerW, dy / containerH);
const translate = [containerW / 2 - scale * cx, containerH / 2 - scale * cy];
svg.transition().duration(750).call(
zoom.transform,
d3.zoomIdentity.translate(translate[0], translate[1]).scale(scale)
);
});
// ===========================================================================
// WINDOW RESIZE
// ===========================================================================
window.addEventListener("resize", () => {
simulation.force("center", d3.forceCenter(container.clientWidth / 2, container.clientHeight / 2));
simulation.alpha(0.1).restart();
});
</script>
</body>
</html>