Skip to content

Commit 177e132

Browse files
author
RageLtMan
committed
Aux command dispatcher in exploit ctx with action
The Auxiliary command dispatcher checks modules for passive actions expecting them to have included Msf::Module::HasActions mixin. The mixin is included in post and aux modules already, but not in exploits. When the aux dispatcher handles an exploit module, it may get upset along the lines of: ``` [-] Error while running command exploit: undefined method 'passive' for #<Msf::Modules::M...3::MetasploitModule:0x0000000d83de0428> Did you mean? passive? Call stack: /opt/metasploit4/msf4/lib/msf/ui/console/command_dispatcher/ auxiliary.rb:106:in `cmd_run' ``` Avoid this mess by having the conditional which checks the methods included by that mixin depend on the module having included the mixin in the first place. Testing: In local fork (hence the lineno) it seems to fix the problem. The problem condition and fix should be independently tested upstream.
1 parent d5ab7b1 commit 177e132

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/msf/ui/console/command_dispatcher/auxiliary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def cmd_run(*args)
9898
# Always run passive modules in the background
9999
if (mod.passive || mod.passive_action?(action || mod.default_action))
100100
jobify = true
101-
end
101+
end if mod.is_a?(Msf::Module::HasActions)
102102

103103
begin
104104
mod.run_simple(

0 commit comments

Comments
 (0)