From d9ba993d255e8cf76aa573c23b4313fc7c822fae Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sun, 9 Apr 2017 11:50:03 -0500 Subject: [PATCH 1/2] handle general failure getting module info for external modules --- lib/msf/core/modules/loader/executable.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/msf/core/modules/loader/executable.rb b/lib/msf/core/modules/loader/executable.rb index 92326e94e1..6ee064d8f8 100644 --- a/lib/msf/core/modules/loader/executable.rb +++ b/lib/msf/core/modules/loader/executable.rb @@ -82,6 +82,11 @@ class Msf::Modules::Loader::Executable < Msf::Modules::Loader::Base load_error(full_path, Errno::ENOENT.new) return '' end - Msf::Modules::External::Shim.generate(full_path) + begin + Msf::Modules::External::Shim.generate(full_path) + rescue ::Exception => e + elog "Unable to load module #{full_path} #{e.class} #{e}" + '' + end end end From 0189c403172c34138745aa3aabaa3d0ff6a188d3 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sun, 9 Apr 2017 15:03:05 -0500 Subject: [PATCH 2/2] compromise --- lib/msf/core/modules/loader/executable.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/msf/core/modules/loader/executable.rb b/lib/msf/core/modules/loader/executable.rb index 6ee064d8f8..ec9a00d458 100644 --- a/lib/msf/core/modules/loader/executable.rb +++ b/lib/msf/core/modules/loader/executable.rb @@ -86,6 +86,9 @@ class Msf::Modules::Loader::Executable < Msf::Modules::Loader::Base Msf::Modules::External::Shim.generate(full_path) rescue ::Exception => e elog "Unable to load module #{full_path} #{e.class} #{e}" + # XXX migrate this to a full load_error when we can tell the user why the + # module did not load and/or how to resolve it. + # load_error(full_path, e) '' end end