Skip to content

Commit d738b63

Browse files
committed
Land rapid7#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 rapid7#7984
2 parents a9b9a58 + 93f7574 commit d738b63

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/metasploit/framework/login_scanner/bavision_cameras.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ class BavisionCameras < HTTP
1414

1515
# Checks if the target is BAVision Camera's web server. The login module should call this.
1616
#
17-
# @return [Boolean] TrueClass if target is SWG, otherwise FalseClass
17+
# @return [String] Error message if target is not a BAVision camera, otherwise FalseClass
1818
def check_setup
1919
login_uri = normalize_uri("#{uri}")
2020
res = send_request({'uri'=> login_uri})
2121

22-
if res && res.headers['WWW-Authenticate'].match(/realm="IPCamera Login"/)
23-
return true
22+
unless res && res.headers['WWW-Authenticate'] && res.headers['WWW-Authenticate'].match(/realm="IPCamera Login"/)
23+
return "Unable to locate \"realm=IPCamera Login\" in headers. (Is this really a BAVision camera?)"
2424
end
2525

2626
false

0 commit comments

Comments
 (0)