ome minor guards and spec fixes

some minor conditional guards and spec fixes
bug/bundler_fix
David Maloney 2016-12-29 16:45:32 -06:00 committed by Brent Cook
parent 5b512819c8
commit 5fd531028c
4 changed files with 13 additions and 5 deletions

View File

@ -688,10 +688,13 @@ class Exploit < Msf::Module
# default target, that one will be automatically used.
#
def target
auto_idx = auto_targeted_index
unless auto_idx.nil?
datastore['TARGET'] = auto_idx
if self.respond_to?(:auto_targeted_index)
auto_idx = auto_targeted_index
if auto_idx.present?
datastore['TARGET'] = auto_idx
end
end
target_idx = target_index
return (target_idx) ? targets[target_idx.to_i] : nil
end

View File

@ -10,6 +10,7 @@ module Msf
# @return [Boolean] whether or not to use our automatic targeting routine
def auto_target?
selected_target = targets[target_index]
return false if selected_target.nil?
if selected_target.name =~ /Automatic/ && selected_target['AutoGenerated'] == true
true
else

View File

@ -151,7 +151,11 @@ module Exploit::Remote::FirefoxPrivilegeEscalation
# @return [Boolean] the user has selected a javascript (non-native) target
def js_target?
target.arch[0] == ARCH_FIREFOX
if target.arch
target.arch[0] == ARCH_FIREFOX
else
false
end
end
end

View File

@ -394,7 +394,7 @@ RSpec.describe Msf::Ui::Console::CommandDispatcher::Db do
" -n,--name Change the name of a host",
" -m,--comment Change the comment of a host",
" -t,--tag Add or specify a tag to a range of hosts",
"Available columns: address, arch, comm, comments, created_at, cred_count, detected_arch, exploit_attempt_count, host_detail_count, info, mac, name, note_count, os_flavor, os_lang, os_name, os_sp, purpose, scope, service_count, state, updated_at, virtual_host, vuln_count, tags"
"Available columns: address, arch, comm, comments, created_at, cred_count, detected_arch, exploit_attempt_count, host_detail_count, info, mac, name, note_count, os_family, os_flavor, os_lang, os_name, os_sp, purpose, scope, service_count, state, updated_at, virtual_host, vuln_count, tags"
]
end
end