From 4a3deb5b4be2e248ab0dbf55e651371fae916b2c Mon Sep 17 00:00:00 2001 From: Jack Walker Date: Thu, 28 May 2020 02:04:23 +1000 Subject: [PATCH] Checking if another auth method helps solve browser details issue. --- config.yaml | 2 +- spec/beef/core/main/handlers/browser_details_handler_spec.rb | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/config.yaml b/config.yaml index d4d93e81b..64039f64f 100644 --- a/config.yaml +++ b/config.yaml @@ -18,7 +18,7 @@ beef: # Used by both the RESTful API and the Admin interface credentials: user: "beef" - passwd: "beef" + passwd: "beef1" # Interface / IP restrictions restrictions: diff --git a/spec/beef/core/main/handlers/browser_details_handler_spec.rb b/spec/beef/core/main/handlers/browser_details_handler_spec.rb index 7c28334ac..463392fb2 100644 --- a/spec/beef/core/main/handlers/browser_details_handler_spec.rb +++ b/spec/beef/core/main/handlers/browser_details_handler_spec.rb @@ -62,7 +62,7 @@ RSpec.describe 'Browser Details Handler', run_on_browserstack: true do http_hook_server.prepare # Generate a token for the server to respond with - @token = BeEF::Core::Crypto.api_token + BeEF::Core::Crypto.api_token # Initiate server start-up @pids = fork do @@ -130,7 +130,8 @@ RSpec.describe 'Browser Details Handler', run_on_browserstack: true do it 'browser details handler working' do print_info 'Getting browser details' - response = RestClient.get "#{RESTAPI_HOOKS}/#{@session}?token=#{@token}" + token = JSON.parse(RestClient.post "#{RESTAPI_ADMIN}/login", { 'username': "#{@username}", 'password': "#{@password}" }.to_json, :content_type => :json)['token'] + response = RestClient.get "#{RESTAPI_HOOKS}/#{@session}?token=#{token}" details = JSON.parse(response.body) browser_name = if details['browser.name.friendly'].downcase == 'internet explorer'