diff --git a/monkey/infection_monkey/config.py b/monkey/infection_monkey/config.py index 0abf6b19c..8e9ffce8f 100644 --- a/monkey/infection_monkey/config.py +++ b/monkey/infection_monkey/config.py @@ -85,7 +85,7 @@ class Configuration(object): current_server = "" # Configuration servers to try to connect to, in this order. - command_servers = ["192.0.2.0:5000"] + command_servers = [] keep_tunnel_open_time = 60 diff --git a/monkey/infection_monkey/exploit/smbexec.py b/monkey/infection_monkey/exploit/smbexec.py index 109771bd4..2afc74439 100644 --- a/monkey/infection_monkey/exploit/smbexec.py +++ b/monkey/infection_monkey/exploit/smbexec.py @@ -87,13 +87,13 @@ class SMBExploiter(HostExploiter): return self.exploit_result # execute the remote dropper in case the path isn't final - if remote_full_path.lower() != dest_path.lower(): + if remote_full_path.lower() != str(dest_path).lower(): cmdline = DROPPER_CMDLINE_DETACHED_WINDOWS % { "dropper_path": remote_full_path } + build_monkey_commandline( self.host, self.current_depth - 1, - dest_path, + str(dest_path), ) else: cmdline = MONKEY_CMDLINE_DETACHED_WINDOWS % { diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 0abd47149..66d881d93 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -120,13 +120,8 @@ class InfectionMonkey: @staticmethod def _add_default_server_to_config(default_server: str): if default_server: - if default_server not in WormConfiguration.command_servers: - logger.debug("Added default server: %s" % default_server) - WormConfiguration.command_servers.insert(0, default_server) - else: - logger.debug( - "Default server: %s is already in command servers list" % default_server - ) + logger.debug("Added default server: %s" % default_server) + WormConfiguration.command_servers.insert(0, default_server) def _connect_to_island(self): # Sets island's IP and port for monkey to communicate to @@ -302,9 +297,7 @@ class InfectionMonkey: @staticmethod def _close_tunnel(): - tunnel_address = ( - ControlClient.proxies.get("https", "").replace("https://", "").split(":")[0] - ) + tunnel_address = ControlClient.proxies.get("https", "").replace("http://", "").split(":")[0] if tunnel_address: logger.info("Quitting tunnel %s", tunnel_address) tunnel.quit_tunnel(tunnel_address)