-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
4331 lines (3655 loc) · 180 KB
/
main.py
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
"""
Developer: Gustavo Rosas
Profile: https://www.linkedin.com/in/gustavorosas-/
"""
from src.manager import *
all_cve_categories = get_cve_vulnerability_categories(cve_json_path)
all_cve_codes = get_all_cve_vulnerability_codes(cve_json_path)
def change_app_language(new_language):
home_tab_menu_appearance_dropdown_option = ctk.get_appearance_mode()
# Define active scrollable frame (in "Configure" tab)
configure_tab_first_container_first_scrollable_frame.pack(fill=ctk.BOTH,
expand=True,
padx=10, pady=10)
configure_tab_first_container_second_scrollable_frame.pack_forget()
match new_language:
case 'en':
# region 🔵 "Home" Tab
# region Container "Menu"
home_tab_menu_title.configure(text=f' {APP_NAME} Menu')
home_tab_menu_first_button.configure(text="Command-Line")
home_tab_menu_second_button.configure(text="Port Scanner")
home_tab_menu_third_button.configure(text="CVE Vulnerabilities")
home_tab_menu_appearance_dropdown.configure(
values=appearance_mode_english_options)
if home_tab_menu_appearance_dropdown_option == "Dark":
home_tab_menu_appearance_dropdown.set("Dark")
if home_tab_menu_appearance_dropdown_option == "Light":
home_tab_menu_appearance_dropdown.set("Light")
# endregion
# region 1️⃣ Home > "First" Container
home_tab_first_container_title.configure(
text="Command-Line Operations")
home_tab_first_container_scrollable_frame_first_frame_text_description.configure(
text='USER TYPE')
home_tab_first_container_scrollable_frame_first_frame_second_subframe_text_description.configure(
text='CATEGORY')
home_tab_first_container_scrollable_frame_first_frame_third_subframe_text_description.configure(
text='SYSTEM')
home_tab_first_container_scrollable_frame_second_frame_text_description.configure(
text='CHOOSE A COMMAND*')
home_tab_first_container_scrollable_frame_third_frame_group_text_description.configure(
text='COMMAND LINE')
home_tab_first_container_scrollable_frame_fourth_frame_group_text_description.configure(
text='COMMAND DESCRIPTION')
# endregion
# region 2️⃣ Home > "Second" Container
home_tab_second_container_title.configure(text="Port Scanner")
# Description texts
home_tab_second_container_first_frame_group_text_description.configure(
text='IPV4 ADDRESS *')
home_tab_second_container_first_frame_group_first_entry.configure(
placeholder_text='e.g. 192.168.79.1')
home_tab_second_container_first_frame_group_second_subframe_text_description.configure(
text='USE MY IP')
home_tab_second_container_second_frame_group_first_subframe_text_description.configure(
text='THREADS')
home_tab_second_container_second_frame_group_first_subframe_first_entry.configure(
placeholder_text='e.g. 100')
home_tab_second_container_second_frame_group_second_subframe_text_description.configure(
text='START PORT *')
home_tab_second_container_second_frame_group_second_subframe_first_entry.configure(
placeholder_text='e.g. 1')
home_tab_second_container_second_frame_group_third_subframe_text_description.configure(
text='END PORT *')
home_tab_second_container_second_frame_group_third_subframe_first_entry.configure(
placeholder_text='e.g. 1024')
# endregion
# region 3️⃣ Home > "Third" Container
home_tab_third_container_title.configure(
text="CVE Vulnerabilities")
home_tab_third_container_first_frame_group_text_description.configure(
text='TARGET URL *')
home_tab_third_container_first_frame_group_first_entry.configure(
placeholder_text='e.g. https://www.google.com/')
# Slider description
home_tab_third_container_second_frame_group_second_subframe_text_description.configure(
text='LIST')
home_tab_third_container_second_frame_group_second_subframe_first_slider.set(
2)
home_tab_third_container_second_frame_group_text_description.configure(
text='LIST CVE CHECK')
home_tab_third_container_third_frame_group_text_description.configure(
text='VULNERABILITY DESCRIPTION')
home_tab_third_container_third_frame_group_first_textbox.configure(
state='normal')
home_tab_third_container_third_frame_group_first_textbox.delete(
'1.0',
'end')
home_tab_third_container_third_frame_group_first_textbox.insert(
'0.0',
'Checks for all vulnerabilities in a category')
home_tab_third_container_third_frame_group_first_textbox.configure(
state='disabled')
# endregion
# region ▶️ "Run" Button
home_tab_footer_description_text.configure(
text='Pre-Programmed Security Tool')
home_tab_footer_run_button.configure(text="Run")
# endregion
# endregion
# region 🔴 "Configure" Tab
# First Container (main)
configure_tab_first_container_first_frame_first_subframe_text_description.configure(
text="CHOOSE OPERATION TYPE")
configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.configure(
values=operation_type_english_options)
configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.set(
'Create')
configure_tab_first_container_title.configure(
text_color=LIGHT_BLUE_COLOR)
configure_tab_first_container_first_frame_second_subframe_text_description.configure(
text="CHOOSE AN ITEM")
configure_tab_first_container_first_frame_second_subframe_group_second_dropdown.configure(
values=configure_tab_choose_an_item_english_options)
configure_tab_first_container_first_frame_second_subframe_group_second_dropdown.set(
'Command-Line')
# Configure Tab Title
configure_tab_first_container_title.configure(
text=f'{configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.get()} '
f'{configure_tab_first_container_first_frame_second_subframe_group_second_dropdown.get()}')
# First Scrollable Frame
configure_tab_first_container_first_scrollable_frame_first_subframe_text_description.configure(
text="CHOOSE OPERATING SYSTEM")
configure_tab_first_container_first_scrollable_frame_second_subframe_text_description.configure(
text="CHOOSE CATEGORY")
configure_tab_first_container_first_scrollable_frame_second_subframe_group_second_dropdown.configure(
values=command_line_category_english_options)
configure_tab_first_container_first_scrollable_frame_second_subframe_group_second_dropdown.set(
'básico')
configure_tab_first_container_first_scrollable_frame_third_subframe_text_description.configure(
text="CHOOSE USER TYPE")
configure_tab_first_container_first_scrollable_frame_second_frame_text_description.configure(
text="WRITE THE COMMAND NAME *")
configure_tab_first_container_first_scrollable_frame_third_frame_group_text_description.configure(
text="WRITE THE COMMAND. USE SIMICOLON (;) TO SKIP A LINE. *")
configure_tab_first_container_first_scrollable_frame_fourth_frame_group_text_description.configure(
text="WRITE A DESCRIPTION FOR THE COMMAND (optional)")
configure_tab_footer_run_button.configure(
text=f'{configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.get()}',
fg_color=LIGHT_BLUE_COLOR,
hover_color=DARK_BLUE_COLOR)
# Second Scrollable Frame
configure_tab_first_container_second_scrollable_frame_first_subframe_text_description.configure(
text='TYPE'
)
configure_tab_first_container_second_scrollable_frame_first_subframe_group_first_dropdown.configure(
values=cve_type_english_options
)
configure_tab_first_container_second_scrollable_frame_first_subframe_group_first_dropdown.set(
value='CVE Code'
)
configure_tab_first_container_second_scrollable_frame_second_subframe_text_description.configure(
text='ASSOCIATE TO LIST'
)
configure_tab_first_container_second_scrollable_frame_third_subframe_text_description.configure(
text='IDENTIFICATION *'
)
configure_tab_first_container_second_scrollable_frame_first_frame_group_first_entry.configure(
placeholder_text='e.g. CVE-2024-1234'
)
configure_tab_first_container_second_scrollable_frame_fourth_frame_group_text_description.configure(
text='WRITE A DESCRIPTION FOR THE COMMAND'
)
# Footer
configure_tab_footer_description_text.configure(
text="Pre-Programmed Security Tool")
# endregion
# region 🟡 "Info" Tab
# region Container "Info APP"
info_tab_first_frame_group_first_info_text.configure(
text="DEVELOPER")
info_tab_second_frame_group_first_info_text.configure(
text="APP NAME")
info_tab_second_frame_group_first_info_text_space.configure(
text=" ")
info_tab_third_frame_group_first_info_text.configure(
text="VERSION")
info_tab_third_frame_group_first_info_text_space.configure(
text=" ")
# endregion
# region Frame "Text + Button: Contact Developer"
info_tab_footer_info_text.configure(
text="Automations, Upgrades, or Support?")
info_tab_footer_button.configure(text="Contact the developer")
# endregion
# endregion
case 'pt':
# region 🔵 "Home" Tab
# region Container "Menu"
home_tab_menu_title.configure(text=f' Menu {APP_NAME}')
home_tab_menu_first_button.configure(text="Linha de Comando")
home_tab_menu_second_button.configure(text="Scanner de Portas")
home_tab_menu_third_button.configure(text="Vulnerabilidades CVE")
home_tab_menu_appearance_dropdown.configure(
values=appearance_mode_portuguese_options)
if home_tab_menu_appearance_dropdown_option == "Dark":
home_tab_menu_appearance_dropdown.set("Escuro")
if home_tab_menu_appearance_dropdown_option == "Light":
home_tab_menu_appearance_dropdown.set("Claro")
# endregion
# region 1️⃣ Home > "First" Container
home_tab_first_container_title.configure(
text='Operações de Linha de Comando')
home_tab_first_container_scrollable_frame_first_frame_text_description.configure(
text='TIPO DE USUÁRIO')
home_tab_first_container_scrollable_frame_first_frame_second_subframe_text_description.configure(
text='CATEGORIA')
home_tab_first_container_scrollable_frame_first_frame_third_subframe_text_description.configure(
text='SISTEMA')
home_tab_first_container_scrollable_frame_second_frame_text_description.configure(
text='ESCOLHA UM '
'COMANDO*')
home_tab_first_container_scrollable_frame_third_frame_group_text_description.configure(
text='LINHA DE COMANDO')
home_tab_first_container_scrollable_frame_fourth_frame_group_text_description.configure(
text='DESCRIÇÃO DO COMANDO')
# endregion
# region 2️⃣ Home > "Second" Container
home_tab_second_container_title.configure(text="Scanner de Porta")
# Description texts
home_tab_second_container_first_frame_group_text_description.configure(
text='ENDEREÇO IPV4 *')
home_tab_second_container_first_frame_group_first_entry.configure(
placeholder_text='Ex: 192.168.79.1')
home_tab_second_container_first_frame_group_second_subframe_text_description.configure(
text='USAR MEU IP')
home_tab_second_container_second_frame_group_first_subframe_text_description.configure(
text='PROCESSOS')
home_tab_second_container_second_frame_group_first_subframe_first_entry.configure(
placeholder_text='Ex: 100')
home_tab_second_container_second_frame_group_second_subframe_text_description.configure(
text='PORTA INICIAL *')
home_tab_second_container_second_frame_group_second_subframe_first_entry.configure(
placeholder_text='Ex: 1')
home_tab_second_container_second_frame_group_third_subframe_text_description.configure(
text='PORTA FINAL *')
home_tab_second_container_second_frame_group_third_subframe_first_entry.configure(
placeholder_text='Ex: 1024')
# endregion
# region 3️⃣ Home > "Third" Container
home_tab_third_container_title.configure(
text="Vulnerabilidades CVE")
home_tab_third_container_first_frame_group_text_description.configure(
text='URL ALVO')
home_tab_third_container_first_frame_group_first_entry.configure(
placeholder_text='Ex: https://www.google.com/')
# Slider description
home_tab_third_container_second_frame_group_second_subframe_text_description.configure(
text='LISTA')
home_tab_third_container_second_frame_group_second_subframe_first_slider.set(
2)
home_tab_third_container_second_frame_group_text_description.configure(
text='LISTA CVE CHECK')
home_tab_third_container_third_frame_group_text_description.configure(
text='DESCRIÇÃO DA VULNERABILIDADE')
home_tab_third_container_third_frame_group_first_textbox.configure(
state='normal')
home_tab_third_container_third_frame_group_first_textbox.delete(
'0.0',
'end')
home_tab_third_container_third_frame_group_first_textbox.insert(
'0.0',
'Verifica todas as vulnerabilidades em uma categoria')
home_tab_third_container_third_frame_group_first_textbox.configure(
state='disabled')
# endregion
# region ▶️ "Run" Button
home_tab_footer_description_text.configure(
text='Ferramenta de Segurança Pré-Programada')
home_tab_footer_run_button.configure(text="Iniciar")
# endregion
# endregion
# region 🔴 "Configure" Tab
# First Container (main)
configure_tab_first_container_first_frame_first_subframe_text_description.configure(
text="ESCOLHA O TIPO DE OPERAÇÃO")
configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.configure(
values=operation_type_portuguese_options)
configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.set(
'Criar')
configure_tab_first_container_title.configure(
text_color=LIGHT_BLUE_COLOR)
configure_tab_first_container_first_frame_second_subframe_text_description.configure(
text="ESCOLHA UM ITEM")
configure_tab_first_container_first_frame_second_subframe_group_second_dropdown.configure(
values=configure_tab_choose_an_item_portuguese_options)
configure_tab_first_container_first_frame_second_subframe_group_second_dropdown.set(
'Linha de Comando')
# Configure Tab Title
configure_tab_first_container_title.configure(
text=f'{configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.get()} '
f'{configure_tab_first_container_first_frame_second_subframe_group_second_dropdown.get()}')
# First Scrollable Frame
configure_tab_first_container_first_scrollable_frame_first_subframe_text_description.configure(
text="ESCOLHA O SISTEMA OPERACIONAL")
configure_tab_first_container_first_scrollable_frame_second_subframe_text_description.configure(
text="ESCOLHA A CATEGORIA")
configure_tab_first_container_first_scrollable_frame_second_subframe_group_second_dropdown.configure(
values=command_line_category_portuguese_options)
configure_tab_first_container_first_scrollable_frame_second_subframe_group_second_dropdown.set(
'básico')
configure_tab_first_container_first_scrollable_frame_third_subframe_text_description.configure(
text="ESCOLHA O TIPO DE USUÁRIO")
configure_tab_first_container_first_scrollable_frame_second_frame_text_description.configure(
text="ESCREVA O NOME DO COMANDO *")
configure_tab_first_container_first_scrollable_frame_third_frame_group_text_description.configure(
text="ESCREVA O COMANDO. USE PONTO E VÍRGULA (;) PARA PULAR UMA LINHA. *")
configure_tab_first_container_first_scrollable_frame_fourth_frame_group_text_description.configure(
text="ESCREVA UMA DESCRIÇÃO PARA O COMANDO (opcional)")
configure_tab_footer_run_button.configure(
text=f'{configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.get()}',
fg_color=LIGHT_BLUE_COLOR,
hover_color=DARK_BLUE_COLOR)
# Second Scrollable Frame
configure_tab_first_container_second_scrollable_frame_first_subframe_text_description.configure(
text='TIPO'
)
configure_tab_first_container_second_scrollable_frame_first_subframe_group_first_dropdown.configure(
values=cve_type_portuguese_options
)
configure_tab_first_container_second_scrollable_frame_first_subframe_group_first_dropdown.set(
value='Código CVE'
)
configure_tab_first_container_second_scrollable_frame_second_subframe_text_description.configure(
text='ASSOCIAR À LISTA'
)
configure_tab_first_container_second_scrollable_frame_third_subframe_text_description.configure(
text='IDENTIFICAÇÃO *'
)
configure_tab_first_container_second_scrollable_frame_first_frame_group_first_entry.configure(
placeholder_text='Ex: CVE-2024-1234'
)
configure_tab_first_container_second_scrollable_frame_fourth_frame_group_text_description.configure(
text='ESCREVA UMA DESCRIÇÃO PARA O COMANDO'
)
# Footer
configure_tab_footer_description_text.configure(
text="Ferramenta de Segurança Pré-Programada")
# endregion
# region 🟡 "Info" Tab
# region Container "Info App"
info_tab_first_frame_group_first_info_text.configure(
text="DESENVOLVEDOR")
info_tab_second_frame_group_first_info_text.configure(
text="NOME DO APP")
info_tab_second_frame_group_first_info_text_space.configure(
text=" ")
info_tab_third_frame_group_first_info_text.configure(text="VERSÃO")
info_tab_third_frame_group_first_info_text_space.configure(
text=" ")
# endregion
# region Frame (Text + Button): "Contact Developer"
info_tab_footer_info_text.configure(
text="Automações, Upgrades ou Suporte?")
info_tab_footer_button.configure(text="Contate o Desenvolvedor")
# endregion
# endregion
case 'es':
# region 🔵 "Home" Tab
# region Container "Menu"
home_tab_menu_title.configure(text=f' {APP_NAME} Ménu')
home_tab_menu_first_button.configure(text="Línea de Comando")
home_tab_menu_second_button.configure(text="Escáner de Puertos")
home_tab_menu_third_button.configure(text="Vulnerabilidades CVE")
home_tab_menu_appearance_dropdown.configure(
values=appearance_mode_spanish_options)
if home_tab_menu_appearance_dropdown_option == "Dark":
home_tab_menu_appearance_dropdown.set("Oscuro")
if home_tab_menu_appearance_dropdown_option == "Light":
home_tab_menu_appearance_dropdown.set("Claro")
# endregion
# region 1️⃣ Home > "First" Container (Empty!)
home_tab_first_container_title.configure(
text="Operaciones de Línea de Comando")
home_tab_first_container_scrollable_frame_first_frame_text_description.configure(
text='TIPO DE USUARIO')
home_tab_first_container_scrollable_frame_first_frame_second_subframe_text_description.configure(
text='CATEGORÍA')
home_tab_first_container_scrollable_frame_second_frame_text_description.configure(
text='ELIJA UN COMANDO*')
home_tab_first_container_scrollable_frame_third_frame_group_text_description.configure(
text='LÍNEA DE COMANDO')
home_tab_first_container_scrollable_frame_fourth_frame_group_text_description.configure(
text='DESCRIPCIÓN DEL COMANDO')
# endregion
# region 2️⃣ Home > "Second" Container
home_tab_second_container_title.configure(
text="Escáner de Puertos")
# Description texts
home_tab_second_container_first_frame_group_text_description.configure(
text='DIRECCIÓN IPV4 *')
home_tab_second_container_first_frame_group_first_entry.configure(
placeholder_text='Ej: 192.168.79.1')
home_tab_second_container_first_frame_group_second_subframe_text_description.configure(
text='USAR MI IP')
home_tab_second_container_second_frame_group_first_subframe_text_description.configure(
text='HILOS')
home_tab_second_container_second_frame_group_first_subframe_first_entry.configure(
placeholder_text='Ej: 100')
home_tab_second_container_second_frame_group_second_subframe_text_description.configure(
text='PUERTO DE INICIO *')
home_tab_second_container_second_frame_group_second_subframe_first_entry.configure(
placeholder_text='Ej: 1')
home_tab_second_container_second_frame_group_third_subframe_text_description.configure(
text='PUERTO DE FIN *')
home_tab_second_container_second_frame_group_third_subframe_first_entry.configure(
placeholder_text='Ej: 1024')
# endregion
# region 3️⃣ Home > "Third" Container
home_tab_third_container_title.configure(
text="Vulnerabilidades CVE")
home_tab_third_container_first_frame_group_text_description.configure(
text='URL OBJETIVO')
home_tab_third_container_first_frame_group_first_entry.configure(
placeholder_text='Ej: https://www.google.com/')
# Slider description
home_tab_third_container_second_frame_group_second_subframe_text_description.configure(
text='LISTA')
home_tab_third_container_second_frame_group_second_subframe_first_slider.set(
2)
home_tab_third_container_second_frame_group_text_description.configure(
text='LISTA CVE CHECK')
home_tab_third_container_third_frame_group_text_description.configure(
text='DESCRIPCIÓN DE LA VULNERABILIDAD')
home_tab_third_container_third_frame_group_first_textbox.configure(
state='normal')
home_tab_third_container_third_frame_group_first_textbox.delete(
'0.0',
'end')
home_tab_third_container_third_frame_group_first_textbox.insert(
'0.0',
'Verifica todas las vulnerabilidades en una categoría')
home_tab_third_container_third_frame_group_first_textbox.configure(
state='disabled')
# endregion
# region ▶️ "Run" Button
home_tab_footer_description_text.configure(
text='Herramienta de Seguridad Preprogramada')
home_tab_footer_run_button.configure(text="Ejecutar")
# endregion
# endregion
# region 🔴 "Configure" Tab
# First Container (main)
configure_tab_first_container_first_frame_first_subframe_text_description.configure(
text="ELIJA EL TIPO DE OPERACIÓN")
configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.configure(
values=operation_type_spanish_options)
configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.set(
'Crear')
configure_tab_first_container_title.configure(
text_color=LIGHT_BLUE_COLOR)
configure_tab_first_container_first_frame_second_subframe_text_description.configure(
text="ELIJA UN ELEMENTO")
configure_tab_first_container_first_frame_second_subframe_group_second_dropdown.configure(
values=configure_tab_choose_an_item_spanish_options)
configure_tab_first_container_first_frame_second_subframe_group_second_dropdown.set(
'Línea de Comando')
# Configure Tab Title
configure_tab_first_container_title.configure(
text=f'{configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.get()} '
f'{configure_tab_first_container_first_frame_second_subframe_group_second_dropdown.get()}')
# First Scrollable Frame
configure_tab_first_container_first_scrollable_frame_first_subframe_text_description.configure(
text="ELIJA EL SISTEMA OPERATIVO")
configure_tab_first_container_first_scrollable_frame_second_subframe_text_description.configure(
text="ELIJA LA CATEGORÍA")
configure_tab_first_container_first_scrollable_frame_second_subframe_group_second_dropdown.configure(
values=command_line_category_spanish_options)
configure_tab_first_container_first_scrollable_frame_second_subframe_group_second_dropdown.set(
'básico')
configure_tab_first_container_first_scrollable_frame_third_subframe_text_description.configure(
text="ELIJA EL TIPO DE USUARIO")
configure_tab_first_container_first_scrollable_frame_second_frame_text_description.configure(
text="ESCRIBA EL NOMBRE DEL COMANDO *")
configure_tab_first_container_first_scrollable_frame_third_frame_group_text_description.configure(
text="ESCRIBE EL COMANDO. UTILICE PUNTO Y COMA (;) PARA SALTAR UNA LÍNEA *")
configure_tab_first_container_first_scrollable_frame_fourth_frame_group_text_description.configure(
text="ESCRIBA UNA DESCRIPCIÓN PARA EL COMANDO (opcional)")
configure_tab_footer_run_button.configure(
text=f'{configure_tab_first_container_first_frame_first_subframe_group_first_dropdown.get()}',
fg_color=LIGHT_BLUE_COLOR,
hover_color=DARK_BLUE_COLOR)
configure_tab_first_container_second_scrollable_frame_first_subframe_text_description.configure(
text='TIPO'
)
configure_tab_first_container_second_scrollable_frame_first_subframe_group_first_dropdown.configure(
values=cve_type_portuguese_options,
)
configure_tab_first_container_second_scrollable_frame_first_subframe_group_first_dropdown.set(
value='Código CVE'
)
configure_tab_first_container_second_scrollable_frame_second_subframe_text_description.configure(
text='ASOCIAR A LA LISTA'
)
configure_tab_first_container_second_scrollable_frame_third_subframe_text_description.configure(
text='IDENTIFICACIÓN *'
)
configure_tab_first_container_second_scrollable_frame_first_frame_group_first_entry.configure(
placeholder_text='Ej: CVE-2024-1234'
)
configure_tab_first_container_second_scrollable_frame_fourth_frame_group_text_description.configure(
text='ESCRIBA UNA DESCRIPCIÓN PARA EL COMANDO'
)
# Footer
configure_tab_footer_description_text.configure(
text="Herramienta de Seguridad Preprogramada")
# endregion
# region 🟡 "Info" Tab
# region Container "Info App"
info_tab_first_frame_group_first_info_text.configure(
text="DESARROLLADOR")
info_tab_second_frame_group_first_info_text.configure(
text="NOMBRE APP")
info_tab_second_frame_group_first_info_text_space.configure(
text=" ")
info_tab_third_frame_group_first_info_text.configure(
text="VERSIÓN")
info_tab_third_frame_group_first_info_text_space.configure(
text=" ")
# endregion
# region Frame (Text + Button): "Contate o Desenvolvedor"
info_tab_footer_info_text.configure(
text="Automatizaciones, Actualizaciones o Soporte?")
info_tab_footer_button.configure(text="Contacta al desarrollador")
# endregion
# endregion
def change_appearance_mode(appearance_mode):
new_appearance_mode = None
if appearance_mode in dark_name_variations:
new_appearance_mode = "Dark"
# region ⚫ "Dark Mode"
APP.configure(fg_color=GRAY_90_COLOR)
tab.configure(fg_color=GRAY_90_COLOR, bg_color=GRAY_90_COLOR)
first_tab.configure(fg_color=GRAY_90_COLOR, bg_color=GRAY_90_COLOR)
second_tab.configure(fg_color=GRAY_90_COLOR, bg_color=GRAY_90_COLOR)
third_tab.configure(fg_color=GRAY_90_COLOR, bg_color=GRAY_90_COLOR)
# region 🔵 "Home" Tab
# region Container "Menu"
home_tab_menu_container.configure(border_color=LIGHT_BLUE_COLOR)
home_tab_menu_title.configure(text_color=WHITE_COLOR)
# Mapeia e define as cores (fg e hover) dos botões do "App Menu", de acordo com o frame ativo.
button_mapping = {
"first": home_tab_menu_first_button,
"second": home_tab_menu_second_button,
"third": home_tab_menu_third_button,
}
for button_name, button in button_mapping.items():
fg_color = GRAY_70_COLOR if button_name == home_tab_active_container else TRANSPARENT_COLOR
text_color = LIGHT_RED_COLOR if button_name == "third" else GRAY_10_COLOR
button.configure(fg_color=fg_color, text_color=text_color,
hover_color=GRAY_70_COLOR)
# Appearance + Language
home_tab_menu_appearance_dropdown.configure(
button_color=LIGHT_BLUE_COLOR,
button_hover_color=DARK_BLUE_COLOR)
home_tab_menu_language_dropdown.configure(
button_color=LIGHT_BLUE_COLOR,
button_hover_color=DARK_BLUE_COLOR)
# endregion
# region 1️⃣ Home > "First" Container
home_tab_first_container.configure(border_color=GRAY_50_COLOR)
home_tab_first_container_horizontal_line.configure(bg=GRAY_70_COLOR)
home_tab_first_container_scrollable_frame_second_frame_group_first_dropdown.configure(
border_color=GRAY_45_COLOR,
button_color=LIGHT_BLUE_COLOR,
button_hover_color=DARK_BLUE_COLOR)
home_tab_first_container_scrollable_frame_third_frame_group_first_textbox.configure(
fg_color=GRAY_60_COLOR,
border_color=GRAY_45_COLOR)
home_tab_first_container_scrollable_frame_fourth_frame_group_first_textbox.configure(
fg_color=GRAY_60_COLOR,
border_color=GRAY_45_COLOR)
# endregion
# region 2️⃣ Home > "Second" Container
home_tab_second_container.configure(border_color=GRAY_50_COLOR)
home_tab_second_container_horizontal_line.configure(bg=GRAY_70_COLOR)
# Entry fields
home_tab_second_container_first_frame_group_first_entry.configure(
border_color=GRAY_45_COLOR,
fg_color=GRAY_60_COLOR)
home_tab_second_container_second_frame_group_first_subframe_first_entry.configure(
border_color=GRAY_45_COLOR,
fg_color=GRAY_60_COLOR)
home_tab_second_container_first_frame_group_second_subframe_first_switch.configure(
border_color=GRAY_45_COLOR,
fg_color=GRAY_60_COLOR,
button_color=GRAY_20_COLOR,
button_hover_color=WHITE_COLOR)
home_tab_second_container_second_frame_group_second_subframe_first_entry.configure(
border_color=GRAY_45_COLOR,
fg_color=GRAY_60_COLOR)
home_tab_second_container_second_frame_group_third_subframe_first_entry.configure(
border_color=GRAY_45_COLOR,
fg_color=GRAY_60_COLOR)
# endregion
# region 3️⃣ Home > "Third" Container
home_tab_third_container.configure(border_color=GRAY_50_COLOR)
home_tab_third_container_horizontal_line.configure(bg=GRAY_70_COLOR)
# endregion
# region Fields
# Target URL (Entry)
home_tab_third_container_first_frame_group_first_entry.configure(
fg_color=GRAY_60_COLOR,
border_color=GRAY_45_COLOR)
# CVE Category (Dropdown)
home_tab_third_container_second_frame_group_first_dropdown.configure(
fg_color=GRAY_60_COLOR,
border_color=GRAY_45_COLOR)
# Type (Switch)
home_tab_third_container_second_frame_group_second_subframe_first_slider.configure(
fg_color=GRAY_60_COLOR,
border_color=GRAY_45_COLOR,
button_color=GRAY_20_COLOR,
button_hover_color=WHITE_COLOR)
# Combobox
home_tab_third_container_third_frame_group_first_textbox.configure(
fg_color=GRAY_60_COLOR,
border_color=GRAY_45_COLOR)
# endregion
# ▶️ "Run" Button Container
home_tab_footer_container.configure(border_color=GRAY_50_COLOR)
# endregion
# region 🔴 "Configure" Tab
configure_tab_first_container.configure(border_color=GRAY_50_COLOR)
# region 1️⃣ "First" Scrollable Frame
configure_tab_first_container_first_scrollable_frame.configure(
fg_color=GRAY_70_COLOR)
configure_tab_first_container_second_scrollable_frame.configure(
fg_color=GRAY_70_COLOR)
# Second Frame | Dropdown
configure_tab_first_container_first_scrollable_frame_second_frame_first_entry.configure(
fg_color=GRAY_70_COLOR,
border_color=GRAY_45_COLOR)
# Third Frame | Dropdown
configure_tab_first_container_first_scrollable_frame_third_frame_group_first_entry.configure(
fg_color=GRAY_70_COLOR,
border_color=GRAY_45_COLOR)
# Fourth Frame | Dropdown
configure_tab_first_container_first_scrollable_frame_fourth_frame_group_first_textbox.configure(
fg_color=GRAY_70_COLOR,
border_color=GRAY_45_COLOR)
# endregion
# region 2️⃣ "Second" Scrollable Frame
configure_tab_first_container_second_scrollable_frame_fourth_frame_group_first_textbox.configure(
border_color=GRAY_45_COLOR,
fg_color=GRAY_70_COLOR)
configure_tab_first_container_second_scrollable_frame_first_frame_group_first_entry.configure(
border_color=GRAY_45_COLOR
)
# endregion
configure_tab_footer_container.configure(border_color=GRAY_50_COLOR)
# endregion
# region 🟡 "Info" Tab
info_tab_container.configure(border_color=GRAY_50_COLOR)
# endregion
home_tab_menu_first_button.configure(hover_color=GRAY_70_COLOR)
# endregion
elif appearance_mode in light_name_variations:
new_appearance_mode = "Light"
# region ⚪ "LIGHT MODE"
APP.configure(fg_color=GRAY_20_COLOR)
tab.configure(fg_color=GRAY_20_COLOR, bg_color=GRAY_20_COLOR)
first_tab.configure(fg_color=GRAY_20_COLOR, bg_color=GRAY_20_COLOR)
second_tab.configure(fg_color=GRAY_20_COLOR, bg_color=GRAY_20_COLOR)
third_tab.configure(fg_color=GRAY_20_COLOR, bg_color=GRAY_20_COLOR)
# region 🔵 "Home" Tab
# region Container "Menu"
home_tab_menu_container.configure(border_color=LIGHT_BLUE_COLOR)
home_tab_menu_title.configure(text_color=GRAY_50_COLOR)
# Maps and defines the colors (fg and hover) of the "App Menu" buttons, according to the active frame.
button_mapping = {
"first": home_tab_menu_first_button,
"second": home_tab_menu_second_button,
"third": home_tab_menu_third_button,
}
for button_name, button in button_mapping.items():
fg_color = GRAY_40_COLOR if button_name == home_tab_active_container else TRANSPARENT_COLOR
text_color = LIGHT_RED_COLOR if button_name == "third" else GRAY_55_COLOR
button.configure(fg_color=fg_color, text_color=text_color,
hover_color=GRAY_40_COLOR)
home_tab_menu_appearance_dropdown.configure(
button_color=LIGHT_BLUE_COLOR,
button_hover_color=DARK_BLUE_COLOR)
home_tab_menu_language_dropdown.configure(
button_color=LIGHT_BLUE_COLOR,
button_hover_color=DARK_BLUE_COLOR)
# endregion
# region 1️⃣ Home > "First" Container
home_tab_first_container.configure(border_color=GRAY_40_COLOR)
home_tab_first_container_horizontal_line.configure(bg=GRAY_30_COLOR)
home_tab_first_container_scrollable_frame_second_frame_group_first_dropdown.configure(
border_color=GRAY_35_COLOR,
button_color=LIGHT_BLUE_COLOR,
button_hover_color=DARK_BLUE_COLOR)
home_tab_first_container_scrollable_frame_third_frame_group_first_textbox.configure(
fg_color=WHITE_COLOR,
border_color=GRAY_35_COLOR)
home_tab_first_container_scrollable_frame_fourth_frame_group_first_textbox.configure(
fg_color=WHITE_COLOR,
border_color=GRAY_35_COLOR)
# endregion
# region 2️⃣ Home > "Second" Container
home_tab_second_container.configure(border_color=GRAY_40_COLOR)
home_tab_second_container_horizontal_line.configure(bg=GRAY_30_COLOR)
# Entry fields
home_tab_second_container_first_frame_group_first_entry.configure(
border_color=GRAY_35_COLOR,
fg_color=WHITE_COLOR)
home_tab_second_container_second_frame_group_first_subframe_first_entry.configure(
border_color=GRAY_35_COLOR,
fg_color=WHITE_COLOR)
home_tab_second_container_first_frame_group_second_subframe_first_switch.configure(
border_color=GRAY_35_COLOR,
fg_color=WHITE_COLOR,
button_color=GRAY_45_COLOR,
button_hover_color=GRAY_55_COLOR)
home_tab_second_container_second_frame_group_second_subframe_first_entry.configure(
border_color=GRAY_35_COLOR,
fg_color=WHITE_COLOR)
home_tab_second_container_second_frame_group_third_subframe_first_entry.configure(
border_color=GRAY_35_COLOR,
fg_color=WHITE_COLOR)
# endregion
# region 3️⃣ Home > "Third" Container
home_tab_third_container.configure(border_color=GRAY_40_COLOR)
home_tab_third_container_horizontal_line.configure(bg=GRAY_30_COLOR)
# Target URL (Entry)
home_tab_third_container_first_frame_group_first_entry.configure(
fg_color=WHITE_COLOR,
border_color=GRAY_35_COLOR)
# CVE Category (Dropdown)
home_tab_third_container_second_frame_group_first_dropdown.configure(
fg_color=WHITE_COLOR,
border_color=GRAY_35_COLOR)
# Type (Slider)
home_tab_third_container_second_frame_group_second_subframe_first_slider.configure(
fg_color=WHITE_COLOR,
border_color=GRAY_35_COLOR,
button_color=GRAY_45_COLOR,
button_hover_color=GRAY_55_COLOR)
# Combobox
home_tab_third_container_third_frame_group_first_textbox.configure(
fg_color=WHITE_COLOR,
border_color=GRAY_35_COLOR)
# endregion
# region ▶️ Frame "Run" Button"
home_tab_footer_container.configure(border_color=GRAY_40_COLOR)
# endregion
# endregion
# region 🔴 "Configure" Tab
configure_tab_first_container.configure(border_color=GRAY_30_COLOR)
# region 1️⃣ "First" Scrollable Frame
configure_tab_first_container_first_scrollable_frame.configure(
fg_color=GRAY_30_COLOR)
configure_tab_first_container_second_scrollable_frame.configure(
fg_color=GRAY_30_COLOR)
# Second Frame | Dropdown
configure_tab_first_container_first_scrollable_frame_second_frame_first_entry.configure(
fg_color=WHITE_COLOR,
border_color=GRAY_35_COLOR)
# Third Frame | Dropdown
configure_tab_first_container_first_scrollable_frame_third_frame_group_first_entry.configure(
fg_color=WHITE_COLOR,
border_color=GRAY_35_COLOR)
# Fourth Frame | Dropdown
configure_tab_first_container_first_scrollable_frame_fourth_frame_group_first_textbox.configure(
fg_color=WHITE_COLOR,
border_color=GRAY_35_COLOR)
# endregion
# region 2️⃣ "Second" Scrollable Frame
configure_tab_first_container_second_scrollable_frame_fourth_frame_group_first_textbox.configure(
border_color=GRAY_35_COLOR,
fg_color=WHITE_COLOR)
configure_tab_first_container_second_scrollable_frame_first_frame_group_first_entry.configure(
border_color=GRAY_35_COLOR
)
# endregion
configure_tab_footer_container.configure(border_color=GRAY_30_COLOR)
# endregion
# region 🟡 "Info" Tab
info_tab_container.configure(border_color=GRAY_40_COLOR)
# endregion
# endregion
ctk.set_appearance_mode(new_appearance_mode)
def toggle_container_visibility(container, all_containers, chosen_container,
button, all_buttons):
global home_tab_active_container
# Checks if the target container (widget) is currently visible on the screen
is_target_container_visible = container.winfo_ismapped()
# Hide all containers except the target container
for other_container in all_containers:
if other_container != container:
other_container.pack_forget()
# Manage the "hover" color of the button that triggered the function
for other_button in all_buttons:
if other_button != button:
other_button.configure(fg_color=TRANSPARENT_COLOR)
# Show or hide the target container unless it is already visible
if not is_target_container_visible:
container.pack(side=ctk.RIGHT, padx=5, pady=0, fill=ctk.BOTH,
expand=True, anchor="ne")
appearance_mode = ctk.get_appearance_mode()
if appearance_mode == "Escuro" or appearance_mode == "Oscuro" or appearance_mode == "Dark":
button.configure(fg_color=GRAY_70_COLOR)
elif appearance_mode == "Claro" or appearance_mode == "Light":
button.configure(fg_color=GRAY_40_COLOR)
home_tab_active_container = chosen_container
def create_user_preferences():
# 🔑 USER SETTINGS - Initial Values (Default)
default_preferences = {
"preference_home_tab_first_container_scrollable_frame_first_frame_group_first_entry_value": "",
"preference_home_tab_first_container_scrollable_frame_first_frame_group_first_dropdown_value": "",
}
# Save the dictionary to the JSON file
with open("./src/json/preferences.json", "w") as preferences_file:
json.dump(default_preferences, preferences_file)
def get_user_preferences():
# 🔑 Check if the JSON file exists; if not, create it
if not os.path.exists("src/json/preferences.json"):
create_user_preferences()
# Try to retrieve user preferences from the JSON
try:
with (open("src/json/preferences.json", "r") as preferences_file):