From a7b84b966cd6e7929cc4ac850219f0c5f164e299 Mon Sep 17 00:00:00 2001 From: ophirharpazg Date: Tue, 1 Sep 2020 12:43:20 +0300 Subject: [PATCH] fix length check and add log --- monkey/infection_monkey/exploit/drupal.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/exploit/drupal.py b/monkey/infection_monkey/exploit/drupal.py index 33321052e..8d017fb31 100644 --- a/monkey/infection_monkey/exploit/drupal.py +++ b/monkey/infection_monkey/exploit/drupal.py @@ -114,7 +114,12 @@ class DrupalExploiter(WebRCE): """ # We need 5 URLs for a "full-chain": check remote files, check architecture, drop monkey, chmod it and run it. num_urls_needed_for_full_exploit = 5 - return len(self.vulnerable_urls) > num_urls_needed_for_full_exploit + num_available_urls = len(self.vulnerable_urls) + result = num_available_urls >= num_urls_needed_for_full_exploit + if not result: + LOG.info(f'{num_urls_needed_for_full_exploit} URLs are needed to fully exploit a Drupal server ' + f'but only {num_available_urls} found') + return result def is_response_cached(r: requests.Response) -> bool: