From c4f9f774afdf90e53a16213ecd1d8ecf27d42368 Mon Sep 17 00:00:00 2001 From: Itay Mizeretz Date: Tue, 19 Dec 2017 18:43:20 +0200 Subject: [PATCH] Fix bug running from path with spaces --- monkey_island/cc/resources/local_run.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/monkey_island/cc/resources/local_run.py b/monkey_island/cc/resources/local_run.py index 2fe7be3d1..3f11eb2a4 100644 --- a/monkey_island/cc/resources/local_run.py +++ b/monkey_island/cc/resources/local_run.py @@ -36,9 +36,11 @@ def run_local_monkey(): # run the monkey try: - args = ["%s m0nk3y -s %s:%s" % (target_path, local_ip_addresses()[0], ISLAND_PORT)] if sys.platform == "win32": + args = ['"%s" m0nk3y -s %s:%s' % (target_path, local_ip_addresses()[0], ISLAND_PORT)] args = "".join(args) + else: + args = ['%s m0nk3y -s %s:%s' % (target_path, local_ip_addresses()[0], ISLAND_PORT)] pid = subprocess.Popen(args, shell=True).pid except Exception as exc: return False, "popen failed: %s" % exc