diff --git a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb index 0020094b8d..3d3ff3d1ac 100644 --- a/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb +++ b/lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb @@ -689,10 +689,10 @@ class Console::CommandDispatcher::Stdapi::Fs return true end - args.each { |dir| - print_line("Creating directory: #{dir}") - - client.fs.dir.mkdir(dir) + args.each { |dir_path| + dir_path = client.fs.file.expand_path(dir_path) if dir_path =~ PATH_EXPAND_REGEX + print_line("Creating directory: #{dir_path}") + client.fs.dir.mkdir(dir_path) } return true