handle unicode changes

changed everything to utf-8 , so several sizes
on the ruby side needed to be changed to account for this

MSP-12358
bug/bundler_fix
David Maloney 2015-06-02 12:46:21 -05:00
parent fd1a24d6f9
commit 5d68a8167b
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
2 changed files with 5 additions and 7 deletions

View File

@ -6,17 +6,17 @@ module Metasploit
class Account
# Size of an NTDS Account Struct on the Wire
ACCOUNT_SIZE = 3948
ACCOUNT_SIZE = 2908
# Size of a Date or Time Format String on the Wire
DATE_TIME_STRING_SIZE = 30
# Size of the AccountDescription Field
DESCRIPTION_SIZE =2048
DESCRIPTION_SIZE =1024
# Size of a Hash History Record
HASH_HISTORY_SIZE = 792
# Size of a Hash String
HASH_SIZE = 33
# Size of the samAccountName field
NAME_SIZE = 40
NAME_SIZE = 20
#@return [String] The AD Account Description
attr_accessor :description

View File

@ -6,10 +6,8 @@ module Metasploit
# to provide a simple interface for enumerating AD user accounts.
class Parser
# The size, in bytes, of an NTDS account object
ACCOUNT_SIZE = 3948
# The size, in Bytes, of a batch of NTDS accounts
BATCH_SIZE = 78960
BATCH_SIZE = (Metasploit::Framework::NTDS::Account::ACCOUNT_SIZE * 20)
#@return [Rex::Post::Meterpreter::Channels::Pool] The Meterpreter NTDS Parser Channel
attr_accessor :channel
@ -36,7 +34,7 @@ module Metasploit
until raw_batch_data.nil?
batch = raw_batch_data.dup
while batch.present?
raw_data = batch.slice!(0,ACCOUNT_SIZE)
raw_data = batch.slice!(0,Metasploit::Framework::NTDS::Account::ACCOUNT_SIZE)
# Make sure our data isn't all Null-bytes
if raw_data.match(/[^\x00]/)
account = Metasploit::Framework::NTDS::Account.new(raw_data)