Checking if another auth method helps solve browser details issue.

This commit is contained in:
Jack Walker
2020-05-28 02:04:23 +10:00
parent f33dc7aec0
commit 4a3deb5b4b
2 changed files with 4 additions and 3 deletions

View File

@@ -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:

View File

@@ -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'