From 1aec2203e5c41f9490024c40f388ee728e074064 Mon Sep 17 00:00:00 2001 From: Brendan Coles Date: Tue, 7 Mar 2017 21:02:30 +0000 Subject: [PATCH] Warn when setting RHOST option for module which expects RHOSTS --- lib/msf/ui/console/command_dispatcher/core.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/msf/ui/console/command_dispatcher/core.rb b/lib/msf/ui/console/command_dispatcher/core.rb index bb1d2bbc3252..350ca57c203b 100644 --- a/lib/msf/ui/console/command_dispatcher/core.rb +++ b/lib/msf/ui/console/command_dispatcher/core.rb @@ -1531,6 +1531,16 @@ def cmd_set(*args) end end + # Warn when setting RHOST option for module which expects RHOSTS + if args.first.upcase.eql?('RHOST') + mod = active_module + unless mod.nil? + if !mod.options.include?('RHOST') && mod.options.include?('RHOSTS') + print_warning("RHOST is not a valid option for this module. Did you mean RHOSTS?") + end + end + end + # Set the supplied name to the supplied value name = args[0] value = args[1, args.length-1].join(' ')