Skip to content

Commit 7652927

Browse files
committed
make sure we can actually invoke auto targeting before adding it
1 parent 7d32166 commit 7652927

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/msf/core/exploit.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ def initialize(info = {})
294294
# Don't add the automatic target unless there's already more than one target to pick from
295295
if info['Targets'].count > 1
296296
# Finally, only add the target if there is a remote host option
297-
if self.options['RHOST']
297+
if self.respond_to?(:rhost) && self.respond_to?(:auto_targeted_index)
298298
auto = ["Automatic", { 'AutoGenerated' => true}]
299299
info['Targets'].unshift(auto)
300300
end

0 commit comments

Comments
 (0)