Reverted to previous method of auth rather than just pulling API token directly when generated by BeEF.

This commit is contained in:
Jack Walker
2020-04-29 13:56:46 +10:00
parent bf0f22a1fe
commit 192c666fc8
3 changed files with 12 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ RSpec.describe 'AutoRunEngine Test', :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
@@ -79,6 +79,9 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
http_hook_server.start
end
@response = RestClient.post "#{RESTAPI_ADMIN}/login", { 'username': "#{@username}", 'password': "#{@password}" }.to_json, :content_type => :json
@token = JSON.parse(@response)['token']
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
@caps["name"] = self.class.description || ENV['name'] || 'no-name'
@caps["browserstack.local"] = true

View File

@@ -63,7 +63,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
@@ -76,6 +76,9 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
# Give the server time to start-up
sleep 1
@response = RestClient.post "#{RESTAPI_ADMIN}/login", { 'username': "#{@username}", 'password': "#{@password}" }.to_json, :content_type => :json
@token = JSON.parse(@response)['token']
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
@caps["name"] = self.class.description || ENV['name'] || 'no-name'
@caps["browserstack.local"] = true

View File

@@ -62,7 +62,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :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
@@ -75,6 +75,9 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
# Give the server time to start-up
sleep 1
@response = RestClient.post "#{RESTAPI_ADMIN}/login", { 'username': "#{@username}", 'password': "#{@password}" }.to_json, :content_type => :json
@token = JSON.parse(@response)['token']
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
@caps["name"] = self.class.description || ENV['name'] || 'no-name'
@caps["browserstack.local"] = true