From 96ef0f3d9ac93d2178e3738d3072666fcc4bc08c Mon Sep 17 00:00:00 2001 From: Jack Walker Date: Wed, 22 Apr 2020 15:41:55 +1000 Subject: [PATCH] This is it --- .../main/autorun_engine/autorun_engine_spec.rb | 11 ----------- .../handlers/browser_details_handler_spec.rb | 16 ++++++++-------- spec/beef/modules/debug/test_beef_debugs_spec.rb | 16 ++++++++-------- spec/spec_helper.rb | 11 +++++++++++ 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/spec/beef/core/main/autorun_engine/autorun_engine_spec.rb b/spec/beef/core/main/autorun_engine/autorun_engine_spec.rb index d087cd0fd..5b1f22ffb 100644 --- a/spec/beef/core/main/autorun_engine/autorun_engine_spec.rb +++ b/spec/beef/core/main/autorun_engine/autorun_engine_spec.rb @@ -86,17 +86,6 @@ RSpec.describe 'AutoRunEngine test' do # Authenticate to REST API & pull the token from the response @response = RestClient.post "#{RESTAPI_ADMIN}/login", { 'username': "#{@username}", 'password': "#{@password}" }.to_json, :content_type => :json @token = JSON.parse(@response)['token'] - - # Hook new victim - print_info 'Hooking a new victim, waiting a few seconds...' - @victim = @driver.navigate.to "#{VICTIM_URL}" - - # Give time for browser hook to occur - sleep 2 - - # Identify Session ID of victim generated above - @hooks = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}" - @session = JSON.parse(@hooks)['hooked-browsers']['online']['0']['session'] end after(:all) do diff --git a/spec/beef/core/main/handlers/browser_details_handler_spec.rb b/spec/beef/core/main/handlers/browser_details_handler_spec.rb index f940f6e3f..2a6a6de6c 100644 --- a/spec/beef/core/main/handlers/browser_details_handler_spec.rb +++ b/spec/beef/core/main/handlers/browser_details_handler_spec.rb @@ -80,16 +80,16 @@ RSpec.describe 'Browser details handler' do @response = RestClient.post "#{RESTAPI_ADMIN}/login", { 'username': "#{@username}", 'password': "#{@password}" }.to_json, :content_type => :json @token = JSON.parse(@response)['token'] - # Hook new victim - print_info 'Hooking a new victim, waiting a few seconds...' - @victim = @driver.navigate.to "#{VICTIM_URL}" + # # Hook new victim + # print_info 'Hooking a new victim, waiting a few seconds...' + # @victim = @driver.navigate.to "#{VICTIM_URL}" - # Give time for browser hook to occur - sleep 2 + # # Give time for browser hook to occur + # sleep 2 - # Identify Session ID of victim generated above - @hooks = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}" - @session = JSON.parse(@hooks)['hooked-browsers']['online']['0']['session'] + # # Identify Session ID of victim generated above + # @hooks = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}" + # @session = JSON.parse(@hooks)['hooked-browsers']['online']['0']['session'] end after(:all) do diff --git a/spec/beef/modules/debug/test_beef_debugs_spec.rb b/spec/beef/modules/debug/test_beef_debugs_spec.rb index 9bef39508..bc424821b 100644 --- a/spec/beef/modules/debug/test_beef_debugs_spec.rb +++ b/spec/beef/modules/debug/test_beef_debugs_spec.rb @@ -88,16 +88,16 @@ RSpec.describe 'BeEF Debug Command Modules:' do @debug_mod_names_ids[debug_mod[1]['class']] = debug_mod[0] end - # Hook new victim - print_info 'Hooking a new victim, waiting a few seconds...' - @victim = @driver.navigate.to "#{VICTIM_URL}" + # # Hook new victim + # print_info 'Hooking a new victim, waiting a few seconds...' + # @victim = @driver.navigate.to "#{VICTIM_URL}" - # Give time for browser hook to occur - sleep 2 + # # Give time for browser hook to occur + # sleep 2 - # Identify Session ID of victim generated above - @hooks = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}" - @session = JSON.parse(@hooks)['hooked-browsers']['online']['0']['session'] + # # Identify Session ID of victim generated above + # @hooks = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}" + # @session = JSON.parse(@hooks)['hooked-browsers']['online']['0']['session'] end after(:all) do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 111616565..26775c1fe 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -87,6 +87,17 @@ RSpec.configure do |config| :url => "http://#{CONFIG['user']}:#{CONFIG['key']}@#{CONFIG['server']}/wd/hub", :desired_capabilities => @caps) + # Hook new victim + print_info 'Hooking a new victim, waiting a few seconds...' + @driver.navigate.to "#{VICTIM_URL}" + + # Give time for browser hook to occur + sleep 2 + + # Identify Session ID of victim generated above + @hooks = RestClient.get "#{RESTAPI_HOOKS}?token=#{@token}" + @session = JSON.parse(@hooks)['hooked-browsers']['online']['0']['session'] + begin example.run ensure