Skip to content

Commit 2fa5223

Browse files
committed
move check out of the begin block
1 parent 90bdc77 commit 2fa5223

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

modules/post/windows/gather/enum_ad_users_to_wordlist.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,18 @@ def initialize(info={})
5555
def run
5656
fields = datastore['FIELDS'].gsub(/\s+/,'').split(',')
5757

58+
q = nil
59+
5860
begin
5961
q = query(SEARCH_FILTER, datastore['MAX_SEARCH'], fields)
60-
return if !q or q[:results].empty?
6162
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
6263
# Can't bind or in a network w/ limited accounts
6364
print_error(e.message)
6465
return
6566
end
6667

68+
return if q.nil? || q[:results].empty?
69+
6770
wordlist = {}
6871
q[:results].each do |result|
6972
result.each do |field|

0 commit comments

Comments
 (0)