1
mirror of https://github.com/rapid7/metasploit-payloads synced 2024-11-26 17:41:08 +01:00

Fix #512, fix python cmd_exec argument list during PROCESS_EXECUTE_FLAG_SUBSHELL

This commit is contained in:
Tim W 2021-12-08 08:12:47 +00:00
parent d08b1b31e8
commit a59fd61520

View File

@ -1163,7 +1163,9 @@ def stdapi_sys_process_execute(request, response):
if len(cmd) == 0:
return ERROR_FAILURE, response
if os.path.isfile('/bin/sh') and (flags & PROCESS_EXECUTE_FLAG_SUBSHELL):
args = ['/bin/sh', '-c', cmd, raw_args]
if raw_args:
cmd = cmd + ' ' + raw_args
args = ['/bin/sh', '-c', cmd]
else:
args = [cmd]
args.extend(shlex.split(raw_args))