Land #9505, Support local knowledge base documents

MS-2855/keylogger-mettle-extension
Brent Cook 2018-02-19 21:39:55 -06:00
commit b9c1a64d20
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
2 changed files with 9 additions and 4 deletions

View File

@ -29,12 +29,16 @@ module Msf
# @param mod [Msf::Module] Module to create document for.
# @return [void]
def self.get_module_document(mod)
md = ''
kb_path = File.join(PullRequestFinder::MANUAL_BASE_PATH, "#{mod.fullname}.md")
kb_path = nil
kb = ''
if File.exist?(kb_path)
if File.exists?(File.join(PullRequestFinder::USER_MANUAL_BASE_PATH, "#{mod.fullname}.md"))
kb_path = File.join(PullRequestFinder::USER_MANUAL_BASE_PATH, "#{mod.fullname}.md")
elsif File.exists?(File.join(PullRequestFinder::MANUAL_BASE_PATH, "#{mod.fullname}.md"))
kb_path = File.join(PullRequestFinder::MANUAL_BASE_PATH, "#{mod.fullname}.md")
end
unless kb_path.nil?
File.open(kb_path, 'rb') { |f| kb = f.read }
end

View File

@ -11,6 +11,7 @@ module Msf
class Exception < RuntimeError; end
MANUAL_BASE_PATH = File.expand_path(File.join(Msf::Config.module_directory, '..', 'documentation', 'modules' ))
USER_MANUAL_BASE_PATH = File.expand_path(File.join(Msf::Config.user_module_directory, '..', 'documentation', 'modules' ))
# @return [Octokit::Client] Git client
attr_accessor :git_client