Merge branch 'pr/zinduolis/3176'

This commit is contained in:
Stephen
2024-10-28 08:02:17 +10:00
7 changed files with 25 additions and 16 deletions

View File

@@ -21,6 +21,7 @@ gem 'term-ansicolor', :require => 'term/ansicolor'
gem 'rubyzip', '~> 2.3'
gem 'espeak-ruby', '~> 1.1.0' # Text-to-Voice
gem 'rake', '~> 13.2'
gem 'activerecord', '~> 7.0'
gem 'otr-activerecord', '~> 2.2.0'
gem 'sqlite3', '~> 1.4'
gem 'rubocop', '~> 1.66.1', require: false

View File

@@ -1,13 +1,13 @@
GEM
remote: https://rubygems.org/
specs:
activemodel (7.1.4)
activesupport (= 7.1.4)
activerecord (7.1.4)
activemodel (= 7.1.4)
activesupport (= 7.1.4)
activemodel (7.1.4.2)
activesupport (= 7.1.4.2)
activerecord (7.1.4.2)
activemodel (= 7.1.4.2)
activesupport (= 7.1.4.2)
timeout (>= 0.4.0)
activesupport (7.1.4)
activesupport (7.1.4.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
@@ -268,6 +268,7 @@ PLATFORMS
x86_64-linux
DEPENDENCIES
activerecord (~> 7.0)
ansi (~> 1.5)
async (~> 1.32)
async-dns (~> 1.3)

View File

@@ -50,7 +50,7 @@ RSpec.describe 'AutoRunEngine Test', run_on_browserstack: true do
OTR::ActiveRecord.establish_connection!
end
context = ActiveRecord::Migration.new.migration_context
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration, context.internal_metadata).migrate if context.needs_migration?
BeEF::Core::Migration.instance.update_db!

View File

@@ -48,9 +48,9 @@ RSpec.describe 'Browser Details Handler', run_on_browserstack: true do
if Gem.loaded_specs['otr-activerecord'].version > Gem::Version.create('1.4.2')
OTR::ActiveRecord.establish_connection!
end
context = ActiveRecord::Migration.new.migration_context
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
context = ActiveRecord::Migration.new.migration_context
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration, context.internal_metadata).migrate if context.needs_migration?
BeEF::Core::Migration.instance.update_db!
# Spawn HTTP Server

View File

@@ -40,7 +40,7 @@ RSpec.describe 'BeEF Extension Requester' do
# Migrate if required
context = ActiveRecord::Migration.new.migration_context
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration, context.internal_metadata).migrate if context.needs_migration?
# Start HTTP hook server
http_hook_server = BeEF::Core::Server.instance

View File

@@ -49,7 +49,7 @@ RSpec.describe 'Browser hooking with Websockets', run_on_browserstack: true do
OTR::ActiveRecord.establish_connection!
end
context = ActiveRecord::Migration.new.migration_context
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration, context.internal_metadata).migrate if context.needs_migration?
BeEF::Core::Migration.instance.update_db!
# Spawn HTTP Server
print_info 'Starting HTTP Hook Server'

View File

@@ -47,7 +47,7 @@ RSpec.describe 'BeEF Debug Command Modules:', run_on_browserstack: true do
OTR::ActiveRecord.establish_connection!
end
context = ActiveRecord::Migration.new.migration_context
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration).migrate if context.needs_migration?
ActiveRecord::Migrator.new(:up, context.migrations, context.schema_migration, context.internal_metadata).migrate if context.needs_migration?
BeEF::Core::Migration.instance.update_db!
@@ -90,10 +90,17 @@ RSpec.describe 'BeEF Debug Command Modules:', run_on_browserstack: true do
# Grab Command Module IDs as they can differ from machine to machine
@debug_mod_ids = JSON.parse(RestClient.get("#{RESTAPI_MODULES}?token=#{@token}"))
@debug_mod_names_ids = {}
@debug_mods = @debug_mod_ids.to_a.select { |cmd_mod| cmd_mod[1]['category'] == 'Debug' }
.map do |debug_mod|
@debug_mod_names_ids[debug_mod[1]['class']] = debug_mod[1]['id']
end
@debug_mods = @debug_mod_ids.to_a.select do |cmd_mod|
category = Array(cmd_mod['category'])
category_string = if category.is_a?(Array)
category.join(', ')
else
category.to_s
end
category_string.include?('Debug')
end.map do |debug_mod|
@debug_mod_names_ids[debug_mod['class']] = debug_mod['id']
end
rescue StandardError => e
print_info "Exception: #{e}"
print_info "Exception Class: #{e.class}"