diff --git a/lib/msf/core/post/windows/ldap.rb b/lib/msf/core/post/windows/ldap.rb index d8219e6b66..ba6116a410 100644 --- a/lib/msf/core/post/windows/ldap.rb +++ b/lib/msf/core/post/windows/ldap.rb @@ -184,7 +184,7 @@ module LDAP values = get_values_from_ber(ber, field) values_result = "" - values_result = values.join(',') unless values.nil? + values_result = values.join(',') if values vprint_status("Values #{values}") field_results << values_result @@ -235,7 +235,7 @@ module LDAP def get_values_from_ber(ber_data, field) field_offset = ber_data.index(field) - if field_offset.nil? + unless field_offset vprint_status("Field not found in BER: #{field}") return nil end diff --git a/modules/post/windows/gather/enum_ad_computers.rb b/modules/post/windows/gather/enum_ad_computers.rb index 9a9f122d01..35c6d757c8 100644 --- a/modules/post/windows/gather/enum_ad_computers.rb +++ b/modules/post/windows/gather/enum_ad_computers.rb @@ -63,9 +63,7 @@ class Metasploit3 < Msf::Post max_search = datastore['MAX_SEARCH'] q = query(search_filter, max_search, fields) - if q.nil? or q[:results].empty? - return - end + return if q.nil? or q[:results].empty? # Results table holds raw string data results_table = Rex::Ui::Text::Table.new(