Skip to content

Commit f8d6af6

Browse files
committed
Rescuing from JSON Parse
Previous code was not using any sort of exception handling for parsing the response body. I have added a rescue block for JSON errors to remedy this problem.
1 parent 472985a commit f8d6af6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/metasploit/framework/login_scanner/buffalo.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ def attempt_login(credential)
5252
else
5353
result_opts.merge!(status: Metasploit::Model::Login::Status::INCORRECT, proof: res)
5454
end
55+
rescue ::JSON::ParserError
56+
result_opts.merge!(status: Metasploit::Model::Login::Status::INCORRECT, proof: res.body)
5557
rescue ::EOFError, Errno::ETIMEDOUT, Rex::ConnectionError, ::Timeout::Error
5658
result_opts.merge!(status: Metasploit::Model::Login::Status::UNABLE_TO_CONNECT)
5759
end

0 commit comments

Comments
 (0)