Agent: Use 'relay_port' for relay local port

This commit is contained in:
Kekoa Kaaikala 2022-09-07 18:10:37 +00:00 committed by Mike Salvatore
parent b74c42ff07
commit 33da121465
2 changed files with 4 additions and 4 deletions

View File

@ -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,

View File

@ -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,
],