From d9716ebecf6137cc5f2f9ede647cb36124d056ea Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Wed, 2 Nov 2022 17:28:23 -0500 Subject: [PATCH 01/10] core updates for Rails 7 --- Gemfile | 5 + Gemfile.lock | 119 ++++++++++-------- .../framework/rails_version_constraint.rb | 2 +- lib/msf/core/db_manager/adapter.rb | 2 +- lib/msf/ui/debug.rb | 20 +-- spec/lib/msf/debug_spec.rb | 24 ++-- 6 files changed, 99 insertions(+), 73 deletions(-) diff --git a/Gemfile b/Gemfile index 3195454666..054431f2ab 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,11 @@ source 'https://rubygems.org' # spec.add_runtime_dependency '', [] gemspec name: 'metasploit-framework' +gem 'metasploit-concern', path: '../gem/metasploit-concern' +gem 'metasploit_data_models', path: '../metasploit_data_models' +gem 'metasploit-credential', path: '../gem/metasploit-credential' +gem 'metasploit-model', path: '../gem/metasploit-model' + # separate from test as simplecov is not run on travis-ci group :coverage do # code coverage for tests diff --git a/Gemfile.lock b/Gemfile.lock index 8d8852a2ac..fb3eb2be66 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,10 +1,55 @@ +PATH + remote: ../gem/metasploit-concern + specs: + metasploit-concern (5.0.0) + activemodel (~> 7.0) + activesupport (~> 7.0) + railties (~> 7.0) + zeitwerk + +PATH + remote: ../gem/metasploit-credential + specs: + metasploit-credential (5.0.10) + metasploit-concern + metasploit-model + metasploit_data_models (>= 5.0.0) + net-ssh + pg + railties + rex-socket + rubyntlm + rubyzip + +PATH + remote: ../gem/metasploit-model + specs: + metasploit-model (5.0.0) + activemodel (~> 7.0) + activesupport (~> 7.0) + railties (~> 7.0) + +PATH + remote: ../metasploit_data_models + specs: + metasploit_data_models (5.0.6) + activerecord (~> 7.0) + activesupport (~> 7.0) + arel-helpers + metasploit-concern + metasploit-model (>= 3.1) + pg + railties (~> 7.0) + recog + webrick + PATH remote: . specs: metasploit-framework (6.2.37) - actionpack (~> 6.0) - activerecord (~> 6.0) - activesupport (~> 6.0) + actionpack (~> 7.0) + activerecord (~> 7.0) + activesupport (~> 7.0) aws-sdk-ec2 aws-sdk-iam aws-sdk-s3 @@ -96,30 +141,29 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actionpack (6.1.7) - actionview (= 6.1.7) - activesupport (= 6.1.7) - rack (~> 2.0, >= 2.0.9) + actionpack (7.0.4) + actionview (= 7.0.4) + activesupport (= 7.0.4) + rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actionview (6.1.7) - activesupport (= 6.1.7) + actionview (7.0.4) + activesupport (= 7.0.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activemodel (6.1.7) - activesupport (= 6.1.7) - activerecord (6.1.7) - activemodel (= 6.1.7) - activesupport (= 6.1.7) - activesupport (6.1.7) + activemodel (7.0.4) + activesupport (= 7.0.4) + activerecord (7.0.4) + activemodel (= 7.0.4) + activesupport (= 7.0.4) + activesupport (7.0.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) - zeitwerk (~> 2.3) addressable (2.8.1) public_suffix (>= 2.0.2, < 6.0) afm (0.2.2) @@ -230,35 +274,7 @@ GEM nokogiri (>= 1.5.9) memory_profiler (1.0.1) metasm (1.0.5) - metasploit-concern (4.0.5) - activemodel (~> 6.0) - activesupport (~> 6.0) - railties (~> 6.0) - metasploit-credential (6.0.1) - metasploit-concern - metasploit-model - metasploit_data_models (>= 5.0.0) - net-ssh - pg - railties - rex-socket - rubyntlm - rubyzip - metasploit-model (4.0.6) - activemodel (~> 6.0) - activesupport (~> 6.0) - railties (~> 6.0) metasploit-payloads (2.0.108) - metasploit_data_models (5.0.6) - activerecord (~> 6.0) - activesupport (~> 6.0) - arel-helpers - metasploit-concern - metasploit-model (>= 3.1) - pg - railties (~> 6.0) - recog - webrick metasploit_payloads-mettle (1.0.20) method_source (1.0.0) mini_portile2 (2.8.1) @@ -320,14 +336,15 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.4) - loofah (~> 2.19, >= 2.19.1) - railties (6.1.7) - actionpack (= 6.1.7) - activesupport (= 6.1.7) + rails-html-sanitizer (1.4.3) + loofah (~> 2.3) + railties (7.0.4) + actionpack (= 7.0.4) + activesupport (= 7.0.4) method_source rake (>= 12.2) thor (~> 1.0) + zeitwerk (~> 2.5) rainbow (3.1.1) rake (13.0.6) rb-readline (0.5.5) @@ -505,7 +522,11 @@ DEPENDENCIES factory_bot_rails fivemat memory_profiler + metasploit-concern! + metasploit-credential! metasploit-framework! + metasploit-model! + metasploit_data_models! octokit pry-byebug rake diff --git a/lib/metasploit/framework/rails_version_constraint.rb b/lib/metasploit/framework/rails_version_constraint.rb index 7822a12d1d..edaa578df0 100644 --- a/lib/metasploit/framework/rails_version_constraint.rb +++ b/lib/metasploit/framework/rails_version_constraint.rb @@ -3,7 +3,7 @@ module Metasploit module Framework module RailsVersionConstraint - RAILS_VERSION = '~> 6.0' + RAILS_VERSION = '~> 7.0' end end end diff --git a/lib/msf/core/db_manager/adapter.rb b/lib/msf/core/db_manager/adapter.rb index b3e9e5b6d5..a50172e4ad 100644 --- a/lib/msf/core/db_manager/adapter.rb +++ b/lib/msf/core/db_manager/adapter.rb @@ -27,7 +27,7 @@ module Msf::DBManager::Adapter # Scan through available drivers # def initialize_adapter - ApplicationRecord.default_timezone = :utc + ActiveRecord.default_timezone = :utc if connection_established? && ApplicationRecord.connection_db_config.configuration_hash[:adapter] == ADAPTER dlog("Already established connection to #{ADAPTER}, so reusing active connection.") diff --git a/lib/msf/ui/debug.rb b/lib/msf/ui/debug.rb index 0bcb47349e..f8dae8c84b 100644 --- a/lib/msf/ui/debug.rb +++ b/lib/msf/ui/debug.rb @@ -163,22 +163,22 @@ module Msf example_workspaces = ::Mdm::Workspace.order(id: :desc).take(10) ordered_workspaces = ([current_workspace] + example_workspaces).uniq.sort_by(&:id) workspace_rows = ordered_workspaces.map do |workspace| - id = current_workspace.id == workspace.id ? "#{workspace.id.to_s(:delimited)} **(Current)**" : workspace.id.to_s(:delimited) + id = current_workspace.id == workspace.id ? "#{workspace.id.to_fs(:delimited)} **(Current)**" : workspace.id.to_fs(:delimited) [ id, - workspace.hosts.count.to_s(:delimited), - workspace.vulns.count.to_s(:delimited), - workspace.notes.count.to_s(:delimited), - workspace.services.count.to_s(:delimited) + workspace.hosts.count.to_fs(:delimited), + workspace.vulns.count.to_fs(:delimited), + workspace.notes.count.to_fs(:delimited), + workspace.services.count.to_fs(:delimited) ] end totals_row = [ - "**Total (#{::Mdm::Workspace.count.to_s(:delimited)})**", - "**#{::Mdm::Host.count.to_s(:delimited)}**", - "**#{::Mdm::Vuln.count.to_s(:delimited)}**", - "**#{::Mdm::Note.count.to_s(:delimited)}**", - "**#{::Mdm::Service.count.to_s(:delimited)}**" + "**Total (#{::Mdm::Workspace.count.to_fs(:delimited)})**", + "**#{::Mdm::Host.count.to_fs(:delimited)}**", + "**#{::Mdm::Vuln.count.to_fs(:delimited)}**", + "**#{::Mdm::Note.count.to_fs(:delimited)}**", + "**#{::Mdm::Service.count.to_fs(:delimited)}**" ] table = "| ID | Hosts | Vulnerabilities | Notes | Services |\n" diff --git a/spec/lib/msf/debug_spec.rb b/spec/lib/msf/debug_spec.rb index 7533c58244..39c27e2fea 100644 --- a/spec/lib/msf/debug_spec.rb +++ b/spec/lib/msf/debug_spec.rb @@ -1585,7 +1585,7 @@ RSpec.describe Msf::Ui::Debug do | ID | Hosts | Vulnerabilities | Notes | Services | |-:|-:|-:|-:|-:| - | #{workspace.id.to_s(:delimited)} **(Current)** | 0 | 0 | 0 | 0 | + | #{workspace.id.to_fs(:delimited)} **(Current)** | 0 | 0 | 0 | 0 | | **Total (#{::Mdm::Workspace.count})** | **#{::Mdm::Host.count}** | **#{::Mdm::Vuln.count}** | **#{::Mdm::Note.count}** | **#{::Mdm::Service.count}** | @@ -1648,7 +1648,7 @@ RSpec.describe Msf::Ui::Debug do | ID | Hosts | Vulnerabilities | Notes | Services | |-:|-:|-:|-:|-:| - | #{workspace.id.to_s(:delimited)} **(Current)** | 1 | 1 | 1 | 1 | + | #{workspace.id.to_fs(:delimited)} **(Current)** | 1 | 1 | 1 | 1 | | **Total (#{::Mdm::Workspace.count})** | **#{::Mdm::Host.count}** | **#{::Mdm::Vuln.count}** | **#{::Mdm::Note.count}** | **#{::Mdm::Service.count}** | @@ -1739,11 +1739,11 @@ RSpec.describe Msf::Ui::Debug do | ID | Hosts | Vulnerabilities | Notes | Services | |-:|-:|-:|-:|-:| - | #{workspaces[0].id.to_s(:delimited)} | 0 | 0 | 0 | 0 | - | #{workspaces[1].id.to_s(:delimited)} | 0 | 0 | 0 | 0 | - | #{workspaces[2].id.to_s(:delimited)} | 0 | 0 | 0 | 0 | - | #{workspaces[3].id.to_s(:delimited)} | 0 | 0 | 0 | 0 | - | #{workspaces[4].id.to_s(:delimited)} **(Current)** | 0 | 0 | 0 | 0 | + | #{workspaces[0].id.to_fs(:delimited)} | 0 | 0 | 0 | 0 | + | #{workspaces[1].id.to_fs(:delimited)} | 0 | 0 | 0 | 0 | + | #{workspaces[2].id.to_fs(:delimited)} | 0 | 0 | 0 | 0 | + | #{workspaces[3].id.to_fs(:delimited)} | 0 | 0 | 0 | 0 | + | #{workspaces[4].id.to_fs(:delimited)} **(Current)** | 0 | 0 | 0 | 0 | | **Total (#{::Mdm::Workspace.count})** | **#{::Mdm::Host.count}** | **#{::Mdm::Vuln.count}** | **#{::Mdm::Note.count}** | **#{::Mdm::Service.count}** | @@ -1812,11 +1812,11 @@ RSpec.describe Msf::Ui::Debug do | ID | Hosts | Vulnerabilities | Notes | Services | |-:|-:|-:|-:|-:| - | #{workspaces[0].id.to_s(:delimited)} | 1 | 1 | 1 | 1 | - | #{workspaces[1].id.to_s(:delimited)} | 0 | 0 | 0 | 0 | - | #{workspaces[2].id.to_s(:delimited)} | 1 | 1 | 1 | 1 | - | #{workspaces[3].id.to_s(:delimited)} | 0 | 0 | 0 | 0 | - | #{workspaces[4].id.to_s(:delimited)} **(Current)** | 1 | 1 | 1 | 1 | + | #{workspaces[0].id.to_fs(:delimited)} | 1 | 1 | 1 | 1 | + | #{workspaces[1].id.to_fs(:delimited)} | 0 | 0 | 0 | 0 | + | #{workspaces[2].id.to_fs(:delimited)} | 1 | 1 | 1 | 1 | + | #{workspaces[3].id.to_fs(:delimited)} | 0 | 0 | 0 | 0 | + | #{workspaces[4].id.to_fs(:delimited)} **(Current)** | 1 | 1 | 1 | 1 | | **Total (#{::Mdm::Workspace.count})** | **#{::Mdm::Host.count}** | **#{::Mdm::Vuln.count}** | **#{::Mdm::Note.count}** | **#{::Mdm::Service.count}** | From 177f1ec4d8658c9922a367c791f519c92b1cbb13 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Wed, 2 Nov 2022 17:28:46 -0500 Subject: [PATCH 02/10] update that may need guards depending on execution --- config/application.rb | 2 ++ lib/metasploit/framework/common_engine.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/config/application.rb b/config/application.rb index d365c89049..c3a6e84181 100644 --- a/config/application.rb +++ b/config/application.rb @@ -49,6 +49,8 @@ module Metasploit when "production" config.eager_load = true end + + ActiveRecord.legacy_connection_handling = false end end end diff --git a/lib/metasploit/framework/common_engine.rb b/lib/metasploit/framework/common_engine.rb index 63e9506071..bd0425abca 100644 --- a/lib/metasploit/framework/common_engine.rb +++ b/lib/metasploit/framework/common_engine.rb @@ -33,12 +33,14 @@ module Metasploit::Framework::CommonEngine end config.root = Msf::Config::install_root + config.paths.add 'app/models', autoload: true config.paths.add 'app/concerns', autoload: true config.paths.add 'data/meterpreter', glob: '**/ext_*' config.paths.add 'modules' config.active_support.deprecation = :stderr + ActiveRecord.legacy_connection_handling = false # # `initializer`s # From f78592bf3f7c962154e5135eca951e271441389a Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Tue, 22 Nov 2022 10:09:16 -0600 Subject: [PATCH 03/10] update db/schema.rb for Rails 7 --- db/schema.rb | 231 +++++++++++++++++++++++++-------------------------- 1 file changed, 115 insertions(+), 116 deletions(-) diff --git a/db/schema.rb b/db/schema.rb index c3745a55c1..3a75dd821a 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,15 +10,14 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2019_05_07_120211) do - +ActiveRecord::Schema[7.0].define(version: 2019_05_07_120211) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" create_table "api_keys", id: :serial, force: :cascade do |t| t.text "token" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "async_callbacks", id: :serial, force: :cascade do |t| @@ -27,16 +26,16 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "listener_uri" t.string "target_host" t.string "target_port" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "automatic_exploitation_match_results", id: :serial, force: :cascade do |t| t.integer "match_id" t.integer "run_id" t.string "state", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["match_id"], name: "index_automatic_exploitation_match_results_on_match_id" t.index ["run_id"], name: "index_automatic_exploitation_match_results_on_run_id" end @@ -44,8 +43,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "automatic_exploitation_match_sets", id: :serial, force: :cascade do |t| t.integer "workspace_id" t.integer "user_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["user_id"], name: "index_automatic_exploitation_match_sets_on_user_id" t.index ["workspace_id"], name: "index_automatic_exploitation_match_sets_on_workspace_id" end @@ -54,8 +53,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.integer "module_detail_id" t.string "state" t.integer "nexpose_data_vulnerability_definition_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "match_set_id" t.string "matchable_type" t.integer "matchable_id" @@ -68,8 +67,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.integer "workspace_id" t.integer "user_id" t.integer "match_set_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["match_set_id"], name: "index_automatic_exploitation_runs_on_match_set_id" t.index ["user_id"], name: "index_automatic_exploitation_runs_on_user_id" t.index ["workspace_id"], name: "index_automatic_exploitation_runs_on_workspace_id" @@ -77,11 +76,11 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "clients", id: :serial, force: :cascade do |t| t.integer "host_id" - t.datetime "created_at" + t.datetime "created_at", precision: nil t.string "ua_string", limit: 1024, null: false t.string "ua_name", limit: 64 t.string "ua_ver", limit: 32 - t.datetime "updated_at" + t.datetime "updated_at", precision: nil end create_table "credential_cores_tasks", id: false, force: :cascade do |t| @@ -96,8 +95,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "creds", id: :serial, force: :cascade do |t| t.integer "service_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "user", limit: 2048 t.string "pass", limit: 4096 t.boolean "active", default: true @@ -110,9 +109,9 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "events", id: :serial, force: :cascade do |t| t.integer "workspace_id" t.integer "host_id" - t.datetime "created_at" + t.datetime "created_at", precision: nil t.string "name" - t.datetime "updated_at" + t.datetime "updated_at", precision: nil t.boolean "critical" t.boolean "seen" t.string "username" @@ -123,7 +122,7 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.integer "host_id" t.integer "service_id" t.integer "vuln_id" - t.datetime "attempted_at" + t.datetime "attempted_at", precision: nil t.boolean "exploited" t.string "fail_reason" t.string "username" @@ -141,8 +140,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "session_uuid", limit: 8 t.string "name", limit: 2048 t.string "payload", limit: 2048 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "host_details", id: :serial, force: :cascade do |t| @@ -157,7 +156,7 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do end create_table "hosts", id: :serial, force: :cascade do |t| - t.datetime "created_at" + t.datetime "created_at", precision: nil t.inet "address", null: false t.string "mac" t.string "comm" @@ -169,7 +168,7 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "os_lang" t.string "arch" t.integer "workspace_id", null: false - t.datetime "updated_at" + t.datetime "updated_at", precision: nil t.text "purpose" t.string "info", limit: 65536 t.text "comments" @@ -197,8 +196,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do end create_table "listeners", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "workspace_id", default: 1, null: false t.integer "task_id" t.boolean "enabled", default: true @@ -217,8 +216,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "ltype", limit: 512 t.string "path", limit: 1024 t.text "data" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "content_type" t.text "name" t.text "info" @@ -227,8 +226,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do end create_table "macros", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "owner" t.text "name" t.text "description" @@ -243,8 +242,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.integer "public_id" t.integer "realm_id" t.integer "workspace_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.integer "logins_count", default: 0 t.index ["origin_type", "origin_id"], name: "index_metasploit_credential_cores_on_origin_type_and_origin_id" t.index ["private_id"], name: "index_metasploit_credential_cores_on_private_id" @@ -264,56 +263,56 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.integer "service_id", null: false t.string "access_level" t.string "status", null: false - t.datetime "last_attempted_at" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "last_attempted_at", precision: nil + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["core_id", "service_id"], name: "index_metasploit_credential_logins_on_core_id_and_service_id", unique: true t.index ["service_id", "core_id"], name: "index_metasploit_credential_logins_on_service_id_and_core_id", unique: true end create_table "metasploit_credential_origin_cracked_passwords", id: :serial, force: :cascade do |t| t.integer "metasploit_credential_core_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["metasploit_credential_core_id"], name: "originating_credential_cores" end create_table "metasploit_credential_origin_imports", id: :serial, force: :cascade do |t| t.text "filename", null: false t.integer "task_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["task_id"], name: "index_metasploit_credential_origin_imports_on_task_id" end create_table "metasploit_credential_origin_manuals", id: :serial, force: :cascade do |t| t.integer "user_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["user_id"], name: "index_metasploit_credential_origin_manuals_on_user_id" end create_table "metasploit_credential_origin_services", id: :serial, force: :cascade do |t| t.integer "service_id", null: false t.text "module_full_name", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["service_id", "module_full_name"], name: "unique_metasploit_credential_origin_services", unique: true end create_table "metasploit_credential_origin_sessions", id: :serial, force: :cascade do |t| t.text "post_reference_name", null: false t.integer "session_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["session_id", "post_reference_name"], name: "unique_metasploit_credential_origin_sessions", unique: true end create_table "metasploit_credential_privates", id: :serial, force: :cascade do |t| t.string "type", null: false t.text "data", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "jtr_format" t.index "type, decode(md5(data), 'hex'::text)", name: "index_metasploit_credential_privates_on_type_and_data_sshkey", unique: true, where: "((type)::text = 'Metasploit::Credential::SSHKey'::text)" t.index ["type", "data"], name: "index_metasploit_credential_privates_on_type_and_data", unique: true, where: "(NOT ((type)::text = 'Metasploit::Credential::SSHKey'::text))" @@ -321,8 +320,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "metasploit_credential_publics", id: :serial, force: :cascade do |t| t.string "username", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "type", null: false t.index ["username"], name: "index_metasploit_credential_publics_on_username", unique: true end @@ -330,8 +329,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "metasploit_credential_realms", id: :serial, force: :cascade do |t| t.string "key", null: false t.string "value", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["key", "value"], name: "index_metasploit_credential_realms_on_key_and_value", unique: true end @@ -361,7 +360,7 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do end create_table "module_details", id: :serial, force: :cascade do |t| - t.datetime "mtime" + t.datetime "mtime", precision: nil t.text "file" t.string "mtype" t.text "refname" @@ -371,7 +370,7 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.text "description" t.string "license" t.boolean "privileged" - t.datetime "disclosure_date" + t.datetime "disclosure_date", precision: nil t.integer "default_target" t.text "default_action" t.string "stance" @@ -402,7 +401,7 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do end create_table "module_runs", id: :serial, force: :cascade do |t| - t.datetime "attempted_at" + t.datetime "attempted_at", precision: nil t.text "fail_detail" t.string "fail_reason" t.text "module_fullname" @@ -414,8 +413,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "trackable_type" t.integer "user_id" t.string "username" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.index ["session_id"], name: "index_module_runs_on_session_id" t.index ["user_id"], name: "index_module_runs_on_user_id" end @@ -428,8 +427,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do end create_table "nexpose_consoles", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "enabled", default: true t.text "owner" t.text "address" @@ -444,12 +443,12 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do end create_table "notes", id: :serial, force: :cascade do |t| - t.datetime "created_at" + t.datetime "created_at", precision: nil t.string "ntype", limit: 512 t.integer "workspace_id", default: 1, null: false t.integer "service_id" t.integer "host_id" - t.datetime "updated_at" + t.datetime "updated_at", precision: nil t.boolean "critical" t.boolean "seen" t.text "data" @@ -471,13 +470,13 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "raw_payload_hash" t.string "build_status" t.string "build_opts" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "profiles", id: :serial, force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.boolean "active", default: true t.text "name" t.text "owner" @@ -486,9 +485,9 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "refs", id: :serial, force: :cascade do |t| t.integer "ref_id" - t.datetime "created_at" + t.datetime "created_at", precision: nil t.string "name", limit: 512 - t.datetime "updated_at" + t.datetime "updated_at", precision: nil t.index ["name"], name: "index_refs_on_name" end @@ -497,8 +496,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "created_by" t.string "path", limit: 1024 t.text "name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "reports", id: :serial, force: :cascade do |t| @@ -507,9 +506,9 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "rtype" t.string "path", limit: 1024 t.text "options" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.datetime "downloaded_at" + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false + t.datetime "downloaded_at", precision: nil t.integer "task_id" t.string "name", limit: 63 end @@ -522,12 +521,12 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "services", id: :serial, force: :cascade do |t| t.integer "host_id" - t.datetime "created_at" + t.datetime "created_at", precision: nil t.integer "port", null: false t.string "proto", limit: 16, null: false t.string "state" t.string "name" - t.datetime "updated_at" + t.datetime "updated_at", precision: nil t.text "info" t.index ["host_id", "port", "proto"], name: "index_services_on_host_id_and_port_and_proto", unique: true t.index ["name"], name: "index_services_on_name" @@ -543,7 +542,7 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.binary "output" t.string "remote_path" t.string "local_path" - t.datetime "created_at" + t.datetime "created_at", precision: nil end create_table "sessions", id: :serial, force: :cascade do |t| @@ -555,11 +554,11 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.integer "port" t.string "platform" t.text "datastore" - t.datetime "opened_at", null: false - t.datetime "closed_at" + t.datetime "opened_at", precision: nil, null: false + t.datetime "closed_at", precision: nil t.string "close_reason" t.integer "local_id" - t.datetime "last_seen" + t.datetime "last_seen", precision: nil t.integer "module_run_id" t.index ["module_run_id"], name: "index_sessions_on_module_run_id" end @@ -571,51 +570,51 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.boolean "report_summary", default: false, null: false t.boolean "report_detail", default: false, null: false t.boolean "critical", default: false, null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "task_creds", id: :serial, force: :cascade do |t| t.integer "task_id", null: false t.integer "cred_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "task_hosts", id: :serial, force: :cascade do |t| t.integer "task_id", null: false t.integer "host_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "task_services", id: :serial, force: :cascade do |t| t.integer "task_id", null: false t.integer "service_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "task_sessions", id: :serial, force: :cascade do |t| t.integer "task_id", null: false t.integer "session_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false end create_table "tasks", id: :serial, force: :cascade do |t| t.integer "workspace_id", default: 1, null: false t.string "created_by" t.string "module" - t.datetime "completed_at" + t.datetime "completed_at", precision: nil t.string "path", limit: 1024 t.string "info" t.string "description" t.integer "progress" t.text "options" t.text "error" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "result" t.string "module_uuid", limit: 8 t.binary "settings" @@ -626,8 +625,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "crypted_password" t.string "password_salt" t.string "persistence_token" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "fullname" t.string "email" t.string "phone" @@ -638,7 +637,7 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "vuln_attempts", id: :serial, force: :cascade do |t| t.integer "vuln_id" - t.datetime "attempted_at" + t.datetime "attempted_at", precision: nil t.boolean "exploited" t.string "fail_reason" t.string "username" @@ -661,26 +660,26 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "nx_vuln_id" t.float "nx_severity" t.float "nx_pci_severity" - t.datetime "nx_published" - t.datetime "nx_added" - t.datetime "nx_modified" + t.datetime "nx_published", precision: nil + t.datetime "nx_added", precision: nil + t.datetime "nx_modified", precision: nil t.text "nx_tags" t.text "nx_vuln_status" t.text "nx_proof_key" t.string "src" t.integer "nx_scan_id" - t.datetime "nx_vulnerable_since" + t.datetime "nx_vulnerable_since", precision: nil t.string "nx_pci_compliance_status" end create_table "vulns", id: :serial, force: :cascade do |t| t.integer "host_id" t.integer "service_id" - t.datetime "created_at" + t.datetime "created_at", precision: nil t.string "name" - t.datetime "updated_at" + t.datetime "updated_at", precision: nil t.string "info", limit: 65536 - t.datetime "exploited_at" + t.datetime "exploited_at", precision: nil t.integer "vuln_detail_count", default: 0 t.integer "vuln_attempt_count", default: 0 t.integer "origin_id" @@ -696,8 +695,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "web_forms", id: :serial, force: :cascade do |t| t.integer "web_site_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "path" t.string "method", limit: 1024 t.text "params" @@ -707,15 +706,15 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "web_pages", id: :serial, force: :cascade do |t| t.integer "web_site_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "path" t.text "query" t.integer "code", null: false t.text "cookie" t.text "auth" t.text "ctype" - t.datetime "mtime" + t.datetime "mtime", precision: nil t.text "location" t.text "headers" t.binary "body" @@ -726,8 +725,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "web_sites", id: :serial, force: :cascade do |t| t.integer "service_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "vhost", limit: 2048 t.text "comments" t.text "options" @@ -738,8 +737,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "web_vulns", id: :serial, force: :cascade do |t| t.integer "web_site_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.text "path", null: false t.string "method", limit: 1024, null: false t.text "params" @@ -773,8 +772,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.string "respcode", limit: 16 t.text "resphead" t.text "response" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil end create_table "wmap_targets", id: :serial, force: :cascade do |t| @@ -783,8 +782,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do t.integer "port" t.integer "ssl" t.integer "selected" - t.datetime "created_at" - t.datetime "updated_at" + t.datetime "created_at", precision: nil + t.datetime "updated_at", precision: nil end create_table "workspace_members", id: false, force: :cascade do |t| @@ -794,8 +793,8 @@ ActiveRecord::Schema.define(version: 2019_05_07_120211) do create_table "workspaces", id: :serial, force: :cascade do |t| t.string "name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.datetime "created_at", precision: nil, null: false + t.datetime "updated_at", precision: nil, null: false t.string "boundary", limit: 4096 t.string "description", limit: 4096 t.integer "owner_id" From 149870d8a5b65695bf6c715b07df425dd87996f1 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Tue, 22 Nov 2022 15:00:12 -0600 Subject: [PATCH 04/10] update Ruby version requirement --- metasploit-framework.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metasploit-framework.gemspec b/metasploit-framework.gemspec index 9c47a3ea9d..62d043a129 100644 --- a/metasploit-framework.gemspec +++ b/metasploit-framework.gemspec @@ -44,7 +44,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^spec/}) spec.require_paths = ["lib"] - spec.required_ruby_version = '>= 2.6' + spec.required_ruby_version = '>= 2.7' # Database support spec.add_runtime_dependency 'activerecord', *Metasploit::Framework::RailsVersionConstraint::RAILS_VERSION From 5ce04e97e881fd38f56dfbe6710990d33e42ccf2 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Thu, 10 Nov 2022 14:18:23 -0600 Subject: [PATCH 05/10] update Gemfile dev deps --- Gemfile | 7 +++---- Gemfile.lock | 35 ++++++++++++++++++----------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Gemfile b/Gemfile index 054431f2ab..a5ed8510fb 100644 --- a/Gemfile +++ b/Gemfile @@ -3,10 +3,9 @@ source 'https://rubygems.org' # spec.add_runtime_dependency '', [] gemspec name: 'metasploit-framework' -gem 'metasploit-concern', path: '../gem/metasploit-concern' -gem 'metasploit_data_models', path: '../metasploit_data_models' -gem 'metasploit-credential', path: '../gem/metasploit-credential' -gem 'metasploit-model', path: '../gem/metasploit-model' +gem 'metasploit-concern', git: 'https://github.com/jmartin-r7/metasploit-concern', branch: 'add-support-for-rails-7' +gem 'metasploit_data_models', git: 'https://github.com/jmartin-r7/metasploit_data_models', branch: 'add-support-for-rails-7' +gem 'metasploit-credential', git: 'https://github.com/jmartin-r7/metasploit-credential', branch: 'add-support-for-rails-7' # separate from test as simplecov is not run on travis-ci group :coverage do diff --git a/Gemfile.lock b/Gemfile.lock index fb3eb2be66..204cce355f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,5 +1,7 @@ -PATH - remote: ../gem/metasploit-concern +GIT + remote: https://github.com/jmartin-r7/metasploit-concern + revision: 5fec21870eff06c3e4e80b517dc3c11df931268d + branch: add-support-for-rails-7 specs: metasploit-concern (5.0.0) activemodel (~> 7.0) @@ -7,10 +9,12 @@ PATH railties (~> 7.0) zeitwerk -PATH - remote: ../gem/metasploit-credential +GIT + remote: https://github.com/jmartin-r7/metasploit-credential + revision: bf1ffd5e6d3fb28ccf9d34aa5c41402fbb9d366b + branch: add-support-for-rails-7 specs: - metasploit-credential (5.0.10) + metasploit-credential (6.0.0) metasploit-concern metasploit-model metasploit_data_models (>= 5.0.0) @@ -21,18 +25,12 @@ PATH rubyntlm rubyzip -PATH - remote: ../gem/metasploit-model +GIT + remote: https://github.com/jmartin-r7/metasploit_data_models + revision: 1225880fc317e520c74edd3ef5e930b9c9f78546 + branch: add-support-for-rails-7 specs: - metasploit-model (5.0.0) - activemodel (~> 7.0) - activesupport (~> 7.0) - railties (~> 7.0) - -PATH - remote: ../metasploit_data_models - specs: - metasploit_data_models (5.0.6) + metasploit_data_models (6.0.0) activerecord (~> 7.0) activesupport (~> 7.0) arel-helpers @@ -274,6 +272,10 @@ GEM nokogiri (>= 1.5.9) memory_profiler (1.0.1) metasm (1.0.5) + metasploit-model (5.0.0) + activemodel (~> 7.0) + activesupport (~> 7.0) + railties (~> 7.0) metasploit-payloads (2.0.108) metasploit_payloads-mettle (1.0.20) method_source (1.0.0) @@ -525,7 +527,6 @@ DEPENDENCIES metasploit-concern! metasploit-credential! metasploit-framework! - metasploit-model! metasploit_data_models! octokit pry-byebug From 1323889b654fdf0aff1b621c21555cc7dcf21ea1 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Tue, 29 Nov 2022 14:37:08 -0600 Subject: [PATCH 06/10] update to released Rails 7 supported deps --- Gemfile | 4 --- Gemfile.lock | 71 ++++++++++++++++++---------------------------------- 2 files changed, 25 insertions(+), 50 deletions(-) diff --git a/Gemfile b/Gemfile index a5ed8510fb..3195454666 100644 --- a/Gemfile +++ b/Gemfile @@ -3,10 +3,6 @@ source 'https://rubygems.org' # spec.add_runtime_dependency '', [] gemspec name: 'metasploit-framework' -gem 'metasploit-concern', git: 'https://github.com/jmartin-r7/metasploit-concern', branch: 'add-support-for-rails-7' -gem 'metasploit_data_models', git: 'https://github.com/jmartin-r7/metasploit_data_models', branch: 'add-support-for-rails-7' -gem 'metasploit-credential', git: 'https://github.com/jmartin-r7/metasploit-credential', branch: 'add-support-for-rails-7' - # separate from test as simplecov is not run on travis-ci group :coverage do # code coverage for tests diff --git a/Gemfile.lock b/Gemfile.lock index 204cce355f..751418cd8a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,46 +1,3 @@ -GIT - remote: https://github.com/jmartin-r7/metasploit-concern - revision: 5fec21870eff06c3e4e80b517dc3c11df931268d - branch: add-support-for-rails-7 - specs: - metasploit-concern (5.0.0) - activemodel (~> 7.0) - activesupport (~> 7.0) - railties (~> 7.0) - zeitwerk - -GIT - remote: https://github.com/jmartin-r7/metasploit-credential - revision: bf1ffd5e6d3fb28ccf9d34aa5c41402fbb9d366b - branch: add-support-for-rails-7 - specs: - metasploit-credential (6.0.0) - metasploit-concern - metasploit-model - metasploit_data_models (>= 5.0.0) - net-ssh - pg - railties - rex-socket - rubyntlm - rubyzip - -GIT - remote: https://github.com/jmartin-r7/metasploit_data_models - revision: 1225880fc317e520c74edd3ef5e930b9c9f78546 - branch: add-support-for-rails-7 - specs: - metasploit_data_models (6.0.0) - activerecord (~> 7.0) - activesupport (~> 7.0) - arel-helpers - metasploit-concern - metasploit-model (>= 3.1) - pg - railties (~> 7.0) - recog - webrick - PATH remote: . specs: @@ -272,11 +229,36 @@ GEM nokogiri (>= 1.5.9) memory_profiler (1.0.1) metasm (1.0.5) + metasploit-concern (5.0.0) + activemodel (~> 7.0) + activesupport (~> 7.0) + railties (~> 7.0) + zeitwerk + metasploit-credential (6.0.0) + metasploit-concern + metasploit-model + metasploit_data_models (>= 5.0.0) + net-ssh + pg + railties + rex-socket + rubyntlm + rubyzip metasploit-model (5.0.0) activemodel (~> 7.0) activesupport (~> 7.0) railties (~> 7.0) metasploit-payloads (2.0.108) + metasploit_data_models (6.0.0) + activerecord (~> 7.0) + activesupport (~> 7.0) + arel-helpers + metasploit-concern + metasploit-model (>= 3.1) + pg + railties (~> 7.0) + recog + webrick metasploit_payloads-mettle (1.0.20) method_source (1.0.0) mini_portile2 (2.8.1) @@ -524,10 +506,7 @@ DEPENDENCIES factory_bot_rails fivemat memory_profiler - metasploit-concern! - metasploit-credential! metasploit-framework! - metasploit_data_models! octokit pry-byebug rake From 6b64a15ab1840898f013628166694a9c51aab03c Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Tue, 20 Dec 2022 18:16:14 -0600 Subject: [PATCH 07/10] updated metasploit_data_models --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 751418cd8a..ea2ee74c08 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -249,7 +249,7 @@ GEM activesupport (~> 7.0) railties (~> 7.0) metasploit-payloads (2.0.108) - metasploit_data_models (6.0.0) + metasploit_data_models (6.0.1) activerecord (~> 7.0) activesupport (~> 7.0) arel-helpers From 58172267ac0e6a90943296771c417ac3261abc40 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Thu, 19 Jan 2023 13:44:41 -0600 Subject: [PATCH 08/10] update to latest Rails 7 gem --- Gemfile.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index ea2ee74c08..5c381809a7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,25 +96,25 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.1.0) - actionpack (7.0.4) - actionview (= 7.0.4) - activesupport (= 7.0.4) + actionpack (7.0.4.1) + actionview (= 7.0.4.1) + activesupport (= 7.0.4.1) rack (~> 2.0, >= 2.2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actionview (7.0.4) - activesupport (= 7.0.4) + actionview (7.0.4.1) + activesupport (= 7.0.4.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.1, >= 1.2.0) - activemodel (7.0.4) - activesupport (= 7.0.4) - activerecord (7.0.4) - activemodel (= 7.0.4) - activesupport (= 7.0.4) - activesupport (7.0.4) + activemodel (7.0.4.1) + activesupport (= 7.0.4.1) + activerecord (7.0.4.1) + activemodel (= 7.0.4.1) + activesupport (= 7.0.4.1) + activesupport (7.0.4.1) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) @@ -320,11 +320,11 @@ GEM rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.4.3) - loofah (~> 2.3) - railties (7.0.4) - actionpack (= 7.0.4) - activesupport (= 7.0.4) + rails-html-sanitizer (1.4.4) + loofah (~> 2.19, >= 2.19.1) + railties (7.0.4.1) + actionpack (= 7.0.4.1) + activesupport (= 7.0.4.1) method_source rake (>= 12.2) thor (~> 1.0) From 90dc90cbabfb7cc94405125148a3d4fff408844f Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Mon, 23 Jan 2023 10:03:32 -0600 Subject: [PATCH 09/10] future proof legacy connection --- config/application.rb | 4 +++- lib/metasploit/framework/common_engine.rb | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index c3a6e84181..2a7089f735 100644 --- a/config/application.rb +++ b/config/application.rb @@ -50,7 +50,9 @@ module Metasploit config.eager_load = true end - ActiveRecord.legacy_connection_handling = false + if ActiveRecord.respond_to?(:legacy_connection_handling=) + ActiveRecord.legacy_connection_handling = false + end end end end diff --git a/lib/metasploit/framework/common_engine.rb b/lib/metasploit/framework/common_engine.rb index bd0425abca..58a0310990 100644 --- a/lib/metasploit/framework/common_engine.rb +++ b/lib/metasploit/framework/common_engine.rb @@ -40,7 +40,9 @@ module Metasploit::Framework::CommonEngine config.active_support.deprecation = :stderr - ActiveRecord.legacy_connection_handling = false + if ActiveRecord.respond_to?(:legacy_connection_handling=) + ActiveRecord.legacy_connection_handling = false + end # # `initializer`s # From b295429fc932780872363b9bf5f4bc64c4830490 Mon Sep 17 00:00:00 2001 From: Jeffrey Martin Date: Thu, 26 Jan 2023 09:22:56 -0600 Subject: [PATCH 10/10] latest metasploit-credential gem --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5c381809a7..38e5d12d99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -234,7 +234,7 @@ GEM activesupport (~> 7.0) railties (~> 7.0) zeitwerk - metasploit-credential (6.0.0) + metasploit-credential (6.0.1) metasploit-concern metasploit-model metasploit_data_models (>= 5.0.0)