Skip to content

Commit 70bfdf1

Browse files
committed
Check payload options before showing RHOST warning
1 parent f39e378 commit 70bfdf1

File tree

1 file changed

+8
-1
lines changed
  • lib/msf/ui/console/command_dispatcher

1 file changed

+8
-1
lines changed

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1580,7 +1580,14 @@ def cmd_set(*args)
15801580
mod = active_module
15811581
unless mod.nil?
15821582
if !mod.options.include?('RHOST') && mod.options.include?('RHOSTS')
1583-
print_warning("RHOST is not a valid option for this module. Did you mean RHOSTS?")
1583+
warn_rhost = false
1584+
if (mod.exploit? and mod.datastore['PAYLOAD'])
1585+
p = framework.payloads.create(mod.datastore['PAYLOAD'])
1586+
warn_rhost = (p and !p.options.include?('RHOST'))
1587+
else
1588+
warn_rhost = true
1589+
end
1590+
print_warning("RHOST is not a valid option for this module. Did you mean RHOSTS?") if warn_rhost
15841591
end
15851592
end
15861593
end

0 commit comments

Comments
 (0)