Fix bug running from path with spaces

This commit is contained in:
Itay Mizeretz 2017-12-19 18:43:20 +02:00
parent 1f571503ad
commit c4f9f774af
1 changed files with 3 additions and 1 deletions

View File

@ -36,9 +36,11 @@ def run_local_monkey():
# run the monkey # run the monkey
try: try:
args = ["%s m0nk3y -s %s:%s" % (target_path, local_ip_addresses()[0], ISLAND_PORT)]
if sys.platform == "win32": if sys.platform == "win32":
args = ['"%s" m0nk3y -s %s:%s' % (target_path, local_ip_addresses()[0], ISLAND_PORT)]
args = "".join(args) 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 pid = subprocess.Popen(args, shell=True).pid
except Exception as exc: except Exception as exc:
return False, "popen failed: %s" % exc return False, "popen failed: %s" % exc