Skip to content

Commit fe9fbfd

Browse files
committed
Make calculations easier
1 parent 91aeef0 commit fe9fbfd

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

modules/auxiliary/admin/mssql/mssql_enum_domain_accounts_sqli.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ def initialize(info = {})
3333

3434
register_options(
3535
[
36-
OptInt.new('STARTRID', [true, 'RID to start fuzzing at.', 500]),
37-
OptInt.new('ENDRID', [true, 'RID to stop fuzzing at.', 3000])
36+
OptInt.new('START_RID', [true, 'RID to start fuzzing at.', 500]),
37+
OptInt.new('END_RID', [true, 'RID to stop fuzzing at.', 3000])
3838
], self.class)
3939
end
4040

@@ -72,7 +72,7 @@ def run
7272
end
7373

7474
# Get a list of windows users, groups, and computer accounts using SUSER_NAME()
75-
total_rids = datastore['ENDRID'] - datastore['STARTRID']
75+
total_rids = datastore['END_RID'] - datastore['START_RID']
7676
print_status("#{peer} - Brute forcing #{total_rids} RIDs via SQL injection, be patient...")
7777
domain_users = get_win_domain_users(windows_domain_sid)
7878
if domain_users.nil?
@@ -174,10 +174,10 @@ def get_win_domain_users(domain_sid)
174174

175175
windows_logins = []
176176

177+
total_rids = datastore['END_RID'] - datastore['START_RID']
177178
# Fuzz the principal_id parameter (RID in this case) passed to the SUSER_NAME function
178-
(datastore['STARTRID']..datastore['ENDRID']).each do |principal_id|
179-
total_rids = datastore['ENDRID'] - datastore['STARTRID']
180-
rid_diff = (datastore['ENDRID'] - (datastore['ENDRID'] - principal_id)) - datastore['STARTRID']
179+
(datastore['START_RID']..datastore['END_RID']).each do |principal_id|
180+
rid_diff = principal_id - datastore['START_RID']
181181
if principal_id % 100 == 0
182182
print_status("#{peer} - #{rid_diff} of #{total_rids } RID queries complete")
183183
end

0 commit comments

Comments
 (0)