From 2fab84636e887cd7e19d7638a68c6763ed7ef573 Mon Sep 17 00:00:00 2001 From: Kekoa Kaaikala Date: Wed, 21 Sep 2022 17:47:56 +0000 Subject: [PATCH] Agent: Fix mypy issues in exploit/tools/helpers.py --- monkey/infection_monkey/exploit/tools/helpers.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/monkey/infection_monkey/exploit/tools/helpers.py b/monkey/infection_monkey/exploit/tools/helpers.py index e268fe4c3..c81da81d9 100644 --- a/monkey/infection_monkey/exploit/tools/helpers.py +++ b/monkey/infection_monkey/exploit/tools/helpers.py @@ -15,12 +15,13 @@ AGENT_BINARY_PATH_WIN64 = PureWindowsPath(r"C:\Windows\temp\monkey64.exe") def get_agent_dst_path(host: VictimHost) -> PurePath: - if host.is_windows(): - path = PureWindowsPath(AGENT_BINARY_PATH_WIN64) - else: - path = PurePosixPath(AGENT_BINARY_PATH_LINUX) + return _add_random_suffix(_get_agent_path(host)) - return _add_random_suffix(path) + +def _get_agent_path(host: VictimHost) -> PurePath: + if host.is_windows(): + return PureWindowsPath(AGENT_BINARY_PATH_WIN64) + return PurePosixPath(AGENT_BINARY_PATH_LINUX) def get_random_file_suffix() -> str: