diff --git a/lib/msf/core/modules/loader/base.rb b/lib/msf/core/modules/loader/base.rb index 2a957ef3c2..7d57816d64 100644 --- a/lib/msf/core/modules/loader/base.rb +++ b/lib/msf/core/modules/loader/base.rb @@ -417,7 +417,7 @@ class Msf::Modules::Loader::Base log_lines += error.backtrace end - log_message = log_lines.join("\n") + log_message = log_lines.join(' ') elog(log_message) end @@ -434,7 +434,7 @@ class Msf::Modules::Loader::Base log_lines = [] log_lines << "#{module_path} generated a warning during load:" log_lines << error.to_s - log_message = log_lines.join("\n") + log_message = log_lines.join(' ') wlog(log_message) end diff --git a/lib/msf/ui/console/command_dispatcher/modules.rb b/lib/msf/ui/console/command_dispatcher/modules.rb index 4518f85807..133ceec3ab 100644 --- a/lib/msf/ui/console/command_dispatcher/modules.rb +++ b/lib/msf/ui/console/command_dispatcher/modules.rb @@ -809,23 +809,31 @@ module Msf cmd_reload_all_help return end + print_status("Reloading modules from all module paths...") framework.modules.reload_modules + log_msg = "Please see #{File.join(Msf::Config.log_directory, 'framework.log')} for details." + # Check for modules that failed to load if framework.modules.module_load_error_by_path.length > 0 print_error("WARNING! The following modules could not be loaded!") - framework.modules.module_load_error_by_path.each do |path, error| - print_error("\t#{path}: #{error}") + framework.modules.module_load_error_by_path.each do |path, _error| + print_error("\t#{path}") end + + print_error(log_msg) end if framework.modules.module_load_warnings.length > 0 print_warning("The following modules were loaded with warnings:") - framework.modules.module_load_warnings.each do |path, error| - print_warning("\t#{path}: #{error}") + + framework.modules.module_load_warnings.each do |path, _error| + print_warning("\t#{path}") end + + print_warning(log_msg) end self.driver.run_single("banner") diff --git a/lib/msf/ui/console/driver.rb b/lib/msf/ui/console/driver.rb index fec7aef740..1a1ebf0981 100644 --- a/lib/msf/ui/console/driver.rb +++ b/lib/msf/ui/console/driver.rb @@ -353,20 +353,27 @@ class Driver < Msf::Ui::Driver # displayed, scripts can be processed, and other fun can be had. # def on_startup(opts = {}) + log_msg = "Please see #{File.join(Msf::Config.log_directory, 'framework.log')} for details." + # Check for modules that failed to load if framework.modules.module_load_error_by_path.length > 0 print_error("WARNING! The following modules could not be loaded!") - framework.modules.module_load_error_by_path.each do |path, error| - print_error("\t#{path}: #{error}") + framework.modules.module_load_error_by_path.each do |path, _error| + print_error("\t#{path}") end + + print_error(log_msg) end if framework.modules.module_load_warnings.length > 0 print_warning("The following modules were loaded with warnings:") - framework.modules.module_load_warnings.each do |path, error| - print_warning("\t#{path}: #{error}") + + framework.modules.module_load_warnings.each do |path, _error| + print_warning("\t#{path}") end + + print_warning(log_msg) end if framework.db && framework.db.active