Continuing attempts to debug websocket hook test

This commit is contained in:
Jack Walker
2020-04-23 13:17:47 +10:00
parent 12317c03a5
commit b78ff672ce
4 changed files with 10 additions and 23 deletions

View File

@@ -9,9 +9,7 @@ require 'json'
require_relative '../../../../support/constants'
require_relative '../../../../support/beef_test'
RSpec.describe 'AutoRunEngine test', :run_on_browserstack => true do
ENV['name'] = self.metadata[:file_path].split('/').last.split('.').first
RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
before(:all) do
@config = BeEF::Core::Configuration.instance
@config.set('beef.credentials.user', "beef")
@@ -86,7 +84,7 @@ RSpec.describe 'AutoRunEngine test', :run_on_browserstack => true do
# @token = JSON.parse(@response)['token']
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
@caps["name"] = @caps['name'] || ENV['name'] || 'no-name'
@caps["name"] = self.class.description || ENV['name'] || 'no-name'
@caps["browserstack.local"] = true
@caps['browserstack.localIdentifier'] = ENV['BROWSERSTACK_LOCAL_IDENTIFIER']
# @enable_local = @caps["browserstack.local"] && @caps["browserstack.local"].to_s == "true"
@@ -115,8 +113,6 @@ RSpec.describe 'AutoRunEngine test', :run_on_browserstack => true do
end
after(:all) do
puts @driver
puts @driver.class
@driver.quit
# Code to stop browserstack local after end of test

View File

@@ -9,9 +9,7 @@ require 'json'
require_relative '../../../../support/constants'
require_relative '../../../../support/beef_test'
RSpec.describe 'Browser details handler', :run_on_browserstack => true do
ENV['name'] = self.metadata[:file_path].split('/').last.split('.').first
RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
before(:all) do
@config = BeEF::Core::Configuration.instance
@config.set('beef.credentials.user', "beef")
@@ -83,7 +81,7 @@ RSpec.describe 'Browser details handler', :run_on_browserstack => true do
# @token = JSON.parse(@response)['token']
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
@caps["name"] = @caps['name'] || ENV['name'] || 'no-name'
@caps["name"] = self.class.description || ENV['name'] || 'no-name'
@caps["browserstack.local"] = true
@caps['browserstack.localIdentifier'] = ENV['BROWSERSTACK_LOCAL_IDENTIFIER']
# @enable_local = @caps["browserstack.local"] && @caps["browserstack.local"].to_s == "true"
@@ -112,8 +110,6 @@ RSpec.describe 'Browser details handler', :run_on_browserstack => true do
end
after(:all) do
puts @driver
puts @driver.class
@driver.quit
# Code to stop browserstack local after end of test

View File

@@ -12,8 +12,7 @@ require_relative '../../support/beef_test'
require 'core/main/network_stack/websocket/websocket'
require 'websocket-client-simple'
RSpec.describe 'BeEF WebSockets enabled', :run_on_browserstack => true do
ENV['name'] = self.metadata[:file_path].split('/').last.split('.').first
RSpec.describe 'BeEF WebSockets: Browser Hooking', :run_on_browserstack => true do
before(:all) do
@config = BeEF::Core::Configuration.instance
@@ -69,7 +68,7 @@ RSpec.describe 'BeEF WebSockets enabled', :run_on_browserstack => true do
# @token = JSON.parse(@response)['token']
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
@caps["name"] = @caps['name'] || ENV['name'] || 'no-name'
@caps["name"] = self.class.description || ENV['name'] || 'no-name'
@caps["browserstack.local"] = true
@caps['browserstack.localIdentifier'] = ENV['BROWSERSTACK_LOCAL_IDENTIFIER']
# @enable_local = @caps["browserstack.local"] && @caps["browserstack.local"].to_s == "true"
@@ -91,15 +90,15 @@ RSpec.describe 'BeEF WebSockets enabled', :run_on_browserstack => true do
@driver.navigate.to "#{VICTIM_URL}"
# Give time for browser hook to occur
sleep 6
sleep 10
puts @driver.current_url
@hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}")
@session = @hooks['hooked-browsers']['online']
end
after(:all) do
puts @driver
puts @driver.class
@driver.quit
# Code to stop browserstack local after end of test

View File

@@ -10,8 +10,6 @@ require_relative '../../../support/constants'
require_relative '../../../support/beef_test'
RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
ENV['name'] = self.metadata[:file_path].split('/').last.split('.').first
before(:all) do
# Grab config and set creds in variables for ease of access
@config = BeEF::Core::Configuration.instance
@@ -82,7 +80,7 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
# @token = JSON.parse(@response)['token']
@caps = CONFIG['common_caps'].merge(CONFIG['browser_caps'][TASK_ID])
@caps["name"] = @caps['name'] || ENV['name'] || 'no-name'
@caps["name"] = self.class.description || ENV['name'] || 'no-name'
@caps["browserstack.local"] = true
@caps['browserstack.localIdentifier'] = ENV['BROWSERSTACK_LOCAL_IDENTIFIER']
# @enable_local = @caps["browserstack.local"] && @caps["browserstack.local"].to_s == "true"
@@ -119,8 +117,6 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
end
after(:all) do
puts @driver
puts @driver.class
@driver.quit
# Code to stop browserstack local after end of test