also be sure to load executable modules if they don't have #!

GSoC/Meterpreter_Web_Console
Brent Cook 2018-04-07 21:15:51 -05:00
parent 28ebe9d102
commit 6c8ea2d883
1 changed files with 3 additions and 2 deletions

View File

@ -43,8 +43,9 @@ class Msf::Modules::Loader::Directory < Msf::Modules::Loader::Base
relative_entry_descendant_pathname = entry_descendant_pathname.relative_path_from(full_entry_pathname)
relative_entry_descendant_path = relative_entry_descendant_pathname.to_s
next if File::basename(relative_entry_descendant_path) == "example.rb"
next if File.executable?(entry_descendant_path) && !File.directory?(entry_descendant_path)
next if File.executable?(entry_descendant_path) &&
!File.directory?(entry_descendant_path) &&
File.read(entry_descendant_path, 2) == "#!"
# The module_reference_name doesn't have a file extension
module_reference_name = module_reference_name_from_path(relative_entry_descendant_path)