Skip to content

Commit ed435ca

Browse files
committed
Land rapid7#7838, don't add auto targets to things without rhost
2 parents 4035dd7 + d564f5d commit ed435ca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/msf/core/exploit.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,11 @@ def initialize(info = {})
293293
unless has_auto_target?(info['Targets'])
294294
# Don't add the automatic target unless there's already more than one target to pick from
295295
if info['Targets'].count > 1
296-
auto = ["Automatic", { 'AutoGenerated' => true}]
297-
info['Targets'].unshift(auto)
296+
# Finally, only add the target if there is a remote host option
297+
if self.respond_to?(:rhost)
298+
auto = ["Automatic", { 'AutoGenerated' => true}]
299+
info['Targets'].unshift(auto)
300+
end
298301
end
299302
end
300303
end

0 commit comments

Comments
 (0)