From e5935e43c1eb2afb26036641efee76937f5d0cc3 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Wed, 28 Apr 2021 11:00:53 -0400 Subject: [PATCH] agent: Add TODOs regarding string templates. --- monkey/infection_monkey/dropper.py | 4 ++++ monkey/infection_monkey/windows_upgrader.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/monkey/infection_monkey/dropper.py b/monkey/infection_monkey/dropper.py index ec0c5c03e..902d30280 100644 --- a/monkey/infection_monkey/dropper.py +++ b/monkey/infection_monkey/dropper.py @@ -143,6 +143,8 @@ class MonkeyDrops(object): ) if OperatingSystem.Windows == SystemInfoCollector.get_os(): + # TODO: Replace all of this string templating with a function that accepts + # the necessary parameters and returns a list of arguments. monkey_cmdline = ( MONKEY_CMDLINE_WINDOWS % {"monkey_path": self._config["destination_path"]} + monkey_options @@ -164,6 +166,8 @@ class MonkeyDrops(object): dest_path = self._config["destination_path"] # In Linux, we need to change the directory first, which is done # using thw `cwd` argument in `subprocess.Popen` below + # TODO: Replace all of this string templating with a function that accepts + # the necessary parameters and returns a list of arguments. monkey_cmdline = ( MONKEY_CMDLINE_LINUX % {"monkey_filename": dest_path.split("/")[-1]} + monkey_options diff --git a/monkey/infection_monkey/windows_upgrader.py b/monkey/infection_monkey/windows_upgrader.py index db1446a45..d81b7dc52 100644 --- a/monkey/infection_monkey/windows_upgrader.py +++ b/monkey/infection_monkey/windows_upgrader.py @@ -46,6 +46,8 @@ class WindowsUpgrader(object): opts.parent, opts.tunnel, opts.server, opts.depth ) + # TODO: Replace all of this string templating with a function that accepts + # the necessary parameters and returns a list of arguments. monkey_cmdline = ( MONKEY_CMDLINE_WINDOWS % {"monkey_path": WormConfiguration.dropper_target_path_win_64} + monkey_options