Correct printing of URIs when provided TARGETURI doesn't end with /

bug/bundler_fix
Jon Hart 2015-11-24 09:11:04 -08:00
parent afa4d9e74d
commit 1e90a8004d
No known key found for this signature in database
GPG Key ID: 2FA9F0A3AFA8E9D3
1 changed files with 7 additions and 5 deletions

View File

@ -69,25 +69,27 @@ class Metasploit3 < Msf::Auxiliary
def git_index def git_index
res = req('index') res = req('index')
index_uri = normalize_uri(full_uri, 'index')
unless res unless res
vprint_error("#{full_uri}index - No response received") vprint_error("#{index_uri} - No response received")
return return
end end
vprint_status("#{full_uri}index (http status #{res.code})") vprint_status("#{index_uri} (http status #{res.code})")
git_index_parse(res.body) if res.code == 200 git_index_parse(res.body) if res.code == 200
end end
def git_config def git_config
res = req('config') res = req('config')
config_uri = normalize_uri(full_uri, 'config')
unless res unless res
vprint_error("#{full_uri}config - No response received") vprint_error("#{config_uri} - No response received")
return return
end end
vprint_status("#{full_uri}config - (http status #{res.code})") vprint_status("#{config_uri} - (http status #{res.code})")
return unless res.code == 200 && res.body =~ /\[(?:branch|core|remote)\]/ return unless res.code == 200 && res.body =~ /\[(?:branch|core|remote)\]/
print_good("#{full_uri}config (git disclosure - config file Found)") print_good("#{config_uri} (git disclosure - config file Found)")
report_note( report_note(
host: rhost, host: rhost,