Should also rescue JSON::ParserError for banner parsing

bug/bundler_fix
sinn3r 2015-03-20 12:27:02 -05:00
parent e1ebc6c7fe
commit 84164b44b2
1 changed files with 6 additions and 1 deletions

View File

@ -46,7 +46,12 @@ class Metasploit3 < Msf::Auxiliary
)
if res && res.code == 200 && res.body
version = JSON.parse(res.body)
begin
version = JSON.parse(res.body)
rescue JSON::ParserError
fail_with(Failure::Unknown, 'Failed to parse banner version from JSON')
end
git_version = version['gitlab_version']
git_revision = version['gitlab_rev']
print_good("GitLab version: #{git_version} revision: #{git_revision}")