Log when loading an invalid external module type

GSoC/Meterpreter_Web_Console
Adam Cammack 2018-05-04 15:55:21 -05:00
parent de70a5935e
commit 0834c1aabd
No known key found for this signature in database
GPG Key ID: C9378BA088092D66
2 changed files with 8 additions and 3 deletions

View File

@ -18,8 +18,7 @@ class Msf::Modules::External::Shim
when 'multi_scanner'
multi_scanner(mod)
else
# TODO have a nice load error show up in the logs
''
nil
end
end

View File

@ -85,7 +85,13 @@ class Msf::Modules::Loader::Executable < Msf::Modules::Loader::Base
return ''
end
begin
Msf::Modules::External::Shim.generate(full_path)
content = Msf::Modules::External::Shim.generate(full_path)
if content
return content
else
elog "Unable to load module #{full_path}, unknown module type"
return ''
end
rescue ::Exception => e
elog "Unable to load module #{full_path} #{e.class} #{e} #{e.backtrace.join "\n"}"
# XXX migrate this to a full load_error when we can tell the user why the