-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnmap-modern.xsl
More file actions
1675 lines (1553 loc) · 81.8 KB
/
nmap-modern.xsl
File metadata and controls
1675 lines (1553 loc) · 81.8 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
<?xml version="1.0" encoding="utf-8"?>
<!--
Nmap Modern XSL
Updated with modern Tailwind styling and olive color scheme
This software must not be used by military or secret service organisations.
Original: Andreas Hontzia (@honze_net) & LRVT (@l4rm4nd)
Updated: 2026
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat"/>
<xsl:param name="techmore_version"/>
<!-- Services that have both product and version -->
<xsl:key name="svcByProduct"
match="nmaprun/host/ports/port[state/@state='open']/service[@product and @version]"
use="@product"/>
<!-- Distinct Product|Version groups -->
<xsl:key name="svcByProdVer"
match="nmaprun/host/ports/port[state/@state='open']/service[@product and @version]"
use="concat(@product,'|',@version)"/>
<!-- Distinct Product|Version|Host groups (for unique host counting) -->
<xsl:key name="svcByProdVerHost"
match="nmaprun/host/ports/port[state/@state='open']/service[@product and @version]"
use="concat(@product,'|',@version,'|', ancestor::host/address/@addr)"/>
<!-- Distinct Product|Version|Host|Port groups (for host list with ports) -->
<xsl:key name="svcByProdVerHostPort"
match="nmaprun/host/ports/port[state/@state='open']/service[@product and @version]"
use="concat(@product,'|',@version,'|',
ancestor::host/address/@addr,'|',
../@protocol,'|',../@portid)"/>
<!-- All open SSH services (name="ssh") -->
<xsl:key name="sshSvcs"
match="nmaprun/host/ports/port[state/@state='open']/service[@name='ssh']"
use="1"/>
<!-- Product|Version groups derived from HTTP titles like 'Apache Tomcat/7.0.54' -->
<xsl:key name="httpTitleByProdVer"
match="nmaprun/host/ports/port[state/@state='open' and @protocol='tcp']
/script[@id='http-title']/elem[@key='title'][contains(normalize-space(.), '/')]"
use="concat(
substring-before(normalize-space(.), '/'),
'|',
substring-after(normalize-space(.), '/')
)"/>
<!-- Distinct Product|Version|Host|Port groups for HTTP-title based entries -->
<xsl:key name="httpTitleByProdVerHostPort"
match="nmaprun/host/ports/port[state/@state='open' and @protocol='tcp']
/script[@id='http-title']/elem[@key='title'][contains(normalize-space(.), '/')]"
use="concat(
substring-before(normalize-space(.), '/'),
'|',
substring-after(normalize-space(.), '/'),
'|',
ancestor::host/address/@addr,
'|',
ancestor::port[1]/@protocol,
'|',
ancestor::port[1]/@portid
)"/>
<xsl:template match="/">
<html lang="en">
<head>
<meta name="referrer" content="no-referrer"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="preconnect" href="https://fonts.googleapis.com"/>
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""/>
<link href="https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet"/>
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.7/css/jquery.dataTables.min.css"/>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.4.2/css/buttons.dataTables.min.css"/>
<script src="https://code.jquery.com/jquery-3.7.1.min.js" integrity="sha384-1H217gwSVyLSIfaLxHbE7dRb3v4mYCKbpQvzx0cegeju1MVsGrX5xXxAvs/HgeFs" crossorigin="anonymous"></script>
<script src="https://cdn.datatables.net/1.13.7/js/jquery.dataTables.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.4.2/js/buttons.colVis.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.13.7/sorting/ip-address.js"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
olive: {
50: '#f5f6f3',
100: '#e9ebe0',
200: '#d8dbc7',
300: '#bcc2a9',
400: '#979f83',
500: '#777f65',
600: '#636b54',
700: '#525845',
800: '#414637',
900: '#32382a',
950: '#25291f',
}
},
fontFamily: {
display: ['Instrument Serif', 'serif'],
sans: ['Inter', 'system-ui', 'sans-serif'],
}
}
}
}
</script>
<style>
body {
font-family: 'Inter', system-ui, sans-serif;
background-color: #e9ebe0;
color: #262724;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5 {
font-family: 'Instrument Serif', serif;
}
::selection {
background-color: #bcc2a9;
color: white;
}
.nav-link {
position: relative;
transition: color 0.2s ease;
}
.nav-link:hover {
color: #636b54;
}
.nav-link::after {
content: '';
position: absolute;
bottom: -2px;
left: 0;
width: 0;
height: 2px;
background-color: #636b54;
transition: width 0.2s ease;
}
.nav-link:hover::after {
width: 100%;
}
.card {
background: white;
border: 1px solid #d8dbc7;
border-radius: 12px;
transition: all 0.2s ease;
}
.card:hover {
border-color: #bcc2a9;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.badge {
display: inline-block;
padding: 4px 12px;
border-radius: 9999px;
font-size: 0.875rem;
font-weight: 500;
}
.badge-success {
background-color: #979f83;
color: white;
}
.badge-danger {
background-color: #ef4444;
color: white;
}
.badge-warning {
background-color: #f59e0b;
color: white;
}
table.dataTable {
border-collapse: separate;
border-spacing: 0;
border: 1px solid #d8dbc7;
border-radius: 12px;
overflow: hidden;
}
table.dataTable thead th {
background-color: #32382a;
color: white;
font-weight: 500;
border: none;
padding: 12px 16px;
}
table.dataTable tbody td {
border-top: 1px solid #d8dbc7;
padding: 12px 16px;
}
table.dataTable tbody tr:hover {
background-color: #f5f6f3;
}
.dt-buttons {
margin-bottom: 16px;
}
.dt-button {
background-color: #32382a !important;
color: white !important;
border: none !important;
padding: 8px 16px !important;
border-radius: 8px !important;
margin-right: 8px !important;
font-size: 0.875rem !important;
transition: background-color 0.2s ease !important;
}
.dt-button:hover {
background-color: #525845 !important;
}
input[type="text"],
input[type="search"],
textarea {
background-color: white;
color: #25291f;
border: 1px solid #bcc2a9;
padding: 8px 12px;
border-radius: 8px;
outline: none;
transition: border-color 0.2s ease;
}
input:focus,
textarea:focus {
border-color: #636b54;
}
button {
background-color: #32382a;
color: white;
border: none;
padding: 8px 16px;
border-radius: 8px;
cursor: pointer;
transition: background-color 0.2s ease;
font-weight: 500;
}
button:hover {
background-color: #525845;
}
pre {
background-color: #f5f6f3;
border: 1px solid #d8dbc7;
border-radius: 8px;
padding: 16px;
overflow-x: auto;
}
a {
color: #636b54;
text-decoration: none;
transition: color 0.2s ease;
}
a:hover {
color: #525845;
text-decoration: underline;
}
.progress-bar {
height: 32px;
background-color: #f5f6f3;
border-radius: 9999px;
overflow: hidden;
display: flex;
}
.progress-segment {
display: flex;
align-items: center;
justify-content: center;
color: white;
font-weight: 500;
font-size: 0.875rem;
transition: width 0.3s ease;
}
.progress-success {
background-color: #979f83;
}
.progress-danger {
background-color: #ef4444;
}
.highlight-keyword {
color: #ef4444;
font-weight: 600;
}
.collapsible-header {
cursor: pointer;
user-select: none;
}
.collapsible-header:hover {
background-color: #f5f6f3;
}
.chevron {
transition: transform 0.2s ease;
}
.chevron.collapsed {
transform: rotate(-90deg);
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.fade-in {
animation: fadeIn 0.3s ease;
}
@media print {
body {
background-color: white !important;
color: #25291f !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
nav {
display: none !important;
}
.max-w-7xl {
max-width: none !important;
}
body,
.card,
.progress-bar,
pre,
table,
th,
td {
box-shadow: none !important;
}
.card {
background: white !important;
border: 1px solid #d8dbc7 !important;
border-radius: 8px !important;
margin-bottom: 8mm !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
table.dataTable thead th {
background-color: #32382a !important;
color: white !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
.badge-success {
background-color: #979f83 !important;
color: white !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
.badge-danger {
background-color: #ef4444 !important;
color: white !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
.badge-warning {
background-color: #f59e0b !important;
color: white !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
.progress-success {
background-color: #979f83 !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
.progress-danger {
background-color: #ef4444 !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
}
.dt-buttons,
.dataTables_paginate,
.dataTables_length,
.dataTables_filter,
.collapsible-header,
button,
input,
textarea {
display: none !important;
}
[id^="content-"] {
display: block !important;
}
pre {
background-color: #f5f6f3 !important;
-webkit-print-color-adjust: exact !important;
print-color-adjust: exact !important;
white-space: pre-wrap !important;
word-break: break-word !important;
}
#scannedhosts,
#openservices,
#webservices,
#productversions,
#ssh-auth,
#onlinehosts {
page-break-after: always;
}
/* Avoid page breaks inside cards */
.card {
page-break-inside: avoid;
}
@page {
margin: 8mm;
}
}
</style>
<title>Nmap Scan Results</title>
</head>
<body class="min-h-screen">
<!-- Fixed Navigation -->
<nav class="fixed top-0 left-0 right-0 bg-white border-b border-olive-200 z-50 shadow-sm">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
<div class="flex items-center justify-between h-16">
<div class="flex items-center space-x-8">
<span class="text-2xl font-display font-semibold text-olive-900">Nmap Results</span>
<div class="hidden md:flex space-x-6">
<a href="#scannedhosts" class="nav-link text-sm font-medium text-olive-700">Scanned Hosts</a>
<a href="#openservices" class="nav-link text-sm font-medium text-olive-700">Open Services</a>
<a href="#webservices" class="nav-link text-sm font-medium text-olive-700">Web Services</a>
<a href="#productversions" class="nav-link text-sm font-medium text-olive-700">Product Versions</a>
<xsl:if test="count(/nmaprun/host/ports/port[state/@state='open']/service[@name='ssh']) > 0">
<a href="#ssh-auth" class="nav-link text-sm font-medium text-olive-700">SSH Auth</a>
</xsl:if>
<a href="#onlinehosts" class="nav-link text-sm font-medium text-olive-700">Online Hosts</a>
</div>
</div>
<div class="flex items-center space-x-4">
<a href="https://www.pentestfactory.de/schwachstellendatenbank/" target="_blank"
class="text-sm text-olive-600 hover:text-olive-800" title="Vulnerability Database">CVEs ↗</a>
<a href="https://www.ssllabs.com/ssltest/" target="_blank"
class="text-sm text-olive-600 hover:text-olive-800" title="SSL Server Test">SSL/TLS ↗</a>
<a href="https://securityheaders.com/" target="_blank"
class="text-sm text-olive-600 hover:text-olive-800" title="HTTP Header Test">Headers ↗</a>
</div>
</div>
</div>
</nav>
<!-- Main Content -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-24 pb-12">
<!-- Hero Section -->
<div class="card p-8 mb-8 fade-in">
<h1 class="text-4xl font-display font-bold text-olive-900 mb-2">Nmap Port Scanning Results</h1>
<p class="text-sm text-olive-500 mb-1">
Techmore Network Scanner <xsl:value-of select="$techmore_version"/>
</p>
<p class="text-olive-600 mb-4">
Version <xsl:value-of select="/nmaprun/@version"/> ·
<xsl:value-of select="/nmaprun/@startstr"/> – <xsl:value-of select="/nmaprun/runstats/finished/@timestr"/>
</p>
<div class="bg-olive-50 border border-olive-200 rounded-lg p-4 mb-6">
<pre class="text-xs overflow-x-auto"><a target="_blank" class="text-olive-700 hover:text-olive-900"><xsl:attribute name="href">https://explainshell.com/explain?cmd=<xsl:value-of select="/nmaprun/@args"/></xsl:attribute><xsl:value-of select="/nmaprun/@args"/></a></pre>
</div>
<div class="grid grid-cols-3 gap-4 mb-6">
<div class="text-center">
<div class="text-3xl font-bold text-olive-900"><xsl:value-of select="/nmaprun/runstats/hosts/@total"/></div>
<div class="text-sm text-olive-600">Total IPs Scanned</div>
</div>
<div class="text-center">
<div class="text-3xl font-bold text-olive-600"><xsl:value-of select="/nmaprun/runstats/hosts/@up"/></div>
<div class="text-sm text-olive-600">Hosts Online</div>
</div>
<div class="text-center">
<div class="text-3xl font-bold text-olive-400"><xsl:value-of select="/nmaprun/runstats/hosts/@down"/></div>
<div class="text-sm text-olive-600">Hosts Offline</div>
</div>
</div>
<!-- Enhanced Summary Dashboard -->
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-6">
<!-- Critical Vulnerabilities -->
<div class="card p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<div class="w-8 h-8 bg-red-100 rounded-full flex items-center justify-center">
<span class="text-red-600 font-bold text-sm">!</span>
</div>
</div>
<div class="ml-3">
<div class="text-2xl font-bold text-red-600">
<xsl:value-of select="count(/nmaprun/host/script[@id='vulners'][contains(@output, '9.') or contains(@output, '10.')])"/>
</div>
<div class="text-sm text-olive-600">Critical Vulns (CVSS ≥9.0)</div>
</div>
</div>
</div>
<!-- Device Types -->
<div class="card p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<div class="w-8 h-8 bg-olive-100 rounded-full flex items-center justify-center">
<span class="text-olive-600 font-bold text-sm">🖥️</span>
</div>
</div>
<div class="ml-3">
<div class="text-2xl font-bold text-olive-700">
<xsl:value-of select="count(/nmaprun/host[os/osmatch/@name])"/>
</div>
<div class="text-sm text-olive-600">OS Identified</div>
</div>
</div>
</div>
<!-- Open Ports -->
<div class="card p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<div class="w-8 h-8 bg-blue-100 rounded-full flex items-center justify-center">
<span class="text-blue-600 font-bold text-sm">🔓</span>
</div>
</div>
<div class="ml-3">
<div class="text-2xl font-bold text-blue-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open'])"/>
</div>
<div class="text-sm text-olive-600">Total Open Ports</div>
</div>
</div>
</div>
<!-- Web Services -->
<div class="card p-4">
<div class="flex items-center">
<div class="flex-shrink-0">
<div class="w-8 h-8 bg-green-100 rounded-full flex items-center justify-center">
<span class="text-green-600 font-bold text-sm">🌐</span>
</div>
</div>
<div class="ml-3">
<div class="text-2xl font-bold text-green-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open' and (service/@name='http' or service/@name='https' or service/@tunnel='ssl')])"/>
</div>
<div class="text-sm text-olive-600">Web Services</div>
</div>
</div>
</div>
</div>
<!-- Network & Vulnerability Summary -->
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 mb-6">
<!-- Network Range -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">Network Scanned</h3>
<div class="space-y-1">
<div class="text-sm text-olive-700">
<span class="font-medium">Target:</span>
<xsl:value-of select="substring-after(/nmaprun/@args, ' ')"/>
</div>
<div class="text-sm text-olive-700">
<span class="font-medium">IPs:</span> <xsl:value-of select="/nmaprun/runstats/hosts/@total"/>
</div>
<div class="text-sm text-olive-700">
<span class="font-medium">Started:</span> <xsl:value-of select="/nmaprun/@startstr"/>
</div>
<div class="text-sm text-olive-700">
<span class="font-medium">Duration:</span>
<xsl:value-of select="/nmaprun/runstats/finished/@elapsed"/>s
</div>
</div>
</div>
<!-- Vulnerability Severity -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">Vulnerability Levels</h3>
<div class="space-y-2">
<div class="flex justify-between items-center">
<span class="text-sm text-red-600 font-medium">Critical (CVSS ≥9.0)</span>
<span class="text-sm font-bold text-red-600">
<xsl:value-of select="count(/nmaprun/host/script[@id='vulners'][contains(@output, '9.') or contains(@output, '10.')])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-orange-600 font-medium">High (CVSS ≥7.0)</span>
<span class="text-sm font-bold text-orange-600">
<xsl:value-of select="count(/nmaprun/host/script[@id='vulners'][contains(@output, '7.') or contains(@output, '8.')])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-yellow-600 font-medium">Medium (CVSS ≥4.0)</span>
<span class="text-sm font-bold text-yellow-600">
<xsl:value-of select="count(/nmaprun/host/script[@id='vulners'][contains(@output, '4.') or contains(@output, '5.') or contains(@output, '6.')])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-green-600 font-medium">Low (CVSS <4.0)</span>
<span class="text-sm font-bold text-green-600">
<xsl:value-of select="count(/nmaprun/host/script[@id='vulners'][contains(@output, '0.') or contains(@output, '1.') or contains(@output, '2.') or contains(@output, '3.')])"/>
</span>
</div>
</div>
</div>
<!-- Device Vendors -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">Top Vendors</h3>
<div class="space-y-2">
<xsl:for-each select="/nmaprun/host/address[@addrtype='mac']/@vendor[not(. = preceding::address/@vendor)]">
<xsl:sort select="count(/nmaprun/host[address[@addrtype='mac' and @vendor=current()]])" data-type="number" order="descending"/>
<xsl:if test="position() <= 5 and string-length(.) > 0">
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700 truncate max-w-xs" title="{.}">
<xsl:value-of select="substring(., 1, 25)"/>
<xsl:if test="string-length(.) > 25">...</xsl:if>
</span>
<span class="text-sm font-medium text-olive-900 ml-2">
<xsl:value-of select="count(/nmaprun/host[address[@addrtype='mac' and @vendor=current()]])"/>
</span>
</div>
</xsl:if>
</xsl:for-each>
</div>
</div>
</div>
<!-- Security Risk Assessment -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<!-- High-Risk Services -->
<div class="card p-4 border-l-4 border-red-400">
<h3 class="text-lg font-semibold text-olive-900 mb-3 flex items-center">
<span class="w-3 h-3 bg-red-500 rounded-full mr-2"></span>
High-Risk Services
</h3>
<div class="space-y-2">
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">SSH Servers</span>
<span class="text-sm font-medium text-red-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open' and service/@name='ssh'])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Remote Desktop</span>
<span class="text-sm font-medium text-red-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open' and (service/@name='rdp' or service/@name='ms-wbt-server')])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">SMB/File Shares</span>
<span class="text-sm font-medium text-red-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open' and (service/@name='netbios-ssn' or service/@name='microsoft-ds')])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Telnet (Unencrypted)</span>
<span class="text-sm font-medium text-red-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open' and service/@name='telnet'])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">FTP (Unencrypted)</span>
<span class="text-sm font-medium text-red-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open' and service/@name='ftp'])"/>
</span>
</div>
</div>
</div>
<!-- Compliance & Security Issues -->
<div class="card p-4 border-l-4 border-orange-400">
<h3 class="text-lg font-semibold text-olive-900 mb-3 flex items-center">
<span class="w-3 h-3 bg-orange-500 rounded-full mr-2"></span>
Security Issues
</h3>
<div class="space-y-2">
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Default HTTP Ports</span>
<span class="text-sm font-medium text-orange-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open' and @portid='80' and service/@name='http' and not(service/@tunnel='ssl')])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Hosts with >10 Open Ports</span>
<span class="text-sm font-medium text-orange-600">
<xsl:value-of select="count(/nmaprun/host[count(ports/port[state/@state='open']) > 10])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Unknown Services</span>
<span class="text-sm font-medium text-orange-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open' and service/@name='unknown'])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Outdated SSL/TLS</span>
<span class="text-sm font-medium text-orange-600">
<xsl:value-of select="count(/nmaprun/host/ports/port[script[@id='ssl-enum-ciphers'] and script/elem[contains(text(), 'SSLv3') or contains(text(), 'TLSv1.0') or contains(text(), 'TLSv1.1')]])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Hosts Without Hostnames</span>
<span class="text-sm font-medium text-orange-600">
<xsl:value-of select="count(/nmaprun/host[not(hostnames/hostname/@name) or hostnames/hostname/@name=''])"/>
</span>
</div>
</div>
</div>
</div>
<!-- Top 10 Most Vulnerable & Most Open Ports -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<!-- Hosts with Vulnerabilities -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">Hosts with Vulnerabilities</h3>
<div class="space-y-2 max-h-64 overflow-y-auto">
<xsl:for-each select="/nmaprun/host[script[@id='vulners']]">
<xsl:if test="position() <= 10">
<div class="flex justify-between items-center py-1">
<span class="text-sm font-mono text-olive-700">
<xsl:value-of select="address/@addr"/>
</span>
<span class="text-sm font-medium text-red-600 bg-red-50 px-2 py-1 rounded">
<xsl:if test="contains(script[@id='vulners']/@output, '9.') or contains(script[@id='vulners']/@output, '10.')">
Critical
</xsl:if>
<xsl:if test="contains(script[@id='vulners']/@output, '7.') or contains(script[@id='vulners']/@output, '8.')">
High
</xsl:if>
</span>
</div>
</xsl:if>
</xsl:for-each>
</div>
</div>
<!-- Hosts with Most Open Ports -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">Most Open Ports</h3>
<div class="space-y-2 max-h-64 overflow-y-auto">
<xsl:for-each select="/nmaprun/host">
<xsl:sort select="count(ports/port[state/@state='open'])" data-type="number" order="descending"/>
<xsl:if test="position() <= 10 and count(ports/port[state/@state='open']) > 0">
<div class="flex justify-between items-center py-1">
<span class="text-sm font-mono text-olive-700">
<xsl:value-of select="address/@addr"/>
</span>
<span class="text-sm font-medium text-blue-600 bg-blue-50 px-2 py-1 rounded">
<xsl:value-of select="count(ports/port[state/@state='open'])"/> ports
</span>
</div>
</xsl:if>
</xsl:for-each>
</div>
</div>
</div>
<!-- Network Health & Performance -->
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
<!-- Network Utilization -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">Network Utilization</h3>
<div class="space-y-3">
<div>
<div class="flex justify-between text-sm mb-1">
<span class="text-olive-700">IP Space Used</span>
<span class="font-medium text-olive-900">
<xsl:value-of select="format-number(/nmaprun/runstats/hosts/@up div /nmaprun/runstats/hosts/@total * 100, '0.1')"/>%
</span>
</div>
<div class="w-full bg-olive-200 rounded-full h-2">
<div class="bg-olive-600 h-2 rounded-full">
<xsl:attribute name="style">width: <xsl:value-of select="/nmaprun/runstats/hosts/@up div /nmaprun/runstats/hosts/@total * 100"/>%</xsl:attribute>
</div>
</div>
</div>
<div class="text-xs text-olive-600">
<xsl:value-of select="/nmaprun/runstats/hosts/@up"/> of <xsl:value-of select="/nmaprun/runstats/hosts/@total"/> IPs responding
</div>
</div>
</div>
<!-- Scan Performance -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">Scan Performance</h3>
<div class="space-y-2">
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Duration</span>
<span class="text-sm font-medium text-olive-900">
<xsl:value-of select="/nmaprun/runstats/finished/@elapsed"/>s
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Avg per Host</span>
<span class="text-sm font-medium text-olive-900">
<xsl:value-of select="format-number(/nmaprun/runstats/finished/@elapsed div /nmaprun/runstats/hosts/@total, '0.1')"/>s
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Hosts/sec</span>
<span class="text-sm font-medium text-olive-900">
<xsl:value-of select="format-number(/nmaprun/runstats/hosts/@total div /nmaprun/runstats/finished/@elapsed, '0.1')"/>
</span>
</div>
</div>
</div>
<!-- Data Collection Summary -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">Data Collected</h3>
<div class="space-y-2">
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">OS Fingerprints</span>
<span class="text-sm font-medium text-olive-900">
<xsl:value-of select="count(/nmaprun/host[os/osmatch])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Service Versions</span>
<span class="text-sm font-medium text-olive-900">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open' and service/@version])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">MAC Addresses</span>
<span class="text-sm font-medium text-olive-900">
<xsl:value-of select="count(/nmaprun/host/address[@addrtype='mac'])"/>
</span>
</div>
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700">Vulnerability Scans</span>
<span class="text-sm font-medium text-olive-900">
<xsl:value-of select="count(/nmaprun/host[script[@id='vulners']])"/>
</span>
</div>
</div>
</div>
</div>
<!-- Top Services & OS Summary -->
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6">
<!-- Top Services -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">Top Services</h3>
<div class="space-y-2">
<xsl:for-each select="/nmaprun/host/ports/port[state/@state='open']/service/@name[not(. = preceding::service/@name)]">
<xsl:sort select="count(/nmaprun/host/ports/port[state/@state='open']/service[@name=current()])" data-type="number" order="descending"/>
<xsl:if test="position() <= 5">
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700"><xsl:value-of select="."/></span>
<span class="text-sm font-medium text-olive-900">
<xsl:value-of select="count(/nmaprun/host/ports/port[state/@state='open']/service[@name=current()])"/>
</span>
</div>
</xsl:if>
</xsl:for-each>
</div>
</div>
<!-- OS Distribution -->
<div class="card p-4">
<h3 class="text-lg font-semibold text-olive-900 mb-3">OS Distribution</h3>
<div class="space-y-2">
<xsl:for-each select="/nmaprun/host/os/osmatch/@name[not(. = preceding::osmatch/@name)]">
<xsl:sort select="count(/nmaprun/host[os/osmatch/@name=current()])" data-type="number" order="descending"/>
<xsl:if test="position() <= 5">
<div class="flex justify-between items-center">
<span class="text-sm text-olive-700 truncate max-w-xs" title="{.}">
<xsl:value-of select="substring(., 1, 30)"/>
<xsl:if test="string-length(.) > 30">...</xsl:if>
</span>
<span class="text-sm font-medium text-olive-900 ml-2">
<xsl:value-of select="count(/nmaprun/host[os/osmatch/@name=current()])"/>
</span>
</div>
</xsl:if>
</xsl:for-each>
</div>
</div>
</div>
<div class="progress-bar mb-6">
<div class="progress-segment progress-success">
<xsl:attribute name="style">width:<xsl:value-of select="/nmaprun/runstats/hosts/@up div /nmaprun/runstats/hosts/@total * 100"/>%;</xsl:attribute>
<xsl:value-of select="/nmaprun/runstats/hosts/@up"/> Up
</div>
<div class="progress-segment progress-danger">
<xsl:attribute name="style">width:<xsl:value-of select="/nmaprun/runstats/hosts/@down div /nmaprun/runstats/hosts/@total * 100"/>%;</xsl:attribute>
<xsl:value-of select="/nmaprun/runstats/hosts/@down"/> Down
</div>
</div>
<!-- Keyword Highlighting -->
<div class="border-t border-olive-200 pt-6">
<label class="block text-sm font-medium text-olive-900 mb-2">Highlight Keywords in Services</label>
<textarea id="keyword-input" rows="2" placeholder="sha1, password, md5, login..."
class="w-full mb-3">sha1,login,password,md5</textarea>
<div class="flex space-x-3">
<button id="highlight-button" onclick="highlight()">Apply Highlighting</button>
<button onclick="document.location.reload(true);" class="bg-olive-400">Reset</button>
</div>
</div>
</div>
<!-- Scanned Hosts -->
<div id="scannedhosts" class="mb-12 fade-in">
<h2 class="text-3xl font-display font-bold text-olive-900 mb-6">
Scanned Hosts
<xsl:if test="/nmaprun/runstats/hosts/@down > 1024">
<span class="text-lg text-olive-600 font-normal"> (offline hosts hidden)</span>
</xsl:if>
</h2>
<div class="card p-6">
<table id="table-overview" class="w-full">
<thead>
<tr>
<th class="text-left">State</th>
<th class="text-left">Address</th>
<th class="text-left">Hostname</th>
<th class="text-left">TCP (open)</th>
<th class="text-left">UDP (open)</th>
</tr>
</thead>
<tbody>
<xsl:choose>
<xsl:when test="/nmaprun/runstats/hosts/@down > 1024">
<xsl:for-each select="/nmaprun/host[status/@state='up']">
<tr>
<td>
<span class="badge">
<xsl:attribute name="class">badge <xsl:choose><xsl:when test="status/@state='up'">badge-success</xsl:when><xsl:otherwise>badge-danger</xsl:otherwise></xsl:choose></xsl:attribute>
<xsl:value-of select="status/@state"/>
</span>
</td>
<td>
<a class="font-mono text-sm">
<xsl:attribute name="href">#onlinehosts-<xsl:value-of select="translate(address/@addr, '.', '-')"/></xsl:attribute>
<xsl:value-of select="address/@addr"/>
</a>
</td>
<td class="text-olive-700"><xsl:value-of select="hostnames/hostname/@name"/></td>
<td class="text-center"><xsl:value-of select="count(ports/port[state/@state='open' and @protocol='tcp'])"/></td>
<td class="text-center"><xsl:value-of select="count(ports/port[state/@state='open' and @protocol='udp'])"/></td>
</tr>