Skip to content

Commit db36cf5

Browse files
author
Brent Cook
committed
2 parents d0f6d4e + 56cf6b1 commit db36cf5

File tree

1 file changed

+5
-1
lines changed
  • lib/rex/post/meterpreter/extensions/stdapi/fs

1 file changed

+5
-1
lines changed

lib/rex/post/meterpreter/extensions/stdapi/fs/dir.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,11 @@ def Dir.download(dst, src, opts, force = true, glob = nil, &stat)
222222
end
223223

224224
dir_files.each { |src_sub|
225-
dst_item = dst + ::File::SEPARATOR + client.unicode_filter_encode(src_sub)
225+
dst_sub = src_sub.dup
226+
dst_sub.gsub!(::File::SEPARATOR, '_') # '/' on all systems
227+
dst_sub.gsub!(::File::ALT_SEPARATOR, '_') if ::File::ALT_SEPARATOR # nil on Linux, '\' on Windows
228+
229+
dst_item = ::File.join(dst, client.unicode_filter_encode(dst_sub))
226230
src_item = src + client.fs.file.separator + client.unicode_filter_encode(src_sub)
227231

228232
if (src_sub == '.' or src_sub == '..')

0 commit comments

Comments
 (0)