Agent: Use different proxy scheme on Windows

This commit is contained in:
Mike Salvatore 2021-10-05 13:51:03 -04:00
parent e80662f7f8
commit c124db7880
1 changed files with 14 additions and 1 deletions

View File

@ -115,7 +115,20 @@ class ControlClient(object):
if proxy_find:
proxy_address, proxy_port = proxy_find
logger.info("Found tunnel at %s:%s" % (proxy_address, proxy_port))
ControlClient.proxies["https"] = PROXY_SCHEMA % (proxy_address, proxy_port)
from infection_monkey.utils.environment import is_windows_os
logger.info(f"requests version: {requests.__version__}")
import urllib3
logger.info(f"urllib3 version: {urllib3.__version__}")
if is_windows_os():
ControlClient.proxies["https"] = "https://%s:%s" % (
proxy_address,
proxy_port,
)
else:
ControlClient.proxies["https"] = PROXY_SCHEMA % (proxy_address, proxy_port)
logger.info(ControlClient.proxies)
return ControlClient.find_server()
else:
logger.info("No tunnel found")