From 731633d716ab48646f9d4e8d735d5a34488aab0e Mon Sep 17 00:00:00 2001 From: SOOS-GSteen Date: Tue, 3 Oct 2023 15:10:27 -0400 Subject: [PATCH 1/2] PA-11096 file may not exist --- main.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 72538ea..c4b29c8 100644 --- a/main.py +++ b/main.py @@ -1057,7 +1057,10 @@ def run_analysis(self) -> None: raise Exception(f"An Unexpected error has occurred running the {self.scan_mode} scan") # Add the discovered urls to the report - discoveredUrls = open('./spidered_urls.txt', 'r').read().splitlines() + if (os.path.isfile('./spidered_urls.txt')): + discoveredUrls = open('./spidered_urls.txt', 'r').read().splitlines() + else: + discoveredUrls = [] data = json.load(open(Constants.REPORT_SCAN_RESULT_FILE, 'r')) data['discoveredUrls'] = discoveredUrls json.dump(data, open(Constants.REPORT_SCAN_RESULT_FILE, 'w')) From 29fead512720d5b395bd71dc9857588305607e8c Mon Sep 17 00:00:00 2001 From: SOOS-GSteen Date: Tue, 3 Oct 2023 15:16:15 -0400 Subject: [PATCH 2/2] Update main.py --- main.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/main.py b/main.py index c4b29c8..923281c 100644 --- a/main.py +++ b/main.py @@ -1057,10 +1057,9 @@ def run_analysis(self) -> None: raise Exception(f"An Unexpected error has occurred running the {self.scan_mode} scan") # Add the discovered urls to the report + discoveredUrls = [] if (os.path.isfile('./spidered_urls.txt')): discoveredUrls = open('./spidered_urls.txt', 'r').read().splitlines() - else: - discoveredUrls = [] data = json.load(open(Constants.REPORT_SCAN_RESULT_FILE, 'r')) data['discoveredUrls'] = discoveredUrls json.dump(data, open(Constants.REPORT_SCAN_RESULT_FILE, 'w'))