From 7d32166c7012bbe2ec9acbaa0ce23a96af899718 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Sun, 29 Jan 2017 19:18:23 -0600 Subject: [PATCH] use a better check for whether rhosts exists --- lib/msf/core/exploit.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/msf/core/exploit.rb b/lib/msf/core/exploit.rb index 4846670e9a..f9fd8fd699 100644 --- a/lib/msf/core/exploit.rb +++ b/lib/msf/core/exploit.rb @@ -294,7 +294,7 @@ class Exploit < Msf::Module # Don't add the automatic target unless there's already more than one target to pick from if info['Targets'].count > 1 # Finally, only add the target if there is a remote host option - if self.respond_to?(:rhost) + if self.options['RHOST'] auto = ["Automatic", { 'AutoGenerated' => true}] info['Targets'].unshift(auto) end @@ -302,7 +302,6 @@ class Exploit < Msf::Module end end - self.targets = Rex::Transformer.transform(info['Targets'], Array, [ Target ], 'Targets') self.default_target = info['DefaultTarget'] || 0 @@ -702,7 +701,6 @@ class Exploit < Msf::Module datastore['TARGET'] = 1 end end - end target_idx = target_index