From 3597e08628fd18e60fb62f8dc10895e645a2b28d Mon Sep 17 00:00:00 2001 From: Ilija Lazoroski Date: Fri, 15 Apr 2022 15:39:59 +0200 Subject: [PATCH] Agent: Rename api/monkey endpoint to api/agent --- monkey/infection_monkey/control.py | 6 +++--- monkey/infection_monkey/exploit/caching_agent_repository.py | 2 +- monkey/infection_monkey/master/control_channel.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/monkey/infection_monkey/control.py b/monkey/infection_monkey/control.py index 54a65d04a..ce4d14840 100644 --- a/monkey/infection_monkey/control.py +++ b/monkey/infection_monkey/control.py @@ -50,7 +50,7 @@ class ControlClient(object): monkey["tunnel"] = ControlClient.proxies.get("https") requests.post( # noqa: DUO123 - "https://%s/api/monkey" % (WormConfiguration.current_server,), + "https://%s/api/agent" % (WormConfiguration.current_server,), data=json.dumps(monkey), headers={"content-type": "application/json"}, verify=False, @@ -173,7 +173,7 @@ class ControlClient(object): return try: reply = requests.get( # noqa: DUO123 - "https://%s/api/monkey/%s/legacy" % (WormConfiguration.current_server, GUID), + "https://%s/api/agent/%s/legacy" % (WormConfiguration.current_server, GUID), verify=False, proxies=ControlClient.proxies, timeout=MEDIUM_REQUEST_TIMEOUT, @@ -210,7 +210,7 @@ class ControlClient(object): return try: requests.patch( # noqa: DUO123 - "https://%s/api/monkey/%s" % (WormConfiguration.current_server, GUID), + "https://%s/api/agent/%s" % (WormConfiguration.current_server, GUID), data=json.dumps({"config_error": True}), headers={"content-type": "application/json"}, verify=False, diff --git a/monkey/infection_monkey/exploit/caching_agent_repository.py b/monkey/infection_monkey/exploit/caching_agent_repository.py index 9d24746ad..dbe58f58f 100644 --- a/monkey/infection_monkey/exploit/caching_agent_repository.py +++ b/monkey/infection_monkey/exploit/caching_agent_repository.py @@ -33,7 +33,7 @@ class CachingAgentRepository(IAgentRepository): @lru_cache(maxsize=None) def _download_binary_from_island(self, os: str) -> bytes: response = requests.get( # noqa: DUO123 - f"{self._island_url}/api/monkey/download/{os}", + f"{self._island_url}/api/agent/download/{os}", verify=False, proxies=self._proxies, timeout=MEDIUM_REQUEST_TIMEOUT, diff --git a/monkey/infection_monkey/master/control_channel.py b/monkey/infection_monkey/master/control_channel.py index a74724991..ad8361c62 100644 --- a/monkey/infection_monkey/master/control_channel.py +++ b/monkey/infection_monkey/master/control_channel.py @@ -50,7 +50,7 @@ class ControlChannel(IControlChannel): def get_config(self) -> dict: try: response = requests.get( # noqa: DUO123 - "https://%s/api/monkey/%s" % (WormConfiguration.current_server, self._agent_id), + "https://%s/api/agent/%s" % (WormConfiguration.current_server, self._agent_id), verify=False, proxies=ControlClient.proxies, timeout=SHORT_REQUEST_TIMEOUT,