Skip to content

Commit e414bdb

Browse files
author
Brent Cook
committed
don't try to guess intent for specified default targets, leave auto-auto targeting to unspecified modules
1 parent 30c48de commit e414bdb

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

lib/msf/core/exploit.rb

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,17 @@ def initialize(info = {})
287287
# to the information hash.
288288
super(info)
289289

290-
self.default_target = info['DefaultTarget'] || 0
291-
292-
# Add an auto-target to the exploit if it doesn't have one
293-
if info['Targets'] && info['Targets'].count > 1 && !has_auto_target?(info['Targets'])
294-
# Finally, only add the target if there is a remote host option
295-
if self.respond_to?(:rhost) && self.respond_to?(:auto_targeted_index)
296-
auto = ["Automatic", {'AutoGenerated' => true}.merge(info['Targets'][self.default_target][1])]
297-
info['Targets'].unshift(auto)
290+
if info.key? 'DefaultTarget'
291+
self.default_target = info['DefaultTarget']
292+
else
293+
self.default_target = 0
294+
# Add an auto-target to the exploit if it doesn't have one
295+
if info['Targets'] && info['Targets'].count > 1 && !has_auto_target?(info['Targets'])
296+
# Finally, only add the target if there is a remote host option
297+
if self.respond_to?(:rhost) && self.respond_to?(:auto_targeted_index)
298+
auto = ["Automatic", {'AutoGenerated' => true}.merge(info['Targets'][self.default_target][1])]
299+
info['Targets'].unshift(auto)
300+
end
298301
end
299302
end
300303

modules/exploits/linux/misc/quest_pmmasterd_bof.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def initialize(info = {})
6262
],
6363
'Privileged' => true,
6464
'DisclosureDate' => 'Apr 09 2017',
65-
'DefaultTarget' => 1
65+
'DefaultTarget' => 0
6666
)
6767
)
6868

0 commit comments

Comments
 (0)