Skip to content

Commit

Permalink
Land #19138,fix recursive call to ldap_open
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed Apr 26, 2024
2 parents aef3cc5 + 1c8a470 commit 7e2e3ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/auxiliary/admin/dcerpc/cve_2022_26923_certifried.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def can_add_computer?

quota = nil
begin
ldap_open do |ldap|
ldap_connection do |ldap|
ldap_options = {
filter: Net::LDAP::Filter.eq('objectclass', 'domainDNS'),
attributes: 'ms-DS-MachineAccountQuota',
Expand Down Expand Up @@ -290,7 +290,7 @@ def print_ldap_error(ldap)
print_error("#{peer} #{msg}")
end

def ldap_open
def ldap_connection
ldap_peer = "#{rhost}:#{datastore['LDAP_PORT']}"
base = datastore['DOMAIN'].split('.').map { |dc| "dc=#{dc}" }.join(',')
ldap_options = {
Expand Down Expand Up @@ -327,7 +327,7 @@ def get_dnshostname(ldap, c_name)
end

def impersonate_dc(computer_name)
ldap_open do |ldap|
ldap_connection do |ldap|
dc_dnshostname = get_dnshostname(ldap, datastore['DC_NAME'])
print_status("Attempting to set the DNS hostname for the computer #{computer_name} to the DNS hostname for the DC: #{datastore['DC_NAME']}")
domain_to_ldif = datastore['DOMAIN'].split('.').map { |dc| "dc=#{dc}" }.join(',')
Expand Down

0 comments on commit 7e2e3ee

Please sign in to comment.