Skip to content

Commit 93f7574

Browse files
committed
Fix logic error in rapid7#7985
The check_setup method expects an error message if the web server is not compatible with the module, and false otherwise. We were previously returning the opposite of the expected behavior.
1 parent adf1385 commit 93f7574

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'] && 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)