windows环境下安装metasploit带有中文路径时无法启动的解决方法

来源:互联网 发布:mp3剪切大师软件 编辑:程序博客网 时间:2024/05/01 13:45

修改目录下的apps\pro\msf3\lib\msf\base\simple\framework\module_paths.rb文件


module Msf  module Simple    module Framework      module ModulePaths        # Initialize the module paths        #        # @return [void]        def init_module_paths(opts={})          # Ensure the module cache is accurate          self.modules.refresh_cache_from_database          # Initialize the default module search paths          if (Msf::Config.module_directory)            self.modules.add_module_path(Msf::Config.module_directory, opts)          end          # Initialize the user module search path          if (Msf::Config.user_module_directory)            self.modules.add_module_path(Msf::Config.user_module_directory.force_encoding('GBK').encode('utf-8'), opts)          end          # If additional module paths have been defined globally, then load them.          # They should be separated by semi-colons.          if self.datastore['MsfModulePaths']            self.datastore['MsfModulePaths'].split(";").each { |path|              self.modules.add_module_path(path, opts)            }          end        end      end    end  endend

self.modules.add_module_path(Msf::Config.user_module_directory.force_encoding('GBK').encode('utf-8'), opts)

这一行进行转码即可

0 0
原创粉丝点击