Move code out of begin/rescue block
parent
dd63d793e5
commit
6a822cca61
|
@ -74,16 +74,17 @@ class Metasploit3 < Msf::Post
|
||||||
|
|
||||||
begin
|
begin
|
||||||
q = query(search_filter, max_search, fields)
|
q = query(search_filter, max_search, fields)
|
||||||
if q.nil? || q[:results].empty?
|
|
||||||
print_status('No results returned.')
|
|
||||||
return
|
|
||||||
end
|
|
||||||
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
|
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
|
||||||
# Can't bind or in a network w/ limited accounts
|
# Can't bind or in a network w/ limited accounts
|
||||||
print_error(e.message)
|
print_error(e.message)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if q.nil? || q[:results].empty?
|
||||||
|
print_status('No results returned.')
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
# Results table holds raw string data
|
# Results table holds raw string data
|
||||||
results_table = Rex::Ui::Text::Table.new(
|
results_table = Rex::Ui::Text::Table.new(
|
||||||
'Header' => "Domain Users",
|
'Header' => "Domain Users",
|
||||||
|
|
Loading…
Reference in New Issue