@@ -140,9 +140,6 @@ def query_ldap_server(raw_filter, attributes, base_prefix: nil)
140
140
returned_entries = @ldap . search ( base : full_base_dn , filter : filter , attributes : attributes , controls : controls )
141
141
query_result_table = @ldap . get_operation_result . table
142
142
validate_query_result! ( query_result_table , filter )
143
-
144
- return nil if returned_entries . empty?
145
-
146
143
returned_entries
147
144
end
148
145
@@ -184,8 +181,8 @@ def convert_sids_to_human_readable_name(sids_array)
184
181
attributes = [ 'sAMAccountName' , 'name' ]
185
182
base_prefix = 'CN=Configuration'
186
183
sid_entry = query_ldap_server ( raw_filter , attributes , base_prefix : base_prefix ) # First try with prefix to find entries that may be group specific.
187
- sid_entry = query_ldap_server ( raw_filter , attributes ) if sid_entry . blank ? # Retry without prefix if blank.
188
- if sid_entry . blank ?
184
+ sid_entry = query_ldap_server ( raw_filter , attributes ) if sid_entry . empty ? # Retry without prefix if blank.
185
+ if sid_entry . empty ?
189
186
print_warning ( "Could not find any details on the LDAP server for SID #{ sid } !" )
190
187
output << [ sid , nil , nil ] # Still want to print out the SID even if we couldn't get additional information.
191
188
elsif sid_entry [ 0 ] [ :samaccountname ] [ 0 ]
@@ -350,7 +347,7 @@ def find_enrollable_vuln_certificate_templates
350
347
attributes = [ 'cn' , 'dnsHostname' , 'ntsecuritydescriptor' ]
351
348
base_prefix = 'CN=Enrollment Services,CN=Public Key Services,CN=Services,CN=Configuration'
352
349
enrollment_ca_data = query_ldap_server ( certificate_enrollment_raw_filter , attributes , base_prefix : base_prefix )
353
- next if enrollment_ca_data . blank ?
350
+ next if enrollment_ca_data . empty ?
354
351
355
352
enrollment_ca_data . each do |ca_server |
356
353
begin
0 commit comments