Agent: Fix tunnel address parsing in _close_tunnel()

The current proxy schema specifies that tunnels start with "http://",
not "https://". This lead to a bug in the tunnel address parsing which
prevented the tunnel from being quit properly.
This commit is contained in:
Mike Salvatore 2022-03-24 12:27:22 -04:00
parent ef134be044
commit 8aad5b16d5
1 changed files with 1 additions and 3 deletions

View File

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