From 97205e6427d5ad35f6c0628393f5260bafb296fe Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Mon, 21 Aug 2017 11:51:47 +0300 Subject: [PATCH] Fix config property bug --- chaos_monkey/config.py | 3 +-- chaos_monkey/exploit/smbexec.py | 2 +- chaos_monkey/exploit/sshexec.py | 2 +- chaos_monkey/exploit/wmiexec.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/chaos_monkey/config.py b/chaos_monkey/config.py index b2ca2e6ae..a9007edb3 100644 --- a/chaos_monkey/config.py +++ b/chaos_monkey/config.py @@ -209,8 +209,7 @@ class Configuration(object): # User and password dictionaries for exploits. - @property - def exploit_user_password_pairs(self): + def get_exploit_user_password_pairs(self): return product(self.exploit_user_list, self.exploit_password_list) exploit_user_list = ['Administrator', 'root', 'user'] diff --git a/chaos_monkey/exploit/smbexec.py b/chaos_monkey/exploit/smbexec.py index 96fd8f956..307cbfa02 100644 --- a/chaos_monkey/exploit/smbexec.py +++ b/chaos_monkey/exploit/smbexec.py @@ -64,7 +64,7 @@ class SmbExploiter(HostExploiter): LOG.info("Can't find suitable monkey executable for host %r", host) return False - user_password_pairs = self._config.exploit_user_password_pairs + user_password_pairs = self._config.get_exploit_user_password_pairs() exploited = False for user, password in user_password_pairs: diff --git a/chaos_monkey/exploit/sshexec.py b/chaos_monkey/exploit/sshexec.py index aa32549cb..c9ecebaee 100644 --- a/chaos_monkey/exploit/sshexec.py +++ b/chaos_monkey/exploit/sshexec.py @@ -44,7 +44,7 @@ class SSHExploiter(HostExploiter): LOG.info("SSH port is closed on %r, skipping", host) return False - user_password_pairs = self._config.exploit_user_password_pairs + user_password_pairs = self._config.get_exploit_user_password_pairs() exploited = False for user, curpass in user_password_pairs: diff --git a/chaos_monkey/exploit/wmiexec.py b/chaos_monkey/exploit/wmiexec.py index 74b66eaa2..8b4231793 100644 --- a/chaos_monkey/exploit/wmiexec.py +++ b/chaos_monkey/exploit/wmiexec.py @@ -29,7 +29,7 @@ class WmiExploiter(HostExploiter): LOG.info("Can't find suitable monkey executable for host %r", host) return False - user_password_pairs = self._config.exploit_user_password_pairs + user_password_pairs = self._config.get_exploit_user_password_pairs() for user, password in user_password_pairs: LOG.debug("Attempting to connect %r using WMI with password '%s'",