Skip to content

Commit 522c6dc

Browse files
author
Brent Cook
committed
Land rapid7#7931, Fix CVE-2017-5231 and respect user's dest
2 parents db36cf5 + cb74d3b commit 522c6dc

File tree

1 file changed

+1
-1
lines changed
  • lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi

1 file changed

+1
-1
lines changed

lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ def cmd_download(*args)
442442
files.each do |file|
443443
src_separator = client.fs.file.separator
444444
src_path = file['path'] + client.fs.file.separator + file['name']
445-
dest_path = src_path.tr(src_separator, ::File::SEPARATOR)
445+
dest_path = ::File.join(dest, ::Rex::FileUtils::clean_path(file['path'].tr(src_separator, ::File::SEPARATOR)))
446446

447447
client.fs.file.download(dest_path, src_path, opts) do |step, src, dst|
448448
print_status("#{step.ljust(11)}: #{src} -> #{dst}")

0 commit comments

Comments
 (0)