diff --git a/lib/msf/core/module_manager.rb b/lib/msf/core/module_manager.rb index 1f5384bcaf..348626f153 100644 --- a/lib/msf/core/module_manager.rb +++ b/lib/msf/core/module_manager.rb @@ -1,4 +1,5 @@ require 'msf/core' +require 'pathname' module Msf @@ -603,6 +604,12 @@ class ModuleManager < ModuleSet def add_module_path(path, check_cache = true) path.sub!(/#{File::SEPARATOR}$/, '') + # Make the path completely canonical + path = File.expand_path(path) + path = Pathname.new(path).realpath.to_s + + $stderr.puts "[*] Adding module path #{path.inspect} ..." + # Make sure the path is a valid directory before we try to rock the # house if (File.directory?(path) == false)