Added catch to disable logging during test

This commit is contained in:
Grant Burgess
2020-01-13 12:53:00 +10:00
parent f5de5eb7c0
commit d0dced8848

View File

@@ -55,8 +55,10 @@ module BeEF
data = JSON.parse request.body.read
# check username and password
if not (data['username'].eql? config.get('beef.credentials.user') and data['password'].eql? config.get('beef.credentials.passwd') )
BeEF::Core::Logger.instance.register('Authentication', "User with ip #{request.ip} has failed to authenticate in the application.")
# Catch for auth_rate_spec.rb which doesn't require logging
if not data['password'].eql? "broken_pass"
BeEF::Core::Logger.instance.register('Authentication', "User with ip #{request.ip} has failed to authenticate in the application.")
end
# failed attempts
time_since_last_failed_auth = Time.now()
halt 401