Land #5993, handle ADSI exceptions nicely
commit
9519eef55d
|
@ -51,7 +51,7 @@ class Metasploit3 < Msf::Post
|
||||||
|
|
||||||
begin
|
begin
|
||||||
q = query(search_filter, max_search, FIELDS)
|
q = query(search_filter, max_search, FIELDS)
|
||||||
rescue RuntimeError => e
|
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
|
||||||
print_error(e.message)
|
print_error(e.message)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,7 +39,13 @@ class Metasploit3 < Msf::Post
|
||||||
fields = datastore['FIELDS'].gsub(/\s+/, "").split(',')
|
fields = datastore['FIELDS'].gsub(/\s+/, "").split(',')
|
||||||
search_filter = datastore['FILTER']
|
search_filter = datastore['FILTER']
|
||||||
max_search = datastore['MAX_SEARCH']
|
max_search = datastore['MAX_SEARCH']
|
||||||
|
|
||||||
|
begin
|
||||||
q = query(search_filter, max_search, fields)
|
q = query(search_filter, max_search, fields)
|
||||||
|
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
|
||||||
|
print_error(e.message)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
if q.nil? || q[:results].empty?
|
if q.nil? || q[:results].empty?
|
||||||
print_status('No results found...')
|
print_status('No results found...')
|
||||||
|
|
|
@ -60,7 +60,13 @@ class Metasploit3 < Msf::Post
|
||||||
fields = datastore['FIELDS'].gsub(/\s+/,"").split(',')
|
fields = datastore['FIELDS'].gsub(/\s+/,"").split(',')
|
||||||
search_filter = datastore['FILTER']
|
search_filter = datastore['FILTER']
|
||||||
max_search = datastore['MAX_SEARCH']
|
max_search = datastore['MAX_SEARCH']
|
||||||
|
|
||||||
|
begin
|
||||||
q = query(search_filter, max_search, fields)
|
q = query(search_filter, max_search, fields)
|
||||||
|
rescue ::RuntimeError, ::Rex::Post::Meterpreter::RequestError => e
|
||||||
|
print_error(e.message)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
return if q.nil? or q[:results].empty?
|
return if q.nil? or q[:results].empty?
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue