From 7abfb6c205fd60ed95a22edc466137a3c37ab9ed Mon Sep 17 00:00:00 2001 From: Spencer McIntyre Date: Tue, 17 Sep 2024 09:59:42 -0400 Subject: [PATCH] Return nil on error to avoid another exception --- modules/auxiliary/scanner/smb/smb_enumusers_domain.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auxiliary/scanner/smb/smb_enumusers_domain.rb b/modules/auxiliary/scanner/smb/smb_enumusers_domain.rb index 516bab830cd3..7fbd92ad4a6b 100644 --- a/modules/auxiliary/scanner/smb/smb_enumusers_domain.rb +++ b/modules/auxiliary/scanner/smb/smb_enumusers_domain.rb @@ -87,6 +87,7 @@ def run_service(port, direct) rescue ::Timeout::Error rescue ::Exception => e print_error("Error: #{e.class} #{e}") + nil ensure disconnect_wkssvc end @@ -100,7 +101,6 @@ def run_host(_ip) end unless results.to_s.empty? - accounts = [ Hash.new() ] results.compact.each do |result_set| result_set.each { |result| accounts << {