Skip to content

Commit 5d68a81

Browse files
David MaloneyDavid Maloney
authored andcommitted
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
1 parent fd1a24d commit 5d68a81

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

lib/metasploit/framework/ntds/account.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ module NTDS
66
class Account
77

88
# Size of an NTDS Account Struct on the Wire
9-
ACCOUNT_SIZE = 3948
9+
ACCOUNT_SIZE = 2908
1010
# Size of a Date or Time Format String on the Wire
1111
DATE_TIME_STRING_SIZE = 30
1212
# Size of the AccountDescription Field
13-
DESCRIPTION_SIZE =2048
13+
DESCRIPTION_SIZE =1024
1414
# Size of a Hash History Record
1515
HASH_HISTORY_SIZE = 792
1616
# Size of a Hash String
1717
HASH_SIZE = 33
1818
# Size of the samAccountName field
19-
NAME_SIZE = 40
19+
NAME_SIZE = 20
2020

2121
#@return [String] The AD Account Description
2222
attr_accessor :description

lib/metasploit/framework/ntds/parser.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ module NTDS
66
# to provide a simple interface for enumerating AD user accounts.
77
class Parser
88

9-
# The size, in bytes, of an NTDS account object
10-
ACCOUNT_SIZE = 3948
119
# The size, in Bytes, of a batch of NTDS accounts
12-
BATCH_SIZE = 78960
10+
BATCH_SIZE = (Metasploit::Framework::NTDS::Account::ACCOUNT_SIZE * 20)
1311

1412
#@return [Rex::Post::Meterpreter::Channels::Pool] The Meterpreter NTDS Parser Channel
1513
attr_accessor :channel
@@ -36,7 +34,7 @@ def each_account
3634
until raw_batch_data.nil?
3735
batch = raw_batch_data.dup
3836
while batch.present?
39-
raw_data = batch.slice!(0,ACCOUNT_SIZE)
37+
raw_data = batch.slice!(0,Metasploit::Framework::NTDS::Account::ACCOUNT_SIZE)
4038
# Make sure our data isn't all Null-bytes
4139
if raw_data.match(/[^\x00]/)
4240
account = Metasploit::Framework::NTDS::Account.new(raw_data)

0 commit comments

Comments
 (0)