Agent: Remove disused methods from ControlClient

This commit is contained in:
Mike Salvatore 2022-03-15 12:58:24 -04:00
parent 5d2303f300
commit 5a708db5cc
1 changed files with 0 additions and 44 deletions

View File

@ -132,28 +132,6 @@ class ControlClient(object):
else: else:
ControlClient.proxies["https"] = f"{proxy_address}:{proxy_port}" ControlClient.proxies["https"] = f"{proxy_address}:{proxy_port}"
@staticmethod
def keepalive():
if not WormConfiguration.current_server:
return
try:
monkey = {}
if ControlClient.proxies:
monkey["tunnel"] = ControlClient.proxies.get("https")
requests.patch( # noqa: DUO123
"https://%s/api/monkey/%s" % (WormConfiguration.current_server, GUID),
data=json.dumps(monkey),
headers={"content-type": "application/json"},
verify=False,
proxies=ControlClient.proxies,
timeout=MEDIUM_REQUEST_TIMEOUT,
)
except Exception as exc:
logger.warning(
"Error connecting to control server %s: %s", WormConfiguration.current_server, exc
)
return {}
@staticmethod @staticmethod
def send_telemetry(telem_category, json_data: str): def send_telemetry(telem_category, json_data: str):
if not WormConfiguration.current_server: if not WormConfiguration.current_server:
@ -252,28 +230,6 @@ class ControlClient(object):
) )
return {} return {}
@staticmethod
def check_for_stop():
ControlClient.load_control_config()
return not WormConfiguration.alive
@staticmethod
def spoof_host_os_info(is_windows, is_32bit):
if is_windows:
os = "windows"
if is_32bit:
arch = "x86"
else:
arch = "amd64"
else:
os = "linux"
if is_32bit:
arch = "i686"
else:
arch = "x86_64"
return {"os": {"type": os, "machine": arch}}
@staticmethod @staticmethod
def create_control_tunnel(): def create_control_tunnel():
if not WormConfiguration.current_server: if not WormConfiguration.current_server: