Land #10422, conditionally require in msfdb_ws

Dependency loading requirements for msfdb_ws were causing a long wait
time for the help option.
GSoC/Meterpreter_Web_Console
Matthew Kienow 2018-08-05 09:15:47 -04:00
commit e1e9d6e9ca
No known key found for this signature in database
GPG Key ID: 40787F8B1EAC6E41
1 changed files with 7 additions and 4 deletions

View File

@ -3,10 +3,6 @@
#
# Starts the HTTP DB Service interface
require 'pathname'
require Pathname.new(__FILE__).realpath.expand_path.parent.join('config', 'boot')
require 'msf/core/db_manager/http/http_db_manager_service'
require 'optparse'
class HelpError < StandardError; end
@ -17,6 +13,12 @@ class SwitchError < StandardError
end
end
def require_deps
require 'pathname'
require Pathname.new(__FILE__).realpath.expand_path.parent.join('config', 'boot')
require 'msf/core/db_manager/http/http_db_manager_service'
end
def parse_args(args)
opts = {}
opt = OptionParser.new
@ -71,6 +73,7 @@ end
begin
opts = parse_args(ARGV)
raise SwitchError.new("certificate file must be specified when using -s") if opts[:ssl] && (opts[:ssl_cert].nil?)
require_deps
HttpDBManagerService.new.start(:Port => opts[:port],
:Host => opts[:interface],
:ssl => opts[:ssl],