diff --git a/chaos_monkey/config.py b/chaos_monkey/config.py index 2fb40cdb4..121c84ea2 100644 --- a/chaos_monkey/config.py +++ b/chaos_monkey/config.py @@ -104,12 +104,12 @@ class Configuration(object): singleton_mutex_name = "{2384ec59-0df8-4ab9-918c-843740924a28}" # how long to wait between scan iterations - timeout_between_iterations = 300 + timeout_between_iterations = 10 # how many scan iterations to perform on each run - max_iterations = 3 + max_iterations = 1 - scanner_class = TcpScanner + scanner_class = PingScanner finger_classes = (SMBFinger, SSHFinger, PingScanner) exploiter_classes = (SmbExploiter, WmiExploiter, RdpExploiter, Ms08_067_Exploiter, SSHExploiter) @@ -136,10 +136,10 @@ class Configuration(object): # scanners config ########################### - range_class = RelativeRange - range_size = 30 + range_class = ClassCRange + # range_size = 1 # range_class = FixedRange - range_fixed = ("", ) + # range_fixed = ("", ) # TCP Scanner tcp_target_ports = [22, 2222, 445, 135, 3389] diff --git a/chaos_monkey/exploit/tools.py b/chaos_monkey/exploit/tools.py index 6939161bc..c39251f0f 100644 --- a/chaos_monkey/exploit/tools.py +++ b/chaos_monkey/exploit/tools.py @@ -17,7 +17,10 @@ from impacket.smb3structs import SMB2_DIALECT_002, SMB2_DIALECT_21 from impacket.dcerpc.v5.dcomrt import DCOMConnection from impacket.dcerpc.v5.dcom import wmi from impacket.dcerpc.v5.dtypes import NULL -from impacket.dcerpc.v5.rpcrt import Exception as DceRpcException + + +class DceRpcException(Exception): + pass __author__ = 'itamar' @@ -55,7 +58,7 @@ class WmiTools(object): try: iInterface = dcom.CoCreateInstanceEx(wmi.CLSID_WbemLevel1Login, wmi.IID_IWbemLevel1Login) - except DceRpcException, exc: + except Exception, exc: dcom.disconnect() if "rpc_s_access_denied" == exc.message: diff --git a/chaos_monkey/main.py b/chaos_monkey/main.py index 6774bf902..8682508bb 100644 --- a/chaos_monkey/main.py +++ b/chaos_monkey/main.py @@ -60,9 +60,9 @@ def main(): json_dict = json.load(config_fo) WormConfiguration.from_dict(json_dict) except ValueError as e: - print "Error loading config, using default: %s" % e + print "Error loading config: %s, using default" % (e,) else: - print("Config file: %s wasn't found, using default" % config_file) + print("Config file wasn't supplied and default path: %s wasn't found, using internal default" % (config_file,)) print "Loaded Configuration: %r" % WormConfiguration.as_dict() diff --git a/chaos_monkey/monkey.py b/chaos_monkey/monkey.py index 0de821fc5..af8e69143 100644 --- a/chaos_monkey/monkey.py +++ b/chaos_monkey/monkey.py @@ -181,6 +181,7 @@ class ChaosMonkey(object): monkey_tunnel.join() def cleanup(self): + LOG.info("Monkey is shutting down") self._keep_running = False self._singleton.unlock() diff --git a/chaos_monkey/network/range.py b/chaos_monkey/network/range.py index 8bfd4c7fc..4fa2f423c 100644 --- a/chaos_monkey/network/range.py +++ b/chaos_monkey/network/range.py @@ -52,7 +52,9 @@ class RelativeRange(NetworkRange): socket.inet_ntoa(struct.pack(">L", self._base_address + self._size))) def _get_range(self): - return range(-self._size, self._size + 1) + lower_end = -(self._size / 2) + higher_end = lower_end + self._size + return range(lower_end, higher_end + 1) class FixedRange(NetworkRange):