Skip to content

Commit 9aa0159

Browse files
committed
Green rank_modules ranks unloadable as Manual
MSP-12557 Was calling `.class` blindly on the output of `create`, but `nil` has a class, `NilClass`, so it didn't call `module_rank` as expected and assigned NormaLRanking to `nil` instead of ManualRanking.
1 parent 16234fe commit 9aa0159

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/msf/core/module_set.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,11 @@ def module_rank(reference_name, metasploit_module_class)
340340
# TODO don't create an instance just to get the Class.
341341
created_metasploit_module_instance = create(reference_name)
342342

343-
module_rank(reference_name, created_metasploit_module_instance.class)
343+
if created_metasploit_module_instance.nil?
344+
module_rank(reference_name, nil)
345+
else
346+
module_rank(reference_name, created_metasploit_module_instance.class)
347+
end
344348
elsif metasploit_module_class.const_defined? :Rank
345349
metasploit_module_class.const_get :Rank
346350
else

0 commit comments

Comments
 (0)