Land #7985, Fix bug in check_setup for bavision

@wchen-r7 fix uncovered another bug in the logic for the
check_setup return. This switches the return to the expected
values.

Fixes #7984
bug/bundler_fix 4.13.25
James Barnett 2017-02-21 14:29:21 -06:00
commit d738b63fa6
1 changed files with 3 additions and 3 deletions

View File

@ -14,13 +14,13 @@ module Metasploit
# Checks if the target is BAVision Camera's web server. The login module should call this.
#
# @return [Boolean] TrueClass if target is SWG, otherwise FalseClass
# @return [String] Error message if target is not a BAVision camera, otherwise FalseClass
def check_setup
login_uri = normalize_uri("#{uri}")
res = send_request({'uri'=> login_uri})
if res && res.headers['WWW-Authenticate'].match(/realm="IPCamera Login"/)
return true
unless res && res.headers['WWW-Authenticate'] && res.headers['WWW-Authenticate'].match(/realm="IPCamera Login"/)
return "Unable to locate \"realm=IPCamera Login\" in headers. (Is this really a BAVision camera?)"
end
false