From d0dced884848b6f29dff9e80cf450919fecc5b86 Mon Sep 17 00:00:00 2001 From: Grant Burgess Date: Mon, 13 Jan 2020 12:53:00 +1000 Subject: [PATCH] Added catch to disable logging during test --- core/main/rest/handlers/admin.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/main/rest/handlers/admin.rb b/core/main/rest/handlers/admin.rb index 2e300acd8..4282b9a2e 100644 --- a/core/main/rest/handlers/admin.rb +++ b/core/main/rest/handlers/admin.rb @@ -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