@@ -51,60 +51,66 @@ def run():
51
51
print (Fore .RED + "\n Returned to main menu" )
52
52
break
53
53
else :
54
- url = "http://" + short_domain + "/"
55
- case_comment = input (Fore .YELLOW + "Enter case comment >> " )
56
- report_filetype = input (Fore .YELLOW + "Enter report file extension [xlsx/pdf] >> " )
57
- pagesearch_flag = input (Fore .YELLOW + "Would you like to use PageSearch [BETA] function? [Y/N] >> " )
58
- if pagesearch_flag .lower () == 'y' :
59
- keywords_input = input (Fore .YELLOW + "Enter keywords (separate by comma) to search in files during PageSearch process (or write None if you don't need it) >> " )
60
- if keywords_input .lower () != "none" :
61
- keywords_list = [keyword .strip () for keyword in keywords_input .split (',' )]
62
- keywords_flag = 1
63
- elif keywords_input .lower () == "none" :
64
- keywords_list = None
65
- keywords_flag = 0
66
- elif pagesearch_flag .lower () == 'n' :
67
- keywords_flag = 0
68
- if report_filetype .lower () == 'pdf' or report_filetype .lower () == 'xlsx' :
69
- if pagesearch_flag .lower () == 'y' or pagesearch_flag .lower () == 'n' :
70
- if pagesearch_flag .lower () == "n" :
71
- pagesearch_ui_mark = 'No'
72
- elif pagesearch_flag .lower () == 'y' and keywords_flag == 1 :
73
- pagesearch_ui_mark = f'Yes, with { keywords_list } keywords search'
74
- else :
75
- pagesearch_ui_mark = 'Yes, without keywords search'
76
- print (Fore .LIGHTMAGENTA_EX + "\n [PRE-SCAN SUMMARY]\n " + Style .RESET_ALL )
77
- print (Fore .GREEN + "Determined target: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + short_domain + Style .RESET_ALL )
78
- print (Fore .GREEN + "Report type: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + report_filetype .lower () + Style .RESET_ALL )
79
- print (Fore .GREEN + "PageSearch conduction: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + pagesearch_ui_mark + Style .RESET_ALL )
80
- print (Fore .GREEN + "Case comment: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + case_comment + Style .RESET_ALL + "\n " )
81
- print (Fore .LIGHTMAGENTA_EX + "[SCANNING PROCESS]\n " + Style .RESET_ALL )
82
- spinner_thread = ProgressBar ()
83
- spinner_thread .start ()
84
- if report_filetype .lower () == 'pdf' :
85
- try :
86
- if pagesearch_flag .lower () == 'y' :
87
- data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype .lower (), pagesearch_flag .lower (), keywords_list , keywords_flag )
88
- else :
89
- data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype .lower (), pagesearch_flag .lower (), '' , keywords_flag )
90
- pdf_rc .report_assembling (short_domain , url , case_comment , data_array , report_info_array , pagesearch_ui_mark )
91
- finally :
92
- spinner_thread .do_run = False
93
- spinner_thread .join ()
94
- elif report_filetype .lower () == 'xlsx' :
95
- try :
96
- if pagesearch_flag .lower () == 'y' :
97
- data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype .lower (), pagesearch_flag .lower (), keywords_list , keywords_flag )
98
- else :
99
- data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype .lower (), pagesearch_flag .lower (), '' , keywords_flag )
100
- xlsx_rc .create_report (short_domain , url , case_comment , data_array , report_info_array , pagesearch_ui_mark )
101
- finally :
102
- spinner_thread .do_run = False
103
- spinner_thread .join ()
104
- else :
105
- print (Fore .RED + "Unsupported PageSearch mode. Please choose between Y and N" )
54
+ if not short_domain :
55
+ print (Fore .RED + "\n Empty domain names are not supported" )
106
56
else :
107
- print (Fore .RED + "Unsupported report file extension. Please choose between XLSX and PDF" )
57
+ url = "http://" + short_domain + "/"
58
+ case_comment = input (Fore .YELLOW + "Enter case comment >> " )
59
+ report_filetype = input (Fore .YELLOW + "Enter report file extension [xlsx/pdf] >> " )
60
+ if not report_filetype :
61
+ print (Fore .RED + "\n Report filetype cannot be empty" )
62
+ if report_filetype .lower () not in ['pdf' , 'xlsx' ]:
63
+ print (Fore .RED + '\n You need to choose between PDF or XLSX report file types' )
64
+ else :
65
+ pagesearch_flag = input (Fore .YELLOW + "Would you like to use PageSearch [BETA] function? [Y/N] >> " )
66
+ if pagesearch_flag .lower () == 'y' :
67
+ keywords_input = input (Fore .YELLOW + "Enter keywords (separate by comma) to search in files during PageSearch process (or write None if you don't need it) >> " )
68
+ if keywords_input .lower () != "none" :
69
+ keywords_list = [keyword .strip () for keyword in keywords_input .split (',' )]
70
+ keywords_flag = 1
71
+ elif keywords_input .lower () == "none" :
72
+ keywords_list = None
73
+ keywords_flag = 0
74
+ elif pagesearch_flag .lower () == 'n' :
75
+ keywords_flag = 0
76
+ if report_filetype .lower () == 'pdf' or report_filetype .lower () == 'xlsx' :
77
+ if pagesearch_flag .lower () == 'y' or pagesearch_flag .lower () == 'n' :
78
+ if pagesearch_flag .lower () == "n" :
79
+ pagesearch_ui_mark = 'No'
80
+ elif pagesearch_flag .lower () == 'y' and keywords_flag == 1 :
81
+ pagesearch_ui_mark = f'Yes, with { keywords_list } keywords search'
82
+ else :
83
+ pagesearch_ui_mark = 'Yes, without keywords search'
84
+ print (Fore .LIGHTMAGENTA_EX + "\n [PRE-SCAN SUMMARY]\n " + Style .RESET_ALL )
85
+ print (Fore .GREEN + "Determined target: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + short_domain + Style .RESET_ALL )
86
+ print (Fore .GREEN + "Report type: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + report_filetype .lower () + Style .RESET_ALL )
87
+ print (Fore .GREEN + "PageSearch conduction: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + pagesearch_ui_mark + Style .RESET_ALL )
88
+ print (Fore .GREEN + "Case comment: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + case_comment + Style .RESET_ALL + "\n " )
89
+ print (Fore .LIGHTMAGENTA_EX + "[SCANNING PROCESS]\n " + Style .RESET_ALL )
90
+ spinner_thread = ProgressBar ()
91
+ spinner_thread .start ()
92
+ if report_filetype .lower () == 'pdf' :
93
+ try :
94
+ if pagesearch_flag .lower () == 'y' :
95
+ data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype .lower (), pagesearch_flag .lower (), keywords_list , keywords_flag )
96
+ else :
97
+ data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype .lower (), pagesearch_flag .lower (), '' , keywords_flag )
98
+ pdf_rc .report_assembling (short_domain , url , case_comment , data_array , report_info_array , pagesearch_ui_mark )
99
+ finally :
100
+ spinner_thread .do_run = False
101
+ spinner_thread .join ()
102
+ elif report_filetype .lower () == 'xlsx' :
103
+ try :
104
+ if pagesearch_flag .lower () == 'y' :
105
+ data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype .lower (), pagesearch_flag .lower (), keywords_list , keywords_flag )
106
+ else :
107
+ data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype .lower (), pagesearch_flag .lower (), '' , keywords_flag )
108
+ xlsx_rc .create_report (short_domain , url , case_comment , data_array , report_info_array , pagesearch_ui_mark )
109
+ finally :
110
+ spinner_thread .do_run = False
111
+ spinner_thread .join ()
112
+ else :
113
+ print (Fore .RED + "\n Unsupported PageSearch mode. Please choose between Y and N" )
108
114
109
115
elif choice == "2" :
110
116
cli .print_settings_menu ()
0 commit comments