move query fields to a constant

these fields should never change, so put the array
in a constant and freeze it to prevent accidental tampering
bug/bundler_fix
David Maloney 2015-01-14 13:20:00 -06:00
parent 82939595f8
commit 9b344a9605
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
1 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@ class Metasploit3 < Msf::Post
include Msf::Post::Windows::Accounts
UAC_DISABLED = 0x02
USER_FIELDS = ['sAMAccountName', 'userAccountControl', 'lockoutTime', 'mail', 'primarygroupid', 'description'].freeze
def initialize(info = {})
super(update_info(
@ -73,7 +74,7 @@ class Metasploit3 < Msf::Post
search_filter = "(&#{inner_filter})"
begin
q = query(search_filter, max_search, fields)
q = query(search_filter, max_search, USER_FIELDS)
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
# Can't bind or in a network w/ limited accounts
print_error(e.message)
@ -90,7 +91,7 @@ class Metasploit3 < Msf::Post
'Header' => "Domain Users",
'Indent' => 1,
'SortIndex' => -1,
'Columns' => fields
'Columns' => USER_FIELDS
)
q[:results].each do |result|