Skip to content

Commit 436ac70

Browse files
committed
Rescue Rex::ConnectionError while finding the uri
1 parent 30de4cd commit 436ac70

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

modules/auxiliary/scanner/http/joomla_bruteforce_login.rb

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,28 @@ def find_auth_uri
5555
end
5656

5757
paths.each do |path|
58-
res = send_request_cgi({
59-
'uri' => path,
60-
'method' => 'GET'
61-
})
58+
begin
59+
res = send_request_cgi({
60+
'uri' => path,
61+
'method' => 'GET'
62+
})
63+
rescue ::Rex::ConnectionError
64+
next
65+
end
6266

6367
next unless res
6468

6569
if res.redirect? && res.headers['Location'] && res.headers['Location'] !~ /^http/
6670
path = res.headers['Location']
6771
vprint_status("#{rhost}:#{rport} - Following redirect: #{path}")
68-
res = send_request_cgi({
69-
'uri' => path,
70-
'method' => 'GET'
71-
})
72+
begin
73+
res = send_request_cgi({
74+
'uri' => path,
75+
'method' => 'GET'
76+
})
77+
rescue ::Rex::ConnectionError
78+
next
79+
end
7280
next unless res
7381
end
7482

@@ -205,7 +213,7 @@ def send_request_login(opts = {})
205213
end
206214

207215
def determine_result(response)
208-
return :abort unless response.kind_of? Rex::Proto::Http::Response
216+
return :abort unless response.kind_of?(Rex::Proto::Http::Response)
209217
return :abort unless response.code
210218

211219
if [200, 301, 302].include?(response.code)

0 commit comments

Comments
 (0)