inherit the options from the default target so we can autocomplete before the rhost resolution occurs
parent
6e62899e1c
commit
f4befda59b
|
@ -287,15 +287,17 @@ class Exploit < Msf::Module
|
|||
# to the information hash.
|
||||
super(info)
|
||||
|
||||
self.default_target = info['DefaultTarget'] || 0
|
||||
|
||||
# Skip this whole routine if there are no targets
|
||||
unless info['Targets'].nil?
|
||||
if self.default_target == 0 && info['Targets']
|
||||
# Add an Automatic Target to the Exploit if it doesn't have one
|
||||
unless has_auto_target?(info['Targets'])
|
||||
if !has_auto_target?(info['Targets'])
|
||||
# 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) && self.respond_to?(:auto_targeted_index)
|
||||
auto = ["Automatic", { 'AutoGenerated' => true}]
|
||||
auto = ["Automatic", {'AutoGenerated' => true}.merge(info['Targets'][self.default_target][1])]
|
||||
info['Targets'].unshift(auto)
|
||||
end
|
||||
end
|
||||
|
@ -304,7 +306,6 @@ class Exploit < Msf::Module
|
|||
|
||||
self.targets = Rex::Transformer.transform(info['Targets'], Array,
|
||||
[ Target ], 'Targets')
|
||||
self.default_target = info['DefaultTarget'] || 0
|
||||
self.payload_info = info['Payload'] || {}
|
||||
self.successful = false
|
||||
self.session_count = 0
|
||||
|
|
Loading…
Reference in New Issue