Added some additional session handling code in the server setup.

This commit is contained in:
Jack Walker
2020-05-27 17:41:20 +10:00
parent e94ac0169f
commit 18e76512de
2 changed files with 11 additions and 0 deletions

View File

@@ -99,6 +99,11 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
@hook_request = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}"
@hooks = JSON.parse(@hook_request)
if @hooks['hooked-browsers']['online'].empty?
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
else
@session = @hooks['hooked-browsers']['online'][0]
end
rescue => exception
print_info "Exception: #{exception}"
print_info "Exception Class: #{exception.class}"

View File

@@ -98,6 +98,12 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
@hook_request = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}"
@hooks = JSON.parse(@hook_request)
if @hooks['hooked-browsers']['online'].empty?
@session = @driver.execute_script("return window.beef.session.get_hook_session_id()")
else
@session = @hooks['hooked-browsers']['online'][0]
end
# Grab Command Module IDs as they can differ from machine to machine
@debug_mod_ids = JSON.parse(RestClient.get "#{RESTAPI_MODULES}?token=#{@token}")