-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdashboard_generator.py
More file actions
5327 lines (4894 loc) · 363 KB
/
dashboard_generator.py
File metadata and controls
5327 lines (4894 loc) · 363 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
#!/usr/bin/env python3
"""
PyADRecon Dashboard Generator
Generates an interactive HTML dashboard from CSV outputs
"""
import os
import csv
import json
import base64
import urllib.request
import urllib.error
from datetime import datetime, timedelta
from pathlib import Path
class DashboardGenerator:
"""Generate interactive HTML dashboard from PyADRecon CSV outputs."""
def __init__(self, csv_dir: str, output_file: str = None):
self.csv_dir = Path(csv_dir)
self.output_file = output_file or str(self.csv_dir.parent / "dashboard.html")
self.data = {}
def load_csv_data(self):
"""Load all CSV files into memory."""
# Check if CSV-Files subdirectory exists
csv_subdir = self.csv_dir / "CSV-Files"
if csv_subdir.is_dir():
csv_source = csv_subdir
else:
csv_source = self.csv_dir
csv_files = list(csv_source.glob("*.csv"))
for csv_file in csv_files:
module_name = csv_file.stem
try:
with open(csv_file, 'r', encoding='utf-8') as f:
reader = csv.DictReader(f)
self.data[module_name] = list(reader)
except Exception as e:
print(f"Warning: Could not load {csv_file.name}: {e}")
return len(self.data) > 0
def generate_html(self):
"""Generate the complete HTML dashboard."""
# Embed data as JavaScript
data_json = json.dumps(self.data, indent=2)
# Get generation timestamp
generation_timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
html_content = f"""<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PyADRecon Dashboard</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Vue.js 3 -->
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<!-- Chart.js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.js"></script>
<!-- Vis.js Network for graph visualization -->
<script src="https://unpkg.com/vis-network@9.1.6/standalone/umd/vis-network.min.js"></script>
<link href="https://unpkg.com/vis-network@9.1.6/styles/vis-network.min.css" rel="stylesheet" />
<!-- Font Awesome for icons -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" />
<style>
[v-cloak] {{ display: none; }}
/* Smooth scrolling */
html {{
scroll-behavior: smooth;
}}
/* Dark mode styles */
body.dark {{
background-color: #0f172a;
color: #f1f5f9;
}}
.dark .bg-white {{
background-color: #1e293b;
color: #f1f5f9;
}}
.dark .bg-gray-50 {{
background-color: #0f172a;
}}
.dark .text-gray-900 {{
color: #f1f5f9;
}}
.dark .text-gray-600 {{
color: #cbd5e1;
}}
.dark .text-gray-500 {{
color: #94a3b8;
}}
.dark .border-gray-200 {{
border-color: #334155;
}}
.dark .bg-gray-800 {{
background-color: #1e293b;
}}
.dark .bg-gray-700 {{
background-color: #334155;
}}
.dark .divide-gray-200 {{
border-color: #334155;
}}
.badge {{
display: inline-block;
padding: 0.25rem 0.75rem;
border-radius: 0.375rem;
font-weight: 600;
font-size: 0.75rem;
text-transform: uppercase;
}}
.badge-critical {{
background-color: #7f1d1d;
color: white;
}}
.badge-high {{
background-color: #dc2626;
color: white;
}}
.badge-medium {{
background-color: #f97316;
color: white;
}}
.badge-low {{
background-color: #fbbf24;
color: #78350f;
}}
.badge-info {{
background-color: #3b82f6;
color: white;
}}
.badge-none {{
background-color: #6b7280;
color: white;
}}
.badge-purple {{
background-color: #9333ea;
color: white;
}}
.badge-cyan {{
background-color: #06b6d4;
color: white;
}}
.badge-amber {{
background-color: #f59e0b;
color: white;
}}
.badge-pink {{
background-color: #ec4899;
color: white;
}}
.badge-indigo {{
background-color: #6366f1;
color: white;
}}
.stat-card {{
transition: transform 0.2s, box-shadow 0.2s;
cursor: pointer;
}}
.stat-card:hover {{
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}}
.table-container {{
max-height: 600px;
overflow-y: auto;
}}
table {{
border-collapse: collapse;
width: 100%;
}}
th {{
position: sticky;
top: 0;
background-color: #f3f4f6;
z-index: 10;
cursor: pointer;
user-select: none;
padding: 0.75rem 1.5rem;
font-weight: 600;
}}
.dark th {{
background-color: #1e293b;
color: #f1f5f9;
border-bottom: 2px solid #334155;
}}
tbody tr {{
border-bottom: 1px solid #e5e7eb;
}}
.dark tbody tr {{
border-bottom: 1px solid #334155;
}}
tr:hover {{
background-color: #f9fafb;
}}
.dark tr:hover {{
background-color: #334155;
}}
td {{
padding: 0.75rem 1.5rem;
color: #1f2937;
}}
.dark td {{
color: #e2e8f0;
}}
/* Improve text contrast in dark mode */
.dark input,
.dark select {{
background-color: #1e293b;
border-color: #475569;
color: #f1f5f9;
}}
.dark input::placeholder {{
color: #64748b;
}}
/* Card backgrounds */
.dark .stat-card {{
background-color: #1e293b;
border: 1px solid #334155;
}}
#trustGraph {{
height: 500px;
border: 1px solid #e5e7eb;
border-radius: 0.5rem;
}}
.dark #trustGraph {{
border-color: #4a5568;
}}
.search-input {{
transition: all 0.3s;
}}
.search-input:focus {{
transform: scale(1.02);
}}
/* Loading indicator */
.loading-message {{
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: white;
padding: 2rem;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
display: none;
}}
.loading-message.show {{
display: block;
}}
/* Inline tool links - inherit color, no underline, subtle hover */
.tool-link {{
color: inherit;
text-decoration: none;
border-bottom: 1px dotted currentColor;
transition: opacity 0.2s;
}}
.tool-link:hover {{
opacity: 0.7;
}}
</style>
</head>
<body class="bg-gray-900 dark">
<div id="app" v-cloak>
<!-- Header -->
<header class="bg-white dark:bg-gray-800 shadow-lg sticky top-0 z-50">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
<div class="flex flex-col lg:flex-row lg:justify-between lg:items-center gap-4">
<div class="flex-1">
<h1 class="text-2xl sm:text-3xl font-bold text-white cursor-pointer hover:text-blue-400 transition"
@click="scrollToSecurityFindings"
title="Back to Security Findings">
<i class="fas fa-shield-halved text-blue-600"></i>
PyADRecon Dashboard
</h1>
<div class="flex flex-wrap gap-x-4 gap-y-1 text-xs sm:text-sm text-gray-400 mt-2">
<span v-if="aboutInfo.version" class="whitespace-nowrap">
<i class="fas fa-code-branch"></i> {{{{ aboutInfo.version }}}}
</span>
<span v-if="aboutInfo.domain" class="whitespace-nowrap">
<i class="fas fa-network-wired"></i> Target: {{{{ aboutInfo.domain }}}}
</span>
<span v-if="aboutInfo.user" class="whitespace-nowrap">
<i class="fas fa-user"></i> Executed by: {{{{ aboutInfo.user }}}}
</span>
<span v-if="aboutInfo.computer" class="whitespace-nowrap">
<i class="fas fa-desktop"></i> From: {{{{ aboutInfo.computer }}}}
</span>
<span class="whitespace-nowrap">
<i class="fas fa-clock"></i> Generated: {generation_timestamp}
</span>
</div>
</div>
<div class="flex flex-wrap gap-2 sm:gap-3 items-center">
<a v-if="aboutInfo.github" :href="'https://' + aboutInfo.github" target="_blank"
class="px-3 py-2 sm:px-4 rounded-lg bg-gray-700 text-white hover:bg-gray-600 transition text-sm sm:text-base"
title="View on GitHub">
<i class="fab fa-github"></i><span class="hidden sm:inline ml-1">GitHub</span>
</a>
<a :href="'vulnad_local-Report.xlsx'" download
class="px-3 py-2 sm:px-4 rounded-lg bg-green-600 text-white hover:bg-green-700 transition text-sm sm:text-base whitespace-nowrap">
<i class="fas fa-file-excel"></i> <span class="hidden sm:inline">Download </span>XLSX
</a>
</div>
</div>
</div>
</header>
<!-- Navigation Tabs -->
<nav class="bg-white dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700 sticky z-40" style="top: var(--header-height, 120px);">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex space-x-8">
<button v-for="tab in tabs" :key="tab.id"
@click="handleTabClick(tab.id)"
:class="[
'py-4 px-1 border-b-2 font-medium text-sm transition',
activeTab === tab.id
? 'border-blue-500 text-blue-600 dark:text-blue-400'
: 'border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300'
]">
<i :class="tab.icon"></i> {{{{ tab.label }}}}
<span v-if="tab.id === 'findings' && securityIssuesCount > 0" class="ml-2 px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200">
{{{{ securityIssuesCount }}}}
</span>
<span v-else-if="tab.count" class="ml-2 px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200">
{{{{ tab.count }}}}
</span>
</button>
</div>
</div>
</nav>
<!-- Main Content -->
<main class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
<!-- Overview Tab -->
<div v-if="activeTab === 'overview'" class="space-y-6">
<!-- Security Findings Tiles -->
<div id="security-findings-section" class="mb-6">
<h3 class="text-lg font-semibold text-gray-700 dark:text-gray-300 mb-3">
<i class="fas fa-shield-virus"></i> Security Findings
</h3>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
<div v-if="vulnerableCertTemplates.length > 0" @click="navigateToSection('findings', 'adcs-templates-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-orange-100 dark:bg-orange-900/30 rounded-md p-3">
<i class="fas fa-certificate text-orange-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">ESC Vulnerable</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ vulnerableCertTemplates.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
ADCS templates
</dd>
</dl>
</div>
</div>
</div>
<div v-if="kerberoastable.length > 0" @click="navigateToSection('findings', 'kerberoastable-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-purple-100 dark:bg-purple-900/30 rounded-md p-3">
<i class="fas fa-ticket text-purple-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Kerberoastable</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ kerberoastable.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Users with SPN
</dd>
</dl>
</div>
</div>
</div>
<div v-if="asreproastable.length > 0" @click="navigateToSection('findings', 'asreproastable-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-pink-100 dark:bg-pink-900/30 rounded-md p-3">
<i class="fas fa-key text-pink-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">ASREPRoastable</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ asreproastable.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Users without pre-auth
</dd>
</dl>
</div>
</div>
</div>
<div v-if="usersWithPasswordsInInfo.length > 0" @click="navigateToSection('findings', 'passwords-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-100 dark:bg-red-900/30 rounded-md p-3">
<i class="fas fa-lock-open text-red-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Cleartext Passwords</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ usersWithPasswordsInInfo.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Found in LDAP attributes
</dd>
</dl>
</div>
</div>
</div>
<div v-if="lapsReadable.length > 0" @click="navigateToSection('findings', 'laps-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-indigo-100 dark:bg-indigo-900/30 rounded-md p-3">
<i class="fas fa-user-shield text-indigo-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">LAPS Readable</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ lapsReadable.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Local admin passwords
</dd>
</dl>
</div>
</div>
</div>
<div v-if="failedCISControls > 0" @click="navigateToSection('findings', 'password-policy-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-yellow-100 dark:bg-yellow-900/30 rounded-md p-3">
<i class="fas fa-key text-yellow-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Password Policy</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ failedCISControls }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Failed CIS controls
</dd>
</dl>
</div>
</div>
</div>
<div v-if="krbtgtOldPassword.length > 0" @click="navigateToSection('findings', 'krbtgt-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-100 dark:bg-red-900/30 rounded-md p-3">
<i class="fas fa-crown text-red-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">KRBTGT Password Age</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ krbtgtOldPassword.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Golden Ticket risk
</dd>
</dl>
</div>
</div>
</div>
<div v-if="protectedGroups.length > 0" @click="navigateToSection('findings', 'protected-users-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-teal-100 dark:bg-teal-900/30 rounded-md p-3">
<i class="fas fa-shield-alt text-teal-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Privileged User Accounts</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ unprotectedPrivilegedUsers.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Not in Protected Users
</dd>
</dl>
</div>
</div>
</div>
<div v-if="machineAccountQuota > 0" @click="navigateToSection('findings', 'machine-quota-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-amber-100 dark:bg-amber-900/30 rounded-md p-3">
<i class="fas fa-server text-amber-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Machine Account Quota</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ machineAccountQuota }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Computers can be added
</dd>
</dl>
</div>
</div>
</div>
<div v-if="unconstrainedDelegationAccounts.length > 0" @click="navigateToSection('findings', 'unconstrained-delegation-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-100 dark:bg-red-900/30 rounded-md p-3">
<i class="fas fa-user-secret text-red-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Unconstrained Delegation</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ unconstrainedDelegationAccounts.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Impersonation risk
</dd>
</dl>
</div>
</div>
</div>
<div v-if="constrainedDelegationRisks.length > 0" @click="navigateToSection('findings', 'constrained-delegation-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-orange-100 dark:bg-orange-900/30 rounded-md p-3">
<i class="fas fa-exchange-alt text-orange-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Constrained Delegation</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ constrainedDelegationRisks.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Impersonation risk
</dd>
</dl>
</div>
</div>
</div>
<div v-if="objectsWithSIDHistory.length > 0" @click="navigateToSection('findings', 'sidhistory-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-purple-100 dark:bg-purple-900/30 rounded-md p-3">
<i class="fas fa-history text-purple-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">SID History</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ objectsWithSIDHistory.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Privilege escalation risk
</dd>
</dl>
</div>
</div>
</div>
<div v-if="foreignSecurityPrincipals.length > 0" @click="navigateToSection('findings', 'foreign-principals-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-pink-100 dark:bg-pink-900/30 rounded-md p-3">
<i class="fas fa-globe text-pink-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Foreign Principals</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ foreignSecurityPrincipals.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
In privileged groups
</dd>
</dl>
</div>
</div>
</div>
<div v-if="vulnerableGMSA.length > 0" @click="navigateToSection('findings', 'gmsa-vulnerabilities-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-yellow-100 dark:bg-yellow-900/30 rounded-md p-3">
<i class="fas fa-user-cog text-yellow-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">gMSA Misconfigurations</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ vulnerableGMSA.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Permission issues
</dd>
</dl>
</div>
</div>
</div>
<div v-if="legacyOperatingSystems.length > 0" @click="navigateToSection('findings', 'legacy-os-section')" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-red-100 dark:bg-red-900/30 rounded-md p-3">
<i class="fas fa-desktop text-red-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Legacy OS Systems</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ legacyOperatingSystems.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
Unpatched or End-of-Life (EOL)
</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
<!-- Domain Information Tiles -->
<div class="mb-6">
<h3 class="text-lg font-semibold text-gray-700 dark:text-gray-300 mb-3">
<i class="fas fa-info-circle"></i> Domain Information
</h3>
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-cyan-100 dark:bg-cyan-900/30 rounded-md p-3">
<i class="fas fa-server text-cyan-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Domain Controllers</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ domainControllers.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div @click="activeTab = 'users'; userFilter = 'all'; activeView = 'all';" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-blue-100 dark:bg-blue-900/30 rounded-md p-3">
<i class="fas fa-users text-blue-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">
Total Users
</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">
{{{{ users.length }}}}
</dd>
<dd class="text-sm text-gray-500 dark:text-gray-400">
{{{{ enabledUsers.length }}}} enabled
</dd>
</dl>
</div>
</div>
</div>
<div @click="activeTab = 'users'; userFilter = 'privileged';" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-yellow-100 dark:bg-yellow-900/30 rounded-md p-3">
<i class="fas fa-user-shield text-yellow-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">
Privileged Users
</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">
{{{{ privilegedUsers.length }}}}
</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">
AdminCount=1
</dd>
</dl>
</div>
</div>
</div>
<div @click="activeTab = 'users'; userFilter = 'dormant';" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-gray-100 dark:bg-gray-700 rounded-md p-3">
<i class="fas fa-user-clock text-gray-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Dormant Users</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ dormantUsers.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400">90+ days inactive</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-teal-100 dark:bg-teal-900/30 rounded-md p-3">
<i class="fas fa-cog text-teal-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">gMSA</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ gmsa.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div @click="activeTab = 'computers'; activeView = 'all';" class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6 cursor-pointer hover:shadow-lg transition-shadow">
<div class="flex items-center">
<div class="flex-shrink-0 bg-green-100 dark:bg-green-900/30 rounded-md p-3">
<i class="fas fa-desktop text-green-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">
Computers
</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">
{{{{ computers.length }}}}
</dd>
<dd class="text-sm text-gray-500 dark:text-gray-400">
{{{{ enabledComputers.length }}}} enabled
</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-amber-100 dark:bg-amber-900/30 rounded-md p-3">
<i class="fas fa-print text-amber-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Printers</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ printers.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-purple-100 dark:bg-purple-900/30 rounded-md p-3">
<i class="fas fa-users-cog text-purple-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Groups</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ groups.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-rose-100 dark:bg-rose-900/30 rounded-md p-3">
<i class="fas fa-list-check text-rose-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">GPOs</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ gpos.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-emerald-100 dark:bg-emerald-900/30 rounded-md p-3">
<i class="fas fa-certificate text-emerald-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Certificate Authorities</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ certificateAuthorities.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-lime-100 dark:bg-lime-900/30 rounded-md p-3">
<i class="fas fa-sitemap text-lime-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Trusts</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ trusts.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-indigo-100 dark:bg-indigo-900/30 rounded-md p-3">
<i class="fas fa-folder-tree text-indigo-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">OUs</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ ous.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-sky-100 dark:bg-sky-900/30 rounded-md p-3">
<i class="fas fa-map-marked-alt text-sky-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Sites</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ sites.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-violet-100 dark:bg-violet-900/30 rounded-md p-3">
<i class="fas fa-network-wired text-violet-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Subnets</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ subnets.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
<div class="stat-card bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<div class="flex items-center">
<div class="flex-shrink-0 bg-fuchsia-100 dark:bg-fuchsia-900/30 rounded-md p-3">
<i class="fas fa-shield-halved text-fuchsia-600 text-2xl"></i>
</div>
<div class="ml-5 w-0 flex-1">
<dl>
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400 truncate">Fine-Grained Pwd Policies</dt>
<dd class="text-3xl font-semibold text-gray-900 dark:text-white">{{{{ fineGrainedPasswordPolicy.length }}}}</dd>
<dd class="text-xs text-gray-500 dark:text-gray-400 mt-1">More details in XLSX</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
<!-- User Account Status Chart -->
<div class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">
<i class="fas fa-chart-bar"></i> User Account Status Overview
</h3>
<canvas id="userStatusChart"></canvas>
</div>
<!-- Domain Trust Graph -->
<div v-if="trusts.length > 0" class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<h3 class="text-lg font-semibold text-gray-900 dark:text-white mb-4">
<i class="fas fa-sitemap"></i> Domain Trust Relationships
</h3>
<div id="trustGraph"></div>
<div class="mt-4 flex items-center flex-wrap gap-4 text-sm text-gray-600 dark:text-gray-400">
<div class="flex items-center">
<div class="w-4 h-4 bg-blue-500 rounded mr-2"></div>
<span>Source Domain</span>
</div>
<div class="flex items-center">
<div class="w-4 h-4 bg-green-500 rounded mr-2"></div>
<span>Trusted Domain</span>
</div>
<div class="flex items-center">
<div class="w-4 h-4 bg-purple-500 rounded-full mr-2"></div>
<span>User Counts</span>
</div>
<div class="flex items-center">
<div class="w-4 h-4 bg-amber-500 rounded-full mr-2"></div>
<span>Computer Counts</span>
</div>
</div>
</div>
</div>
<!-- Findings Tab -->
<div v-if="activeTab === 'findings'" class="space-y-6">
<!-- ESC Vulnerable ADCS Templates -->
<div id="adcs-templates-section" v-if="vulnerableCertTemplates.length > 0" class="bg-white dark:bg-gray-800 rounded-lg shadow p-6">
<h2 class="text-2xl font-bold text-gray-900 dark:text-white mb-4">
<i class="fas fa-certificate text-orange-600"></i> ESC Vulnerable ADCS Templates ({{{{ vulnerableCertTemplates.length }}}})
</h2>
<div class="bg-orange-50 dark:bg-orange-900/20 border-l-4 border-orange-500 p-4 mb-6">
<h3 class="font-semibold text-orange-800 dark:text-orange-200 mb-2">🎯 Issue & Impact</h3>
<p class="text-orange-700 dark:text-orange-300 text-sm mb-3">
Active Directory Certificate Services (ADCS) templates vulnerable to privilege escalation techniques cataloged as ESC (Escalation Scenarios). Misconfigured templates allow unauthorized certificate enrollment, leading to authentication as privileged users.
</p>
<h3 class="font-semibold text-orange-800 dark:text-orange-200 mb-2">⚔️ Attacker Benefit</h3>
<p class="text-orange-700 dark:text-orange-300 text-sm mb-3">
Attackers can request rogue certificates for domain administrators or other high-privilege accounts, achieving persistent domain compromise without account credentials.
</p>
<h3 class="font-semibold text-orange-800 dark:text-orange-200 mb-2">🔓 Exploitation Method</h3>
<p class="text-orange-700 dark:text-orange-300 text-sm mb-3">
Tools like <a href="https://github.com/ly4k/Certipy" target="_blank" class="tool-link">Certipy</a> or <a href="https://github.com/GhostPack/Certify" target="_blank" class="tool-link">Certify</a> identify vulnerable templates. Attackers request certificates with elevated permissions, then authenticate using the certificate to obtain TGTs or NTLM hashes.
</p>
<h3 class="font-semibold text-orange-800 dark:text-orange-200 mb-2">💡 Remediation</h3>
<p class="text-orange-700 dark:text-orange-300 text-sm">
<strong>Secure template permissions:</strong> Remove enrollment rights from Domain Users/Authenticated Users. Enable Manager Approval for high-risk templates. Set "This number of authorized signatures" to ≥1. Disable "Enrollee Supplies Subject" or require manager approval. For ESC9 configure certificate mapping to Strong (preventing certificate theft impersonation) or remove the CT_FLAG_NO_SECURITY_EXTENSION flag from enrollment flags. Regularly audit certificate templates against ESC vulnerabilities using <a href="https://github.com/GhostPack/Certify" target="_blank" class="tool-link">Certify</a>, <a href="https://github.com/ly4k/Certipy" target="_blank" class="tool-link">Certipy</a> or <a href="https://github.com/TrimarcJake/Locksmith" target="_blank" class="tool-link">Locksmith</a>.
</p>
</div>
<div class="table-container">
<table class="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
<thead>
<tr>
<th @click="sortVulnCertTemplates('Template Name')" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
Template Name
<i v-if="vulnCertTemplateSortColumn === 'Template Name'" :class="vulnCertTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
<i v-else class="fas fa-sort ml-1 opacity-30"></i>
</th>
<th @click="sortVulnCertTemplates('ESC Vulnerabilities')" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
ESC Vulnerabilities
<i v-if="vulnCertTemplateSortColumn === 'ESC Vulnerabilities'" :class="vulnCertTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
<i v-else class="fas fa-sort ml-1 opacity-30"></i>
</th>
<th @click="sortVulnCertTemplates('Risk Factors')" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
Risk Factors
<i v-if="vulnCertTemplateSortColumn === 'Risk Factors'" :class="vulnCertTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
<i v-else class="fas fa-sort ml-1 opacity-30"></i>
</th>
<th @click="sortVulnCertTemplates('Enrollment Rights')" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
Enrollment Rights
<i v-if="vulnCertTemplateSortColumn === 'Enrollment Rights'" :class="vulnCertTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
<i v-else class="fas fa-sort ml-1 opacity-30"></i>
</th>
<th @click="sortVulnCertTemplates('Requires Manager Approval')" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">
Manager Approval
<i v-if="vulnCertTemplateSortColumn === 'Requires Manager Approval'" :class="vulnCertTemplateSortDirection === 'asc' ? 'fas fa-sort-up' : 'fas fa-sort-down'" class="ml-1"></i>
<i v-else class="fas fa-sort ml-1 opacity-30"></i>
</th>
<th @click="sortVulnCertTemplates('Risk Level')" class="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-700">