Skip to content

Commit 416a5cd

Browse files
committed
Land rapid7#8379, payload opts check for RHOST warning
2 parents 85d99d8 + 78148c7 commit 416a5cd

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? && mod.datastore['PAYLOAD']
1585+
p = framework.payloads.create(mod.datastore['PAYLOAD'])
1586+
warn_rhost = (p && !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)