From 085ebab9dd4d056e3ce83d56df218ce65e111e18 Mon Sep 17 00:00:00 2001 From: cccs-rs Date: Wed, 31 Aug 2022 18:32:48 +0000 Subject: [PATCH] repurpose submitted_url_only to analyze_submitted_url --- urldownloader/urldownloader.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/urldownloader/urldownloader.py b/urldownloader/urldownloader.py index 05799f8..cdbcf17 100644 --- a/urldownloader/urldownloader.py +++ b/urldownloader/urldownloader.py @@ -48,11 +48,11 @@ def execute(self, request: ServiceRequest) -> None: if request.get_param('user_agent'): headers['User-Agent'] = request.get_param('user_agent') - # Code to be used when responsibility of fetching submitted_url is moved to service from UI - # ----------------------------------------------------------------------------------------- + urls = [] submitted_url = request.task.metadata.get('submitted_url') - # Make sure this is the first URL fetched - urls = [(submitted_url, 10000)] if submitted_url and request.task.depth == 0 else [] + if request.get_param('analyze_submitted_url') and submitted_url and request.task.depth == 0: + # Make sure this is the first URL fetched + urls = [(submitted_url, 10000)] tags = request.task.tags # Distinguish between only fetching the submitted_url vs all in the submission @@ -62,7 +62,7 @@ def execute(self, request: ServiceRequest) -> None: request.temp_submission_data.setdefault('visited_urls', {}) - # Check if current file is malicious, if so tag URL that downloaded the file + # Check if current file is malicious, if so tag URL that downloaded the file task_score = 0 for tags_tuples in tags.values(): task_score += sum([tag_tuple[1] for tag_tuple in tags_tuples])