Skip to content

Commit 6676742

Browse files
Updated dpulse.py [added PageSearch basic support]
1 parent 8facbd7 commit 6676742

File tree

1 file changed

+23
-19
lines changed

1 file changed

+23
-19
lines changed

dpulse.py

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,31 @@ def run():
5555
url = "http://" + short_domain + "/"
5656
case_comment = input(Fore.YELLOW + "Enter case comment (or enter '-' if you don't need comment to the case) >> ")
5757
report_filetype = input(Fore.YELLOW + "Enter report file extension [xlsx/pdf] >> ")
58+
pagesearch_flag = input(Fore.YELLOW + "Would you like to use PageSearch [BETA] function? [Y/N] >> ")
5859
report_filetype_lowered = report_filetype.lower()
5960
if report_filetype_lowered == 'pdf' or report_filetype_lowered == 'xlsx':
60-
print(Fore.LIGHTMAGENTA_EX + "\n[PRE-SCAN SUMMARY]\n" + Style.RESET_ALL)
61-
print(Fore.GREEN + "Determined target: {}\nCase comment: {}\nReport file extension: {}\n".format(short_domain, case_comment, report_filetype_lowered) + Style.RESET_ALL)
62-
print(Fore.LIGHTMAGENTA_EX + "[SCANNING PROCESS]\n" + Style.RESET_ALL)
63-
spinner_thread = ProgressBar()
64-
spinner_thread.start()
65-
if report_filetype_lowered == 'pdf':
66-
try:
67-
data_array, report_info_array = data_processing.data_gathering(short_domain, url, report_filetype_lowered)
68-
pdf_rc.report_assembling(short_domain, url, case_comment, data_array, report_info_array)
69-
finally:
70-
spinner_thread.do_run = False
71-
spinner_thread.join()
72-
elif report_filetype_lowered == 'xlsx':
73-
try:
74-
data_array, report_info_array = data_processing.data_gathering(short_domain, url, report_filetype_lowered)
75-
xlsx_rc.create_report(short_domain, url, case_comment, data_array, report_info_array)
76-
finally:
77-
spinner_thread.do_run = False
78-
spinner_thread.join()
61+
if pagesearch_flag == 'Y' or pagesearch_flag == 'N':
62+
print(Fore.LIGHTMAGENTA_EX + "\n[PRE-SCAN SUMMARY]\n" + Style.RESET_ALL)
63+
print(Fore.GREEN + "Determined target: {}\nCase comment: {}\nReport file extension: {}\nPageSearch: {}\n".format(short_domain, case_comment, report_filetype_lowered, pagesearch_flag) + Style.RESET_ALL)
64+
print(Fore.LIGHTMAGENTA_EX + "[SCANNING PROCESS]\n" + Style.RESET_ALL)
65+
spinner_thread = ProgressBar()
66+
spinner_thread.start()
67+
if report_filetype_lowered == 'pdf':
68+
try:
69+
data_array, report_info_array = data_processing.data_gathering(short_domain, url, report_filetype_lowered, pagesearch_flag.lower())
70+
pdf_rc.report_assembling(short_domain, url, case_comment, data_array, report_info_array)
71+
finally:
72+
spinner_thread.do_run = False
73+
spinner_thread.join()
74+
elif report_filetype_lowered == 'xlsx':
75+
try:
76+
data_array, report_info_array = data_processing.data_gathering(short_domain, url, report_filetype_lowered, pagesearch_flag.lower())
77+
xlsx_rc.create_report(short_domain, url, case_comment, data_array, report_info_array)
78+
finally:
79+
spinner_thread.do_run = False
80+
spinner_thread.join()
81+
else:
82+
print(Fore.RED + "Unsupported IntelliSearch mode. Please choose between Y, N")
7983
else:
8084
print(Fore.RED + "Unsupported report file extension. Please choose between xlsx or pdf.")
8185

0 commit comments

Comments
 (0)