@@ -45,68 +45,66 @@ def run():
45
45
cli .print_main_menu ()
46
46
choice = input (Fore .YELLOW + "Enter your choice >> " )
47
47
if choice == "1" :
48
- print ('\n ' )
49
48
while True :
50
49
short_domain = input (Fore .YELLOW + "\n Enter target's domain name (or 'back' to return to the menu) >> " )
51
50
if short_domain .lower () == "back" :
52
51
print (Fore .RED + "\n Returned to main menu" )
53
52
break
54
53
else :
55
54
url = "http://" + short_domain + "/"
56
- case_comment = input (Fore .YELLOW + "Enter case comment (or enter '-' if you don't need comment to the case) >> " )
55
+ case_comment = input (Fore .YELLOW + "Enter case comment >> " )
57
56
report_filetype = input (Fore .YELLOW + "Enter report file extension [xlsx/pdf] >> " )
58
57
pagesearch_flag = input (Fore .YELLOW + "Would you like to use PageSearch [BETA] function? [Y/N] >> " )
59
- if pagesearch_flag == 'Y ' :
58
+ if pagesearch_flag . lower () == 'y ' :
60
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) >> " )
61
60
if keywords_input .lower () != "none" :
62
61
keywords_list = [keyword .strip () for keyword in keywords_input .split (',' )]
63
62
keywords_flag = 1
64
63
elif keywords_input .lower () == "none" :
65
64
keywords_list = None
66
65
keywords_flag = 0
67
- elif pagesearch_flag == 'N ' :
66
+ elif pagesearch_flag . lower () == 'n ' :
68
67
keywords_flag = 0
69
- report_filetype_lowered = report_filetype .lower ()
70
- if report_filetype_lowered == 'pdf' or report_filetype_lowered == 'xlsx' :
71
- if pagesearch_flag == 'Y' or pagesearch_flag == 'N' :
72
- if pagesearch_flag == "N" :
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" :
73
71
pagesearch_ui_mark = 'No'
74
- elif pagesearch_flag == 'Y ' and keywords_flag == 1 :
72
+ elif pagesearch_flag . lower () == 'y ' and keywords_flag == 1 :
75
73
pagesearch_ui_mark = f'Yes, with { keywords_list } keywords search'
76
74
else :
77
75
pagesearch_ui_mark = 'Yes, without keywords search'
78
76
print (Fore .LIGHTMAGENTA_EX + "\n [PRE-SCAN SUMMARY]\n " + Style .RESET_ALL )
79
77
print (Fore .GREEN + "Determined target: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + short_domain + Style .RESET_ALL )
80
- print (Fore .GREEN + "Report type: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + report_filetype_lowered + Style .RESET_ALL )
78
+ print (Fore .GREEN + "Report type: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + report_filetype . lower () + Style .RESET_ALL )
81
79
print (Fore .GREEN + "PageSearch conduction: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + pagesearch_ui_mark + Style .RESET_ALL )
82
80
print (Fore .GREEN + "Case comment: " + Fore .LIGHTCYAN_EX + Style .BRIGHT + case_comment + Style .RESET_ALL + "\n " )
83
81
print (Fore .LIGHTMAGENTA_EX + "[SCANNING PROCESS]\n " + Style .RESET_ALL )
84
82
spinner_thread = ProgressBar ()
85
83
spinner_thread .start ()
86
- if report_filetype_lowered == 'pdf' :
84
+ if report_filetype . lower () == 'pdf' :
87
85
try :
88
- if pagesearch_flag == 'Y ' :
89
- data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype_lowered , pagesearch_flag .lower (), keywords_list , keywords_flag )
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 )
90
88
else :
91
- data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype_lowered , pagesearch_flag .lower (), '' , keywords_flag )
89
+ data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype . lower () , pagesearch_flag .lower (), '' , keywords_flag )
92
90
pdf_rc .report_assembling (short_domain , url , case_comment , data_array , report_info_array , pagesearch_ui_mark )
93
91
finally :
94
92
spinner_thread .do_run = False
95
93
spinner_thread .join ()
96
- elif report_filetype_lowered == 'xlsx' :
94
+ elif report_filetype . lower () == 'xlsx' :
97
95
try :
98
- if pagesearch_flag == 'Y ' :
99
- data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype_lowered , pagesearch_flag .lower (), keywords_list , keywords_flag )
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 )
100
98
else :
101
- data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype_lowered , pagesearch_flag .lower (), '' , keywords_flag )
99
+ data_array , report_info_array = data_processing .data_gathering (short_domain , url , report_filetype . lower () , pagesearch_flag .lower (), '' , keywords_flag )
102
100
xlsx_rc .create_report (short_domain , url , case_comment , data_array , report_info_array , pagesearch_ui_mark )
103
101
finally :
104
102
spinner_thread .do_run = False
105
103
spinner_thread .join ()
106
104
else :
107
- print (Fore .RED + "Unsupported PageSearch mode. Please choose between Y, N" )
105
+ print (Fore .RED + "Unsupported PageSearch mode. Please choose between Y and N" )
108
106
else :
109
- print (Fore .RED + "Unsupported report file extension. Please choose between xlsx or pdf. " )
107
+ print (Fore .RED + "Unsupported report file extension. Please choose between XLSX and PDF " )
110
108
111
109
elif choice == "2" :
112
110
cli .print_settings_menu ()
@@ -154,7 +152,7 @@ def run():
154
152
pass
155
153
else :
156
154
print (Fore .LIGHTMAGENTA_EX + "\n [DATABASE'S CONTENT]\n " + Style .RESET_ALL )
157
- cursor , sqlite_connection = db .db_select ()
155
+ db .db_select ()
158
156
id_to_extract = int (input (Fore .YELLOW + "\n Enter report ID you want to extract >> " ))
159
157
extracted_folder_name = 'report_recreated_ID#{}' .format (id_to_extract )
160
158
try :
0 commit comments