diff --git a/monkey/infection_monkey/monkey.py b/monkey/infection_monkey/monkey.py index 9ba8e772a..63e0b71d1 100644 --- a/monkey/infection_monkey/monkey.py +++ b/monkey/infection_monkey/monkey.py @@ -181,9 +181,9 @@ class InfectionMonkey: config = control_channel.get_config() - local_port = get_free_tcp_port() + relay_port = get_free_tcp_port() self._relay = TCPRelay( - local_port, + relay_port, IPv4Address(self._cmd_island_ip), self._cmd_island_port, client_disconnect_timeout=config.keep_tunnel_open_time, diff --git a/monkey/infection_monkey/network/relay/tcp_relay.py b/monkey/infection_monkey/network/relay/tcp_relay.py index a8793d91f..cb02999ae 100644 --- a/monkey/infection_monkey/network/relay/tcp_relay.py +++ b/monkey/infection_monkey/network/relay/tcp_relay.py @@ -18,7 +18,7 @@ class TCPRelay(Thread, InterruptableThreadMixin): def __init__( self, - local_port: int, + relay_port: int, dest_addr: IPv4Address, dest_port: int, client_disconnect_timeout: float, @@ -28,7 +28,7 @@ class TCPRelay(Thread, InterruptableThreadMixin): relay_filter = RelayConnectionHandler(self._pipe_spawner, self._user_handler) self._connection_handler = TCPConnectionHandler( bind_host="", - bind_port=local_port, + bind_port=relay_port, client_connected=[ relay_filter.handle_new_connection, ],