From 3014763e99c01c542118932f266525a5d6bf11b9 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 4 Sep 2017 15:41:36 +0300 Subject: [PATCH] minor fixes --- chaos_monkey/dropper.py | 2 +- chaos_monkey/exploit/sambacry.py | 2 +- .../monkey_utils/sambacry_monkey_runner/sc_monkey_runner.c | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/chaos_monkey/dropper.py b/chaos_monkey/dropper.py index e56cc0a12..6d4133557 100644 --- a/chaos_monkey/dropper.py +++ b/chaos_monkey/dropper.py @@ -96,7 +96,7 @@ class MonkeyDrops(object): LOG.warn("Cannot set reference date to destination file") monkey_options = build_monkey_commandline_explicitly( - self.opts.parent, self.opts.tunnel, self.opts.server, self.opts.depth) + self.opts.parent, self.opts.tunnel, self.opts.server, int(self.opts.depth)) if OperatingSystem.Windows == SystemInfoCollector.get_os(): monkey_cmdline = MONKEY_CMDLINE_WINDOWS % {'monkey_path': self._config['destination_path']} + monkey_options diff --git a/chaos_monkey/exploit/sambacry.py b/chaos_monkey/exploit/sambacry.py index 68d1ab1a3..22b3a3f2b 100644 --- a/chaos_monkey/exploit/sambacry.py +++ b/chaos_monkey/exploit/sambacry.py @@ -317,7 +317,7 @@ class SambaCryExploiter(HostExploiter): """ sambacry_folder_paths_to_guess = self._config.sambacry_folder_paths_to_guess file_names = [self._config.sambacry_runner_filename_32, self._config.sambacry_runner_filename_64] - return [posixpath.join(*x) for x in itertools.prodcut(sambacry_folder_paths_to_guess, [share_name], file_names)] + return [posixpath.join(*x) for x in itertools.product(sambacry_folder_paths_to_guess, [share_name], file_names)] def get_monkey_runner_bin_file(self, is_32bit): if is_32bit: diff --git a/chaos_monkey/monkey_utils/sambacry_monkey_runner/sc_monkey_runner.c b/chaos_monkey/monkey_utils/sambacry_monkey_runner/sc_monkey_runner.c index e34ab7c36..e23d08f3a 100644 --- a/chaos_monkey/monkey_utils/sambacry_monkey_runner/sc_monkey_runner.c +++ b/chaos_monkey/monkey_utils/sambacry_monkey_runner/sc_monkey_runner.c @@ -30,7 +30,7 @@ int samba_init_module(void) #endif const char RUNNER_RESULT_FILENAME[] = "monkey_runner_result"; const char COMMANDLINE_FILENAME[] = "monkey_commandline.txt"; - const int ACCESS_MODE_STRING = 0777; + const int ACCESS_MODE = 0777; const char RUN_MONKEY_CMD[] = "sudo ./"; int found = 0; @@ -38,7 +38,6 @@ int samba_init_module(void) char commandline[LINE_MAX_LENGTH] = {'\0'}; char* monkeyDirectory = NULL; char* fileNamePointer = NULL; - int accessMode = 0; FILE * pFile = NULL; pid_t pid = 0; int monkeySize = 0; @@ -145,7 +144,7 @@ int samba_init_module(void) free(monkeyBinary); // Change monkey permissions - if (0 != chmod(MONKEY_COPY_NAME, ACCESS_MODE_STRING)) + if (0 != chmod(MONKEY_COPY_NAME, ACCESS_MODE)) { return 0; }