Skip to content

Commit d564f5d

Browse files
David MaloneyDavid Maloney
authored andcommitted
don't add auto targets to things without rhost
Things like browser exploits don't have remote host options which is what auto targeting relies on, so it does not make sense to include the auto-targeting in these exploits 7837
1 parent 4035dd7 commit d564f5d

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)