Skip to content

Commit

Permalink
Merge branch 'pr/zinduolis/3176'
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen committed Oct 27, 2024
2 parents a355075 + 6744516 commit 4b926df
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 16 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -268,6 +268,7 @@ PLATFORMS
x86_64-linux

DEPENDENCIES
activerecord (~> 7.0)
ansi (~> 1.5)
async (~> 1.32)
async-dns (~> 1.3)
Expand Down
2 changes: 1 addition & 1 deletion spec/beef/core/main/autorun_engine/autorun_engine_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
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!

Expand Down
4 changes: 2 additions & 2 deletions spec/beef/core/main/handlers/browser_details_handler_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
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
Expand Down
2 changes: 1 addition & 1 deletion spec/beef/extensions/requester_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

# 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
Expand Down
2 changes: 1 addition & 1 deletion spec/beef/extensions/websocket_hooked_browser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
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'
Expand Down
17 changes: 12 additions & 5 deletions spec/beef/modules/debug/test_beef_debugs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
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!

Expand Down Expand Up @@ -90,10 +90,17 @@
# 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}"
Expand Down

0 comments on commit 4b926df

Please sign in to comment.