Added more handling to allow browser room to be hooked comfortably

This commit is contained in:
Jack Walker
2020-04-29 16:04:16 +10:00
parent 4a7f338527
commit bb2879afcd
3 changed files with 15 additions and 3 deletions

View File

@@ -92,9 +92,13 @@ RSpec.describe 'AutoRunEngine Test', :run_on_browserstack => true do
print_info 'Hooking a new victim, waiting a few seconds...'
@driver.navigate.to "#{VICTIM_URL}"
sleep 20
# Give time for browser hook to occur
wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds
sleep 15 until wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0}
wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0}
sleep 20
@hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}")
if @hooks['hooked-browsers']['online'].empty?

View File

@@ -89,9 +89,13 @@ RSpec.describe 'Browser Details Handler', :run_on_browserstack => true do
print_info 'Hooking a new victim, waiting a few seconds...'
@driver.navigate.to "#{VICTIM_URL}"
sleep 20
# Give time for browser hook to occur
wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds
sleep 15 until wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0}
wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0}
sleep 20
@hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}")
if @hooks['hooked-browsers']['online'].empty?

View File

@@ -91,9 +91,13 @@ RSpec.describe 'BeEF Debug Command Modules:', :run_on_browserstack => true do
print_info 'Hooking a new victim, waiting a few seconds...'
@driver.navigate.to "#{VICTIM_URL}"
sleep 20
# Give time for browser hook to occur
wait = Selenium::WebDriver::Wait.new(:timeout => 30) # seconds
sleep 15 until wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0}
wait.until { @driver.execute_script("return window.beef.session.get_hook_session_id().length") > 0}
sleep 20
@hooks = JSON.parse(RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}")
if @hooks['hooked-browsers']['online'].empty?