-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
2146 lines (1942 loc) · 92.8 KB
/
index.html
File metadata and controls
2146 lines (1942 loc) · 92.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
<!doctype html>
<html lang="en">
<head>
<meta name="google-site-verification" content="SvG-GGQq0ageioBwK0bN0M15rrXQbb7LYpwV68kAZz4" />
<meta charset="utf-8" />
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Nmap XML Visualizer | Free Online Nmap Scan Report Parser</title>
<meta name="description" content="Nmap XML Visualizer is a free online tool that helps you visualize and interpret Nmap scan results instantly. Upload your XML output to explore hosts, ports, and vulnerabilities in an easy-to-read interface." />
<meta name="keywords" content="nmap visualizer, nmap xml parser, nmap report analyzer, cybersecurity tools, network scan visualization, nmap gui, ethical hacking, penetration testing" />
<meta name="author" content="Suman Roy" />
<!-- Open Graph Meta for LinkedIn -->
<meta property="og:type" content="website" />
<meta property="og:title" content="Nmap XML Visualizer | Free Nmap Report Analyzer" />
<meta property="og:description" content="Easily visualize Nmap XML scan results with an intuitive interface. Ideal for hackers, pentesters, and cybersecurity pros." />
<meta property="og:url" content="https://sumanrox.github.io/" />
<meta property="og:site_name" content="Nmap XML Visualizer" />
<!-- LinkedIn & Linktree -->
<link rel="me" href="https://linkedin.com/in/sumanrox" />
<link rel="me" href="https://linktr.ee/sumanroy.official" />
<!-- Canonical URL -->
<link rel="canonical" href="https://sumanrox.github.io/" />
<!-- Structured Data for SEO -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "Nmap XML Visualizer",
"url": "https://sumanrox.github.io/",
"author": {
"@type": "Person",
"name": "Suman Roy",
"url": "https://linktr.ee/sumanroy.official"
},
"applicationCategory": "SecurityApplication",
"operatingSystem": "Any",
"description": "A free online visualizer for Nmap XML reports. Upload and explore scan results in a structured, human-readable format.",
"keywords": "nmap xml visualizer, nmap xml parser, nmap report analyzer, penetration testing tool, cybersecurity visualization"
}
</script>
<!-- IBM Carbon CSS (stable CDN) -->
<link rel="stylesheet" href="https://unpkg.com/carbon-components/css/carbon-components.min.css">
<style>
/* Carbon dark tokens (conservative, production-ready) */
:root{
--bg:#161616; /* g100 */
--layer:#262626; /* g90 */
--layer-2:#1f1f1f; /* g100 alt */
--text-01:#f4f4f4;
--text-02:#c6c6c6;
--interactive:#0f62fe; /* blue 60 per Carbon */
--accent:#f1c21b; /* subtle warm accent for highlights (optional) */
--border: rgba(255,255,255,0.06);
font-family: 'IBM Plex Sans', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
font-size:14px;
}
html,body{height:100%;margin:0;background:var(--bg);color:var(--text-01)}
.container{max-width:1300px;margin:18px auto; padding-top: 1em;}
header{position:relative;display:grid;grid-template-columns:48px 1fr 48px;gap:12px;align-items:center;padding:12px;background:var(--layer);border:1px solid var(--border)}
.brand{display:flex;flex-direction:column;gap:4px;text-align:center;align-items:center}
.logo{width:48px;height:48px;background:linear-gradient(135deg,var(--interactive),#0043ce);display:flex;align-items:center;justify-content:center;color:white;font-weight:700;border:1px solid var(--border)}
h1{margin:0;font-size:18px}
.subtitle{color:var(--text-02);font-size:13px}
.controls{display:flex;gap:8px;align-items:center;transition:all 200ms ease}
.bx--btn{border-radius:0;transition:all 150ms ease;display:inline-flex;align-items:center;justify-content:center;gap:6px}
input[type=file]{display:none}
label.file-btn{cursor:pointer;transition:all 150ms ease}
/* Layout: stats row on top, 2-column summary section, then full-width IP inventory */
.grid{display:grid;grid-template-columns:1fr;gap:12px;margin-top:12px;padding-bottom:100px}
.summary-row{display:grid;grid-template-columns:repeat(4, 1fr);gap:12px}
.summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.panel{background:var(--layer);border:1px solid var(--border);padding:12px}
.panel h3{margin:0 0 8px 0}
/* lists */
.list-group{display:flex;flex-direction:column;gap:6px;max-height:46vh;overflow:auto;padding-right:6px}
.list-item{display:flex;justify-content:space-between;align-items:center;padding:8px;border:1px solid transparent;background:transparent;cursor:pointer}
.list-item:hover{background:var(--layer-2)}
.list-item.active{outline:2px solid rgba(15,98,254,0.14);background:linear-gradient(90deg, rgba(15,98,254,0.04), transparent)}
.port-badge{background:var(--interactive);color:white;padding:4px 8px;font-weight:700;border-radius:0}
.svc-pill{background:rgba(15,98,254,0.08);color:var(--interactive);padding:4px 8px;border-radius:0;font-size:13px}
/* IP inventory (accordion) — modern flat Carbon style */
#ipAccordion{max-height:78vh;overflow:auto}
.accordion-item{border-bottom:1px solid var(--border);background:transparent}
.accordion-header{background:transparent}
.accordion-button{background:transparent;border:none;color:var(--text-01);text-align:left;width:100%;padding:12px;display:flex;justify-content:space-between;align-items:center}
.accordion-button:hover{background:var(--layer-2)}
.accordion-button[aria-expanded="true"]{background:linear-gradient(90deg, rgba(15,98,254,0.04), transparent)}
/* Accordion body: animate height for smooth open/close */
.accordion-body{background:var(--layer-2);padding:0 12px;color:var(--text-02);overflow:hidden;max-height:0;transition:max-height 400ms cubic-bezier(0.4, 0, 0.2, 1), padding 400ms cubic-bezier(0.4, 0, 0.2, 1);}
.accordion-body .body-inner{padding:12px 0}
.data-table{width:100%;border-collapse:collapse;table-layout:fixed;max-width:100%}
/* Left align everything in the table and use muted header color */
.data-table th,.data-table td{padding:10px 8px;border-bottom:1px dashed rgba(255,255,255,0.03);font-size:13px;color:var(--text-02);text-align:left;vertical-align:middle;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.data-table thead th{color:#8d8d8d;background:var(--layer);font-weight:600;text-transform:uppercase;font-size:12px;letter-spacing:0.32px;position:sticky;top:0;z-index:10}
.data-table td .port-badge{margin-right:10px;display:inline-block}
/* Fixed column widths for consistency */
.data-table th:nth-child(1), .data-table td:nth-child(1){width:12%}
.data-table th:nth-child(2), .data-table td:nth-child(2){width:12%}
.data-table th:nth-child(3), .data-table td:nth-child(3){width:20%}
.data-table th:nth-child(4), .data-table td:nth-child(4){width:18%}
.data-table th:nth-child(5), .data-table td:nth-child(5){width:15%}
/* Accordion actions (right side) */
.accordion-header{display:flex;align-items:center;justify-content:space-between;padding:0}
.accordion-left{display:flex;align-items:center;gap:12px;flex:1}
.accordion-right{display:flex;align-items:center;gap:8px}
/* Make Copy and View buttons EXACTLY the same size, no rounded edges */
.accordion-actions .btn-ghost,
.accordion-actions .bx--btn{
padding:8px 12px;
font-size:13px;
border-radius:0;
border:1px solid var(--border);
background:transparent;
color:var(--text-01);
min-width:90px;
text-align:center;
cursor:pointer;
transition:background 120ms ease;
}
.accordion-actions .btn-ghost:hover,
.accordion-actions .bx--btn:hover{
background:var(--layer-2);
}
/* Slightly more breathing room between ports entries in lists */
.list-item{padding:10px}
/* Custom sleeker scrollbar - no rounded edges */
/* WebKit */
::-webkit-scrollbar{height:10px;width:10px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:linear-gradient(180deg,rgba(255,255,255,0.06),rgba(255, 255, 255, 0.03));border-radius:0;border:2px solid rgba(0,0,0,0)}
::-webkit-scrollbar-thumb:hover{background:linear-gradient(180deg,rgba(0, 60, 255, 0.09),rgba(0, 4, 255, 0.04))}
/* Firefox */
*{scrollbar-width:thin;scrollbar-color: rgba(255, 255, 255, 0.06) transparent}
/* Controls and search */
.search{margin-top:8px}
.search input{width:100%;padding:8px;border:1px solid var(--border);background:var(--layer-2);color:var(--text-01);border-radius:0}
.search input:focus{outline:2px solid rgba(15,98,254,0.12);border-radius:0}
/* Chart */
.chart-card{background:var(--layer-2);border:1px solid var(--border);padding:10px;margin-top:10px;}
/* Buttons */
.btn-ghost{background:transparent;border:1px solid var(--border);color:var(--text-01);padding:6px 10px;border-radius:0;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:6px}
.btn-ghost:hover{background:var(--layer-2)}
.github-link{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:8px 12px;border:1px solid var(--border);background:transparent;color:var(--text-01);cursor:pointer;text-decoration:none;border-radius:0;min-width:40px;height:36px;transition:all 150ms ease}
.github-link svg{width:18px;height:18px;fill:currentColor}
.github-link:hover{background:var(--layer-2)}
/* Overflow menu for small screens */
.overflow-menu{position:relative;display:none}
.overflow-toggle{display:flex;align-items:center;justify-content:center;width:36px;height:36px;padding:0;border:1px solid var(--border);background:transparent;color:var(--text-01);cursor:pointer;border-radius:0;transition:all 150ms ease}
.overflow-toggle:hover{background:var(--layer-2)}
.overflow-toggle svg{width:20px;height:20px;fill:currentColor}
.overflow-dropdown{display:none;position:absolute;top:calc(100% + 4px);right:0;background:var(--layer);border:1px solid var(--border);padding:8px;min-width:180px;z-index:1000;box-shadow:0 8px 24px rgba(0,0,0,0.5)}
.overflow-dropdown.active{display:flex;flex-direction:column;gap:6px}
.overflow-dropdown .bx--btn, .overflow-dropdown .github-link{width:100%;justify-content:flex-start}
/* Table scroll indicator */
.table-wrapper{position:relative;overflow:hidden}
.table-wrapper::after{content:'';position:absolute;top:0;right:0;bottom:0;width:40px;background:linear-gradient(90deg,transparent,var(--layer-2));pointer-events:none;opacity:0;transition:opacity 200ms ease}
.table-wrapper.has-scroll::after{opacity:1}
/* Small utilities */
.small-muted{color:var(--text-02);font-size:13px}
.mono{font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', monospace}
/* Floating Dock */
.floating-dock{
position:fixed;
bottom:20px;
left:50%;
transform:translateX(-50%);
background:var(--layer);
border:1px solid var(--border);
border-radius:0;
padding:8px 12px;
display:flex;
gap:8px;
align-items:center;
box-shadow:0 8px 24px rgba(0,0,0,0.3);
z-index:2000;
backdrop-filter:blur(10px);
}
.dock-btn{
background:transparent;
border:1px solid transparent;
color:var(--text-01);
padding:10px;
border-radius:0;
cursor:pointer;
transition:all 200ms ease;
display:flex;
align-items:center;
justify-content:center;
gap:6px;
min-width:44px;
min-height:44px;
text-decoration:none;
}
.dock-btn:hover{
background:var(--interactive);
color:#ffffff;
border-color:var(--interactive);
transform:translateY(-2px);
}
.dock-btn:active{transform:translateY(0)}
.dock-btn svg{width:20px;height:20px;flex-shrink:0}
.dock-separator{width:1px;height:32px;background:var(--border);margin:0 4px}
/* Export Modal */
.export-modal{
display:none;
position:fixed;
top:0;
left:0;
right:0;
bottom:0;
background:rgba(0,0,0,0.6);
z-index:3000;
align-items:center;
justify-content:center;
}
.export-modal.active{display:flex}
.export-modal-content{
background:var(--layer);
border:1px solid var(--border);
border-radius:0;
padding:24px;
max-width:400px;
width:90%;
}
.export-modal-content h3{margin:0 0 16px 0}
/* Clear Data modal text color per theme */
html[data-theme="light"] #clearConfirmModal .export-modal-content h3,
html[data-theme="light"] #clearConfirmModal .export-modal-content p{color:var(--text-01)}
html:not([data-theme="light"]) #clearConfirmModal .export-modal-content h3,
html:not([data-theme="light"]) #clearConfirmModal .export-modal-content p{color:#ffffff}
.export-options{display:flex;flex-direction:column;gap:8px}
.export-option-btn{
width:100%;
padding:12px 16px;
background:var(--layer-2);
border:1px solid var(--border);
border-radius:0;
color:var(--text-01);
cursor:pointer;
transition:all 150ms ease;
display:flex;
align-items:center;
gap:12px;
font-size:14px;
}
.export-option-btn:hover{background:var(--interactive);color:#ffffff;border-color:var(--interactive)}
/* Ensure destructive confirm stays red and readable, not overridden by generic hover */
#confirmClearBtn{background:var(--support-error) !important;color:#ffffff !important;border-color:var(--support-error) !important}
#confirmClearBtn:hover,#confirmClearBtn:focus{background:var(--support-error) !important;color:#ffffff !important;border-color:#ba1b23 !important}
/* In LIGHT mode, the Clear Data option must use dark text (not white) */
html[data-theme="light"] #confirmClearBtn,
html[data-theme="light"] #confirmClearBtn:hover,
html[data-theme="light"] #confirmClearBtn:focus{color:var(--text-01) !important}
#confirmClearBtn svg{fill:currentColor}
.export-option-btn svg{width:20px;height:20px}
.export-option-btn:focus-visible{outline:2px solid var(--interactive);outline-offset:2px}
@media (prefers-reduced-motion: reduce){
.count-up{animation:none}
}
/* Cancel buttons should not switch to white text on light backgrounds */
/* Cancel buttons: readable by default and on hover */
#cancelClearBtn, #cancelExportBtn{background:var(--layer);color:var(--text-01) !important;border:1px solid var(--border)}
#cancelClearBtn svg, #cancelExportBtn svg{fill:currentColor}
#cancelClearBtn:hover, #cancelExportBtn:hover{background:var(--layer-2);color:var(--text-01) !important;border-color:var(--interactive)}
/* Responsive dock - icons only on mobile, icons+text on tablet/desktop */
@media (max-width:640px){
.dock-btn-text{display:none}
.dock-btn{min-width:44px;padding:10px}
.dock-mobile-only{display:flex}
}
@media (min-width:641px){
.dock-btn{padding:10px 16px}
.dock-mobile-only{display:none}
}
/* Floating GitHub Icon */
.floating-github{
width:48px;
height:48px;
background:var(--interactive);
color:#ffffff;
border:1px solid var(--border);
display:flex;
align-items:center;
justify-content:center;
cursor:pointer;
transition:background 200ms ease;
text-decoration:none;
}
.floating-github:hover{
background:rgba(15,98,254,0.9);
}
.floating-github svg{
width:28px;
height:28px;
fill:currentColor;
}
/* === NEW ENHANCEMENTS === */
/* Loading & Empty States */
.empty-state{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px;text-align:center;min-height:400px}
.empty-state-icon{width:80px;height:80px;margin-bottom:20px;opacity:0.3}
.empty-state h3{margin:0 0 12px 0;font-size:20px;color:var(--text-01)}
.empty-state p{margin:0 0 24px 0;color:var(--text-02);max-width:400px}
.skeleton{background:linear-gradient(90deg,var(--layer-2) 25%, var(--layer) 50%, var(--layer-2) 75%);background-size:200% 100%;animation:shimmer 1.5s infinite;border-radius:0;height:20px}
@keyframes shimmer{0%{background-position:200% 0}100%{background-position:-200% 0}}
.loading-overlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(22,22,22,0.9);display:none;align-items:center;justify-content:center;z-index:10000;backdrop-filter:blur(4px)}
.loading-overlay.active{display:flex}
.loading-content{display:flex;flex-direction:column;align-items:center;justify-content:center}
.spinner{width:48px;height:48px;border:4px solid var(--border);border-top-color:var(--interactive);border-radius:50%;animation:spin 0.8s linear infinite;margin:0 auto}
@keyframes spin{to{transform:rotate(360deg)}}
/* Theme Toggle */
.theme-toggle{display:flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--border);background:transparent;color:var(--text-01);cursor:pointer;border-radius:0;transition:all 150ms ease}
.theme-toggle:hover{background:var(--layer-2)}
.theme-toggle svg{width:16px;height:16px;fill:currentColor}
/* Light mode variables */
[data-theme="light"]{
--bg:#ffffff;
--layer:#f4f4f4;
--layer-2:#e0e0e0;
--text-01:#161616;
--text-02:#525252;
--border:rgba(0,0,0,0.1);
}
/* Light mode specific fixes */
[data-theme="light"] .subtitle a,
[data-theme="light"] .social-links a{
color:#0f62fe;
}
[data-theme="light"] .subtitle a:hover,
[data-theme="light"] .social-links a:hover{
color:#0043ce;
text-decoration:underline;
}
[data-theme="light"] .svc-link{
color:#0f62fe;
font-weight:600;
}
[data-theme="light"] .svc-pill{
background:#0f62fe;
color:#ffffff;
}
/* Port State Colors */
.port-state-open{color:#42be65;font-weight:600}
.port-state-filtered{color:#f1c21b;font-weight:600}
.port-state-closed{color:#da1e28;font-weight:600}
.port-badge.vulnerable{background:#da1e28;animation:pulse 2s infinite}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:0.7}}
/* Keyboard Shortcuts Modal */
.shortcuts-modal{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:var(--layer);border:1px solid var(--border);padding:24px;max-width:500px;width:90%;z-index:10001;box-shadow:0 16px 48px rgba(0,0,0,0.7)}
.shortcuts-modal.active{display:block}
.shortcuts-modal h3{margin:0 0 16px 0}
.shortcut-item{display:flex;justify-content:space-between;align-items:center;padding:8px 0;border-bottom:1px dashed var(--border)}
.shortcut-key{background:var(--layer-2);padding:4px 8px;border:1px solid var(--border);font-family:monospace;font-size:12px}
/* Tooltips */
.tooltip{position:relative;cursor:help}
.tooltip::after{content:attr(data-tooltip);position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);background:rgba(0,0,0,0.9);color:white;padding:6px 10px;font-size:12px;white-space:nowrap;border-radius:0;opacity:0;pointer-events:none;transition:opacity 200ms ease;z-index:1000}
.tooltip:hover::after{opacity:1}
/* Drag & Drop Zone */
.drop-zone{border:2px dashed var(--border);padding:40px;text-align:center;transition:all 200ms ease;cursor:pointer;background:rgba(15,98,254,0.03);border-radius:4px}
.drop-zone:hover,.drop-zone.drag-over{border-color:var(--interactive);background:rgba(15,98,254,0.08)}
.drop-zone-icon{width:48px;height:48px;margin:0 auto 12px;opacity:0.4}
/* File Info Banner */
.file-info{display:none;padding:8px 12px;background:var(--layer-2);border-bottom:1px solid var(--border);font-size:12px;color:var(--text-02);justify-content:space-between;align-items:center}
.file-info.active{display:flex}
.file-info-name{font-weight:600;color:var(--text-01)}
/* Vulnerability Badge */
.vuln-badge{display:inline-flex;align-items:center;gap:4px;padding:4px 8px;background:#da1e28;color:white;font-size:11px;font-weight:700;border-radius:0}
.vuln-badge svg{width:12px;height:12px;fill:currentColor}
/* Count-up animation */
@keyframes countUp{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}
.count-up{animation:countUp 0.4s ease-out}
/* Focus indicators */
*:focus-visible{outline:2px solid var(--interactive);outline-offset:2px}
/* ARIA live region */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
/* Responsive */
@media (max-width:980px){
.container{margin:18px auto;padding-top:1em;max-width:calc(100% - 36px)}
.summary-row{grid-template-columns:repeat(2, 1fr)}
.summary-grid{grid-template-columns:1fr}
.chart-card{margin-top:12px}
/* header maintains grid layout but smaller */
header{grid-template-columns:40px 1fr 40px;gap:10px;padding:12px}
.brand{gap:4px}
.logo{width:40px;height:40px}
.floating-github{width:40px;height:40px}
.floating-github svg{width:24px;height:24px}
.controls{margin-top:0;flex-wrap:wrap;justify-content:flex-start;gap:8px;width:100%}
.controls .bx--btn, .controls .github-link, .controls .btn-ghost, .controls label.file-btn{padding:6px 10px;min-width:unset;font-size:13px}
.overflow-menu{display:none} /* no hamburger on tablet */
/* make panels breathe less on smaller screens */
.panel{padding:10px}
h1{font-size:16px}
.data-table th,.data-table td{padding:8px 6px;font-size:12px}
.accordion-actions .btn-ghost, .accordion-actions .bx--btn{min-width:70px;padding:6px 8px}
/* allow table to scroll horizontally on narrow screens */
.data-table{display:block;overflow:auto;white-space:nowrap}
.modal-content{width:95vw}
}
@media (max-width:640px){
.container{margin:12px auto;padding-top:1em;max-width:calc(100% - 24px)}
/* Mobile header - smaller 3-column grid */
.summary-row{grid-template-columns:repeat(2, 1fr)}
header{grid-template-columns:36px 1fr 36px;gap:8px;padding:10px}
.brand{gap:2px}
.subtitle{font-size:11px}
.logo{width:36px;height:36px;font-size:16px}
.floating-github{width:36px;height:36px}
.floating-github svg{width:20px;height:20px}
h1{font-size:15px}
.panel{padding:8px;overflow-x:auto}
.list-item{padding:8px}
.data-table{display:block;overflow-x:auto;white-space:nowrap;min-width:600px}
.data-table thead th{font-size:11px}
.modal-content{width:100vw;max-height:100vh;margin:0;height:100vh}
.modal-body{padding:12px}
.modal-body pre{font-size:12px}
.accordion-button{padding:10px}
.accordion-actions .btn-ghost, .accordion-actions .bx--btn{min-width:64px;padding:6px 6px;font-size:12px}
/* Mobile search area - make more compact */
#searchType{flex:0 0 80px !important;font-size:12px;padding:6px !important}
#searchInput{font-size:12px;padding:6px !important}
#copyIPs{font-size:12px;padding:6px 8px !important;white-space:nowrap}
}
/* === Layout Width Adjustments === */
/* Make the right (IP Inventory) panel slightly wider */
#ip-inventory-panel {
flex: 0.7 !important;
}
/* Make the left (Summary/Dashboard) panel smaller */
#dashboard-panel {
flex: 0.3 !important;
}
/* Expand charts and stats to fit new proportions */
#dashboard-panel canvas {
width: 100% !important;
}
/* === Modal for View Raw === */
.modal-overlay{
display:none;
position:fixed;
top:0;
left:0;
right:0;
bottom:0;
background:rgba(0,0,0,0.75);
z-index:9999;
align-items:center;
justify-content:center;
backdrop-filter:blur(2px);
}
.modal-overlay.active{display:flex}
.modal-content{
background:var(--layer);
border:1px solid var(--border);
max-width:90vw;
max-height:90vh;
width:900px;
display:flex;
flex-direction:column;
box-shadow:0 12px 48px rgba(0,0,0,0.6);
border-radius:0;
}
.modal-header{
display:flex;
justify-content:space-between;
align-items:center;
padding:16px 20px;
border-bottom:1px solid var(--border);
background:var(--layer-2);
}
.modal-header h2{margin:0;font-size:16px;color:var(--text-01)}
.modal-close{
background:transparent;
border:1px solid var(--border);
color:var(--text-01);
padding:6px 12px;
cursor:pointer;
border-radius:0;
font-size:13px;
}
.modal-close:hover{background:var(--layer)}
.modal-body{
flex:1;
overflow:auto;
padding:20px;
background:var(--bg);
}
.modal-body pre{
margin:0;
padding:16px;
background:var(--layer-2);
border:1px solid var(--border);
border-radius:0;
overflow:auto;
font-family:ui-monospace, SFMono-Regular, Menlo, Monaco, 'Roboto Mono', monospace;
font-size:13px;
line-height:1.6;
color:var(--text-01);
}
.modal-body pre code{
display:block;
white-space:pre;
}
/* Simple syntax highlighting for XML */
.xml-tag{color:#78a9ff}
.xml-attr{color:#42be65}
.xml-value{color:#ee5396}
.xml-comment{color:#8d8d8d;font-style:italic}
a {
color: white;
text-decoration: none;
}
</style>
<script defer src="https://cloud.umami.is/script.js" data-website-id="78d168ab-1201-4551-9d40-92056d995e41"></script>
</head>
<body>
<div class="container">
<header>
<!-- Column 1: Logo -->
<div class="logo">
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" fill="currentColor" viewBox="0 0 16 16">
<path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0"/>
<path d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8m8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7"/>
</svg>
</div>
<!-- Column 2: Branding Info -->
<div class="brand">
<h1>Nmap XML Analyzer / Visualizer</h1>
<div class="subtitle">Made with Love ❤️ - Designed by Suman Roy</div>
<div class="subtitle" style="margin-top: 5px; font-weight: bold; padding-top: 5px;display: flex; justify-content: flex-start; gap: 10px;">
<a href="https://www.linkedin.com/in/sumanrox">LinkedIn</a>
<a href="https://github.com/sumanrox">GitHub</a>
<a href="https://linktr.ee/sumanroy.official">Portfolio</a>
</div>
</div>
<!-- Column 3: GitHub Icon -->
<a href="https://github.com/sumanrox/sumanrox.github.io" target="_blank" rel="noopener noreferrer" class="floating-github" aria-label="View on GitHub">
<svg viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.28.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.19 0 .21.15.46.55.38A8.013 8.013 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
</svg>
</a>
<div class="controls" role="region" aria-label="controls" style="position:absolute;left:-9999px;opacity:0">
<!-- Hidden buttons for dock to trigger -->
<button id="loadExample"></button>
<button id="exportJson"></button>
<button id="exportCsv"></button>
<button id="exportPdf"></button>
<button id="clearData"></button>
<button id="themeToggle" class="theme-toggle" aria-label="Toggle theme">
<svg viewBox="0 0 24 24" class="theme-icon-dark"><path d="M9 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm6.219 1.781a1 1 0 011.414 0l.707.707a1 1 0 11-1.414 1.414l-.707-.707a1 1 0 010-1.414zM12 7a5 5 0 100 10 5 5 0 000-10zm-7 4a1 1 0 100 2H3a1 1 0 100-2h2zm13 0a1 1 0 110 2h-2a1 1 0 110-2h2zM7.05 16.95a1 1 0 011.414 0l.707.707a1 1 0 11-1.414 1.414l-.707-.707a1 1 0 010-1.414zm9.9 0a1 1 0 011.414 1.414l-.707.707a1 1 0 11-1.414-1.414l.707-.707zM9 19a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1z"/></svg>
<svg viewBox="0 0 24 24" class="theme-icon-light" style="display:none"><path d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg>
</button>
<button id="keyboardHelp" class="btn-ghost tooltip" data-tooltip="Keyboard shortcuts" aria-label="Keyboard shortcuts">
<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
<path d="M8 1a7 7 0 100 14A7 7 0 008 1zm0 13A6 6 0 118 2a6 6 0 010 12zm-.5-9h1v5h-1V5zm0 6h1v1h-1v-1z"/>
</svg>
</button>
</div>
</header>
<!-- File Info Banner -->
<div id="fileInfo" class="file-info">
<div>
<span class="file-info-name" id="fileName"></span>
<span id="scanDate" style="margin-left:12px"></span>
</div>
<div id="scanMeta" style="font-size:11px"></div>
</div>
<!-- Drag & Drop Zone (shown when empty) -->
<div id="dropZone" class="drop-zone" style="display:none">
<svg class="drop-zone-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</svg>
<h3>Drop Nmap XML file here</h3>
<p class="small-muted">or use "Load Scan" button below</p>
</div>
<!-- Empty State -->
<div id="emptyState" class="empty-state">
<svg class="empty-state-icon" viewBox="0 0 24 24" fill="currentColor">
<path d="M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</svg>
<h3>No Scan Data</h3>
<p style="margin:16px 0 24px 0;max-width:480px">Drag and drop your Nmap XML scan file here, or click the button below to browse and upload.</p>
<button id="uploadEmptyStateBtn" class="bx--btn bx--btn--primary" style="display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:12px 24px;line-height:1">
<svg width="20" height="20" viewBox="0 0 16 16" fill="currentColor" style="flex-shrink:0">
<path d="M8 2l5 5h-3v5H6V7H3l5-5zm-6 9v4h12v-4h1v5H1v-5h1z"/>
</svg>
Upload Scan File
</button>
<input type="file" id="fileEmptyState" accept=".xml" style="display:none" />
<p class="small-muted" style="margin-top:16px">Supports .xml files only</p>
</div>
<div class="grid" id="mainContent" style="display:none">
<!-- Stats Row - Full Width -->
<section class="summary-row">
<div class="panel">
<div class="small-muted">Hosts</div>
<div id="statHosts" style="font-size:24px;font-weight:700;margin-top:6px">0</div>
</div>
<div class="panel">
<div class="small-muted">Unique Ports</div>
<div id="statUniquePorts" style="font-size:24px;font-weight:700;margin-top:6px">0</div>
</div>
<div class="panel">
<div class="small-muted">Services</div>
<div id="statServices" style="font-size:24px;font-weight:700;margin-top:6px">0</div>
</div>
<div class="panel">
<div class="small-muted">Open Ports</div>
<div id="statOpenPorts" style="font-size:24px;font-weight:700;margin-top:6px">0</div>
</div>
</section>
<!-- Summary Section: 2-Column Layout -->
<div class="summary-grid">
<!-- Left Column: Risks & Open Ports Table -->
<section class="panel">
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px">
<h3 style="margin:0">Open Ports</h3>
<button id="toggleClosedPorts" class="btn-ghost" style="padding:6px 10px;font-size:12px">
<svg width="14" height="14" viewBox="0 0 16 16" fill="currentColor">
<path d="M8 1a7 7 0 100 14A7 7 0 008 1zm0 13A6 6 0 118 2a6 6 0 010 12zm3-6.5v1H5v-1h6z"/>
</svg>
Show Closed
</button>
</div>
<!-- Vulnerabilities Section -->
<div id="vulnSection" style="display:none;margin-bottom:16px">
<h3 style="color:#da1e28;margin:0 0 12px 0">⚠ Potential Risks</h3>
<div id="vulnList" class="list-group" style="max-height:30vh;overflow:auto"></div>
</div>
<div style="max-height:50vh;overflow:auto">
<table id="portsTable" class="data-table">
<thead>
<tr>
<th style="text-align:left">Port</th>
<th style="text-align:left">Protocol</th>
<th style="text-align:left">Service</th>
<th style="text-align:right">Status</th>
<th style="text-align:right">Count</th>
</tr>
</thead>
<tbody id="portsTableBody"></tbody>
</table>
</div>
</section>
<!-- Right Column: Services Chart -->
<section class="panel">
<h3 style="margin:0 0 12px 0">Top Services</h3>
<div id="servicesChart">
<canvas id="servicesChartCanvas" height="500"></canvas>
</div>
</section>
</div>
<!-- IP Inventory - Full Width -->
<section class="panel" id="ip-inventory-panel">
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;flex-wrap:wrap;gap:12px">
<div>
<h3 style="margin:0">IP Inventory</h3>
<div class="small-muted">Click an IP to view port details</div>
</div>
<div style="display:flex;gap:8px;align-items:center;flex:1;max-width:600px">
<select id="searchType" style="padding:8px;border:1px solid var(--border);background:var(--layer-2);color:var(--text-01);border-radius:0;flex:0 0 110px">
<option value="all">All Fields</option>
<option value="ip">IP Address</option>
<option value="port">Port</option>
<option value="service">Service</option>
</select>
<input id="searchInput" placeholder="search..." aria-label="search" style="flex:1;padding:8px;border:1px solid var(--border);background:var(--layer-2);color:var(--text-01);border-radius:0" />
<button id="clearSearch" class="btn-ghost" style="padding:8px 12px;display:none" aria-label="Clear search">✕</button>
<button id="copyIPs" class="btn-ghost">Copy All IPs</button>
</div>
</div>
<div id="searchResults" class="small-muted" style="margin-bottom:8px;display:none"></div>
<div id="ipAccordion" class="accordion"></div>
</section>
</div>
<!-- Floating Dock -->
<div class="floating-dock">
<button class="dock-btn" id="dockLoadExample" title="Load Example">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor">
<path d="M.5 0a.5.5 0 0 1 .5.5v15a.5.5 0 0 1-1 0V.5A.5.5 0 0 1 .5 0M2 1.5a.5.5 0 0 1 .5-.5h4a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-4a.5.5 0 0 1-.5-.5zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5zm2 4a.5.5 0 0 1 .5-.5h6a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-6a.5.5 0 0 1-.5-.5zm2 4a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v1a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5z"/>
</svg>
<span class="dock-btn-text">Load Example</span>
</button>
<button class="dock-btn" id="dockClearData" title="Clear Data" style="display:none">
<svg viewBox="0 0 16 16" fill="currentColor">
<path d="M12 4h3c.6 0 1 .4 1 1s-.4 1-1 1h-1v9c0 .6-.4 1-1 1H3c-.6 0-1-.4-1-1V6H1c-.6 0-1-.4-1-1s.4-1 1-1h3V2c0-.6.4-1 1-1h6c.6 0 1 .4 1 1v2zM4 6v8h8V6H4zm2-4v2h4V2H6z"/>
</svg>
<span class="dock-btn-text">Clear Data</span>
</button>
<div class="dock-separator"></div>
<label for="dockFileInput" class="dock-btn" title="Load Scan" style="margin:0">
<svg viewBox="0 0 16 16" fill="currentColor">
<path d="M7.5 1v6.5H1v1h6.5V15h1V8.5H15v-1H8.5V1h-1z"/>
</svg>
<span class="dock-btn-text">Load Scan</span>
</label>
<input type="file" id="dockFileInput" accept=".xml" style="display:none" />
<button class="dock-btn" id="dockExportData" title="Export Data">
<svg viewBox="0 0 16 16" fill="currentColor">
<path d="M2 2h5v1H3v10h10V8h1v6H2V2zm6 0h6v6h-1V3.7l-5.6 5.6-.7-.7L12.3 3H8V2z"/>
</svg>
<span class="dock-btn-text">Export Data</span>
</button>
<!-- Theme toggle - all screen sizes -->
<div class="dock-separator"></div>
<button class="dock-btn" id="dockThemeToggle" title="Toggle Theme">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 16 16" class="theme-icon">
<path d="M2 6a6 6 0 1 1 10.174 4.31c-.203.196-.359.4-.453.619l-.762 1.769A.5.5 0 0 1 10.5 13h-5a.5.5 0 0 1-.46-.302l-.761-1.77a2 2 0 0 0-.453-.618A5.98 5.98 0 0 1 2 6m3 8.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1l-.224.447a1 1 0 0 1-.894.553H6.618a1 1 0 0 1-.894-.553L5.5 15a.5.5 0 0 1-.5-.5"/>
</svg>
<span class="dock-btn-text">Theme</span>
</button>
<!-- Keyboard help - all screen sizes -->
<button class="dock-btn" id="dockKeyboardHelp" title="Keyboard shortcuts">
<svg viewBox="0 0 16 16" fill="currentColor">
<path d="M8 1a7 7 0 100 14A7 7 0 008 1zm0 13A6 6 0 118 2a6 6 0 010 12zm-.5-9h1v5h-1V5zm0 6h1v1h-1v-1z"/>
</svg>
<span class="dock-btn-text">Help</span>
</button>
</div>
<!-- Export Modal -->
<div class="export-modal" id="exportModal" role="dialog" aria-modal="true" aria-labelledby="exportModalTitle">
<div class="export-modal-content">
<h3 id="exportModalTitle">Export Data</h3>
<div class="export-options">
<button class="export-option-btn" id="exportModalJson">
<svg viewBox="0 0 16 16" fill="currentColor">
<path d="M13 11v3H3v-3H2v3c0 .55.45 1 1 1h10c.55 0 1-.45 1-1v-3h-1zm-1-1l-1.41-1.41L9 10.17V3H7v7.17L5.41 8.59 4 10l4 4 4-4z"/>
</svg>
Export as JSON
</button>
<button class="export-option-btn" id="exportModalCsv">
<svg viewBox="0 0 16 16" fill="currentColor">
<path d="M13 11v3H3v-3H2v3c0 .55.45 1 1 1h10c.55 0 1-.45 1-1v-3h-1zm-1-1l-1.41-1.41L9 10.17V3H7v7.17L5.41 8.59 4 10l4 4 4-4z"/>
</svg>
Export as CSV
</button>
<button class="export-option-btn" id="exportModalPdf">
<svg viewBox="0 0 16 16" fill="currentColor">
<path d="M13 11v3H3v-3H2v3c0 .55.45 1 1 1h10c.55 0 1-.45 1-1v-3h-1zm-1-1l-1.41-1.41L9 10.17V3H7v7.17L5.41 8.59 4 10l4 4 4-4z"/>
</svg>
Export as PDF
</button>
<button class="export-option-btn" id="cancelExportBtn" onclick="document.getElementById('exportModal').classList.remove('active')" style="background:var(--layer);margin-top:8px">
Cancel
</button>
</div>
</div>
</div>
</div>
<!-- Clear Data Confirmation Modal -->
<div class="export-modal" id="clearConfirmModal" role="dialog" aria-modal="true" aria-labelledby="clearConfirmTitle">
<div class="export-modal-content">
<h3 id="clearConfirmTitle">Clear All Data?</h3>
<p style="margin:16px 0">This will remove all loaded scan data. This action cannot be undone.</p>
<div class="export-options">
<button class="export-option-btn" id="confirmClearBtn">
<svg viewBox="0 0 16 16" fill="currentColor">
<path d="M11 2H5L4 3H1v2h14V3h-3l-1-1zM3 6v9c0 .55.45 1 1 1h8c.55 0 1-.45 1-1V6H3z"/>
</svg>
Clear Data
</button>
<button class="export-option-btn" id="cancelClearBtn" style="background:var(--layer);margin-top:8px">
Cancel
</button>
</div>
</div>
</div>
<!-- Modal for viewing raw XML -->
<div id="rawModal" class="modal-overlay" role="dialog" aria-modal="true" aria-labelledby="modalTitle">
<div class="modal-content">
<div class="modal-header">
<h2 id="modalTitle">Raw XML</h2>
<div style="display:flex;gap:8px">
<button id="copyRawXml" class="btn-ghost">Copy XML</button>
<button id="modalClose" class="modal-close">Close</button>
</div>
</div>
<div class="modal-body">
<pre id="modalXml"><code></code></pre>
</div>
</div>
</div>
<!-- Keyboard Shortcuts Modal -->
<div id="shortcutsModal" class="shortcuts-modal">
<h3>Keyboard Shortcuts</h3>
<div class="shortcut-item">
<span>Search</span>
<kbd class="shortcut-key">/</kbd>
</div>
<div class="shortcut-item">
<span>Show this help</span>
<kbd class="shortcut-key">?</kbd>
</div>
<div class="shortcut-item">
<span>Close modal</span>
<kbd class="shortcut-key">Esc</kbd>
</div>
<div class="shortcut-item">
<span>Load example</span>
<kbd class="shortcut-key">Ctrl + L</kbd>
</div>
<div class="shortcut-item">
<span>Clear data</span>
<kbd class="shortcut-key">Ctrl + K</kbd>
</div>
<div style="margin-top:16px;text-align:right">
<button id="closeShortcuts" class="btn-ghost">Close</button>
</div>
</div>
<!-- Loading Overlay -->
<div id="loadingOverlay" class="loading-overlay">
<div class="loading-content">
<div class="spinner"></div>
<div style="margin-top:16px;color:var(--text-01);text-align:center">Parsing XML...</div>
</div>
</div>
<!-- ARIA Live Region -->
<div id="ariaLive" class="sr-only" role="status" aria-live="polite" aria-atomic="true"></div>
<!-- Chart.js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>
<!-- jsPDF for PDF export -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script>
/* Production JS: robust parsing, edge-case handling, and UI wiring */
(function(){
'use strict';
// Data model
let DATA = {ips:{}, ports:{}, services:{}, hostCount:0};
let ACTIVE_FILTER = {type:null, key:null};
let showClosedPorts = false;
let portsChart = null;
let servicesChart = null;
// ============================================================================
// ELEMENT REFERENCES - Query all DOM elements needed for the application
// ============================================================================
const fileEl = document.getElementById('file');
const loadExample = document.getElementById('loadExample');
const exportJson = document.getElementById('exportJson');
const exportCsv = document.getElementById('exportCsv');
const exportPdf = document.getElementById('exportPdf');
const clearData = document.getElementById('clearData');
const themeToggle = document.getElementById('themeToggle');
const keyboardHelp = document.getElementById('keyboardHelp');
const servicesChartCanvas = document.getElementById('servicesChartCanvas');
const ipAccordion = document.getElementById('ipAccordion');
const searchInput = document.getElementById('searchInput');
const searchType = document.getElementById('searchType');
const clearSearch = document.getElementById('clearSearch');
const searchResults = document.getElementById('searchResults');
// Debug: Log if critical buttons are found
console.log('🔍 Button Check:', {
loadExample: !!loadExample,
exportJson: !!exportJson,
themeToggle: !!themeToggle,
keyboardHelp: !!keyboardHelp
});
const statHosts = document.getElementById('statHosts');
const statUniquePorts = document.getElementById('statUniquePorts');
const statServices = document.getElementById('statServices');
const statOpenPorts = document.getElementById('statOpenPorts');
const copyIPs = document.getElementById('copyIPs');
const toggleClosedPorts = document.getElementById('toggleClosedPorts');
const emptyState = document.getElementById('emptyState');
const mainContent = document.getElementById('mainContent');
const dropZone = document.getElementById('dropZone');
const fileInfo = document.getElementById('fileInfo');
const fileName = document.getElementById('fileName');
const scanDate = document.getElementById('scanDate');
const scanMeta = document.getElementById('scanMeta');
const vulnSection = document.getElementById('vulnSection');
const vulnList = document.getElementById('vulnList');
const loadingOverlay = document.getElementById('loadingOverlay');
const ariaLive = document.getElementById('ariaLive');
const loadExampleFromEmpty = document.getElementById('loadExampleFromEmpty');
// Modal elements
const rawModal = document.getElementById('rawModal');
const modalClose = document.getElementById('modalClose');
const modalXml = document.getElementById('modalXml');
const modalTitle = document.getElementById('modalTitle');
const copyRawXml = document.getElementById('copyRawXml');
const shortcutsModal = document.getElementById('shortcutsModal');
const closeShortcuts = document.getElementById('closeShortcuts');
// State
let currentFileName = '';
let searchDebounceTimer = null;
let lastExportFormat = localStorage.getItem('lastExportFormat') || 'json';
// Vulnerable ports database
const VULNERABLE_PORTS = {
21: 'FTP - Unencrypted file transfer',
23: 'Telnet - Unencrypted remote access',
25: 'SMTP - Email relay vulnerability',
135: 'MS-RPC - Remote code execution',
139: 'NetBIOS - Information disclosure',
445: 'SMB - EternalBlue vulnerability',
1433: 'MSSQL - SQL injection risk',
3306: 'MySQL - Database exposure',
3389: 'RDP - Brute force target',
5432: 'PostgreSQL - Database exposure',
5900: 'VNC - Weak authentication',
8080: 'HTTP Proxy - Often misconfigured'
};
// Helpers
const prefersReducedMotion = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches;
const escapeHtml = s => String(s||'').replace(/[&<>"']/g, c=> ({'&':'&','<':'<','>':'>','"':'"',"'":"'"})[c]);
// Show/hide loading
function showLoading(){ loadingOverlay.classList.add('active'); }
function hideLoading(){ loadingOverlay.classList.remove('active'); }