diff --git a/Gemfile.lock b/Gemfile.lock index 1de93f3685..4a315a738c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,9 +2,9 @@ PATH remote: . specs: metasploit-framework (5.0.102) - actionpack (~> 4.2.6) - activerecord (~> 4.2.6) - activesupport (~> 4.2.6) + actionpack (~> 5.2.2) + activerecord (~> 5.2.2) + activesupport (~> 5.2.2) aws-sdk-ec2 aws-sdk-iam aws-sdk-s3 @@ -26,11 +26,11 @@ PATH jsobfu json metasm - metasploit-concern (~> 2.0.0) - metasploit-credential (~> 3.0.0) - metasploit-model (~> 2.0.4) + metasploit-concern + metasploit-credential + metasploit-model metasploit-payloads (= 1.4.4) - metasploit_data_models (~> 3.0.10) + metasploit_data_models metasploit_payloads-mettle (= 0.5.21) mqtt msgpack @@ -47,7 +47,7 @@ PATH patch_finder pcaprub pdf-reader - pg (~> 0.20) + pg railties rb-readline recog @@ -89,35 +89,34 @@ GEM remote: https://rubygems.org/ specs: Ascii85 (1.0.3) - actionpack (4.2.11.3) - actionview (= 4.2.11.3) - activesupport (= 4.2.11.3) - rack (~> 1.6) - rack-test (~> 0.6.2) - rails-dom-testing (~> 1.0, >= 1.0.5) + actionpack (5.2.4.3) + actionview (= 5.2.4.3) + activesupport (= 5.2.4.3) + rack (~> 2.0, >= 2.0.8) + rack-test (>= 0.6.3) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (4.2.11.3) - activesupport (= 4.2.11.3) + actionview (5.2.4.3) + activesupport (= 5.2.4.3) builder (~> 3.1) - erubis (~> 2.7.0) - rails-dom-testing (~> 1.0, >= 1.0.5) + erubi (~> 1.4) + rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activemodel (4.2.11.3) - activesupport (= 4.2.11.3) - builder (~> 3.1) - activerecord (4.2.11.3) - activemodel (= 4.2.11.3) - activesupport (= 4.2.11.3) - arel (~> 6.0) - activesupport (4.2.11.3) - i18n (~> 0.7) + activemodel (5.2.4.3) + activesupport (= 5.2.4.3) + activerecord (5.2.4.3) + activemodel (= 5.2.4.3) + activesupport (= 5.2.4.3) + arel (>= 9.0) + activesupport (5.2.4.3) + concurrent-ruby (~> 1.0, >= 1.0.2) + i18n (>= 0.7, < 2) minitest (~> 5.1) - thread_safe (~> 0.3, >= 0.3.4) tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) afm (0.2.2) - arel (6.0.4) + arel (9.0.0) arel-helpers (2.11.0) activerecord (>= 3.1.0, < 7) ast (2.4.1) @@ -168,15 +167,15 @@ GEM http_parser.rb (>= 0.6.0) em-socksify (0.3.2) eventmachine (>= 1.0.0.beta.4) - erubis (2.7.0) + erubi (1.9.0) eventmachine (1.2.7) - factory_bot (5.2.0) - activesupport (>= 4.2.0) - factory_bot_rails (5.2.0) - factory_bot (~> 5.2.0) - railties (>= 4.2.0) - faker (2.2.1) - i18n (>= 0.8) + factory_bot (6.0.2) + activesupport (>= 5.0.0) + factory_bot_rails (6.0.0) + factory_bot (~> 6.0.0) + railties (>= 5.0.0) + faker (2.13.0) + i18n (>= 1.6, < 2) faraday (1.0.1) multipart-post (>= 1.2, < 3) faye-websocket (0.10.9) @@ -188,7 +187,7 @@ GEM hrr_rb_ssh (0.3.0.pre2) ed25519 (~> 1.2) http_parser.rb (0.6.0) - i18n (0.9.5) + i18n (1.8.3) concurrent-ruby (~> 1.0) io-console (0.5.6) irb (1.2.4) @@ -202,11 +201,11 @@ GEM nokogiri (>= 1.5.9) memory_profiler (0.9.14) metasm (1.0.4) - metasploit-concern (2.0.5) - activemodel (~> 4.2.6) - activesupport (~> 4.2.6) - railties (~> 4.2.6) - metasploit-credential (3.0.4) + metasploit-concern (3.0.0) + activemodel (~> 5.2.2) + activesupport (~> 5.2.2) + railties (~> 5.2.2) + metasploit-credential (4.0.2) metasploit-concern metasploit-model metasploit_data_models (>= 3.0.0) @@ -216,20 +215,19 @@ GEM rex-socket rubyntlm rubyzip - metasploit-model (2.0.4) - activemodel (~> 4.2.6) - activesupport (~> 4.2.6) - railties (~> 4.2.6) + metasploit-model (3.0.0) + activemodel (~> 5.2.2) + activesupport (~> 5.2.2) + railties (~> 5.2.2) metasploit-payloads (1.4.4) - metasploit_data_models (3.0.10) - activerecord (~> 4.2.6) - activesupport (~> 4.2.6) + metasploit_data_models (4.0.2) + activerecord (~> 5.2.2) + activesupport (~> 5.2.2) arel-helpers metasploit-concern metasploit-model pg - postgres_ext - railties (~> 4.2.6) + railties (~> 5.2.2) recog (~> 2.0) metasploit_payloads-mettle (0.5.21) method_source (1.0.0) @@ -238,6 +236,8 @@ GEM mqtt (0.5.0) msgpack (1.3.3) multipart-post (2.1.1) + mustermann (1.1.1) + ruby2_keywords (~> 0.0.1) nessus_rest (0.1.6) net-ldap (0.16.2) net-ssh (6.1.0) @@ -263,12 +263,7 @@ GEM hashery (~> 2.0) ruby-rc4 ttfunk - pg (0.21.0) - pg_array_parser (0.0.9) - postgres_ext (3.0.1) - activerecord (~> 4.0) - arel (>= 4.0.1) - pg_array_parser (~> 0.0.9) + pg (1.2.3) pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) @@ -276,24 +271,22 @@ GEM byebug (~> 11.0) pry (~> 0.13.0) public_suffix (4.0.5) - rack (1.6.13) - rack-protection (1.5.5) + rack (2.2.3) + rack-protection (2.0.8.1) rack - rack-test (0.6.3) - rack (>= 1.0) - rails-deprecated_sanitizer (1.0.3) - activesupport (>= 4.2.0.alpha) - rails-dom-testing (1.0.9) - activesupport (>= 4.2.0, < 5.0) - nokogiri (~> 1.6) - rails-deprecated_sanitizer (>= 1.0.1) + rack-test (1.1.0) + rack (>= 1.0, < 3) + rails-dom-testing (2.0.3) + activesupport (>= 4.2.0) + nokogiri (>= 1.6) rails-html-sanitizer (1.3.0) loofah (~> 2.3) - railties (4.2.11.3) - actionpack (= 4.2.11.3) - activesupport (= 4.2.11.3) + railties (5.2.4.3) + actionpack (= 5.2.4.3) + activesupport (= 5.2.4.3) + method_source rake (>= 0.8.7) - thor (>= 0.18.1, < 2.0) + thor (>= 0.19.0, < 2.0) rainbow (3.0.0) rake (13.0.1) rb-readline (0.5.5) @@ -390,6 +383,7 @@ GEM ruby-prof (1.4.1) ruby-progressbar (1.10.1) ruby-rc4 (0.1.5) + ruby2_keywords (0.0.2) ruby_smb (1.1.0) bindata rubyntlm @@ -403,10 +397,11 @@ GEM docile (~> 1.1) simplecov-html (~> 0.11) simplecov-html (0.12.2) - sinatra (1.4.8) - rack (~> 1.5) - rack-protection (~> 1.4) - tilt (>= 1.3, < 3) + sinatra (2.0.8.1) + mustermann (~> 1.0) + rack (~> 2.0) + rack-protection (= 2.0.8.1) + tilt (~> 2.0) sqlite3 (1.3.13) sshkey (2.0.0) swagger-blocks (3.0.0) @@ -424,15 +419,15 @@ GEM tzinfo-data (1.2020.1) tzinfo (>= 1.0.0) unicode-display_width (1.7.0) - warden (1.2.7) - rack (>= 1.0) + warden (1.2.8) + rack (>= 2.0.6) websocket-driver (0.7.3) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) windows_error (0.1.2) - xdr (2.0.0) - activemodel (>= 4.2.7) - activesupport (>= 4.2.7) + xdr (3.0.1) + activemodel (>= 5.2.0) + activesupport (>= 5.2.0) xmlrpc (0.3.0) yard (0.9.25) @@ -459,4 +454,4 @@ DEPENDENCIES yard BUNDLED WITH - 1.17.3 + 1.17.2 diff --git a/db/schema.rb b/db/schema.rb index cbf142db31..430394e1f5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1,4 +1,3 @@ -# encoding: UTF-8 # This file is auto-generated from the current state of the database. Instead # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. @@ -11,82 +10,77 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20190507120211) do +ActiveRecord::Schema.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", force: :cascade do |t| - t.text "token" + 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 end - create_table "async_callbacks", force: :cascade do |t| - t.string "uuid", null: false - t.integer "timestamp", null: false - 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.uuid "{:null=>false}" - end - - create_table "automatic_exploitation_match_results", force: :cascade do |t| - t.integer "match_id" - t.integer "run_id" - t.string "state", null: false + create_table "async_callbacks", id: :serial, force: :cascade do |t| + t.string "uuid", null: false + t.integer "timestamp", null: false + t.string "listener_uri" + t.string "target_host" + t.string "target_port" t.datetime "created_at", null: false t.datetime "updated_at", null: false end - add_index "automatic_exploitation_match_results", ["match_id"], name: "index_automatic_exploitation_match_results_on_match_id", using: :btree - add_index "automatic_exploitation_match_results", ["run_id"], name: "index_automatic_exploitation_match_results_on_run_id", using: :btree - - create_table "automatic_exploitation_match_sets", force: :cascade do |t| - t.integer "workspace_id" - t.integer "user_id" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + 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.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 - add_index "automatic_exploitation_match_sets", ["user_id"], name: "index_automatic_exploitation_match_sets_on_user_id", using: :btree - add_index "automatic_exploitation_match_sets", ["workspace_id"], name: "index_automatic_exploitation_match_sets_on_workspace_id", using: :btree - - create_table "automatic_exploitation_matches", force: :cascade do |t| - 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.integer "match_set_id" - t.string "matchable_type" - t.integer "matchable_id" - t.text "module_fullname" + 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.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 - add_index "automatic_exploitation_matches", ["module_detail_id"], name: "index_automatic_exploitation_matches_on_module_detail_id", using: :btree - add_index "automatic_exploitation_matches", ["module_fullname"], name: "index_automatic_exploitation_matches_on_module_fullname", using: :btree - - create_table "automatic_exploitation_runs", force: :cascade do |t| - 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 + create_table "automatic_exploitation_matches", id: :serial, force: :cascade do |t| + 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.integer "match_set_id" + t.string "matchable_type" + t.integer "matchable_id" + t.text "module_fullname" + t.index ["module_detail_id"], name: "index_automatic_exploitation_matches_on_module_detail_id" + t.index ["module_fullname"], name: "index_automatic_exploitation_matches_on_module_fullname" end - add_index "automatic_exploitation_runs", ["match_set_id"], name: "index_automatic_exploitation_runs_on_match_set_id", using: :btree - add_index "automatic_exploitation_runs", ["user_id"], name: "index_automatic_exploitation_runs_on_user_id", using: :btree - add_index "automatic_exploitation_runs", ["workspace_id"], name: "index_automatic_exploitation_runs_on_workspace_id", using: :btree + create_table "automatic_exploitation_runs", id: :serial, force: :cascade do |t| + 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.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" + end - create_table "clients", force: :cascade do |t| - t.integer "host_id" + create_table "clients", id: :serial, force: :cascade do |t| + t.integer "host_id" t.datetime "created_at" - t.string "ua_string", limit: 1024, null: false - t.string "ua_name", limit: 64 - t.string "ua_ver", limit: 32 + t.string "ua_string", limit: 1024, null: false + t.string "ua_name", limit: 64 + t.string "ua_ver", limit: 32 t.datetime "updated_at" end @@ -100,743 +94,713 @@ ActiveRecord::Schema.define(version: 20190507120211) do t.integer "task_id" end - create_table "creds", force: :cascade do |t| - t.integer "service_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "user", limit: 2048 - t.string "pass", limit: 4096 - t.boolean "active", default: true - t.string "proof", limit: 4096 - t.string "ptype", limit: 256 - t.integer "source_id" - t.string "source_type" + 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.string "user", limit: 2048 + t.string "pass", limit: 4096 + t.boolean "active", default: true + t.string "proof", limit: 4096 + t.string "ptype", limit: 256 + t.integer "source_id" + t.string "source_type" end - create_table "events", force: :cascade do |t| - t.integer "workspace_id" - t.integer "host_id" + create_table "events", id: :serial, force: :cascade do |t| + t.integer "workspace_id" + t.integer "host_id" t.datetime "created_at" - t.string "name" + t.string "name" t.datetime "updated_at" - t.boolean "critical" - t.boolean "seen" - t.string "username" - t.text "info" + t.boolean "critical" + t.boolean "seen" + t.string "username" + t.text "info" end - create_table "exploit_attempts", force: :cascade do |t| - t.integer "host_id" - t.integer "service_id" - t.integer "vuln_id" + create_table "exploit_attempts", id: :serial, force: :cascade do |t| + t.integer "host_id" + t.integer "service_id" + t.integer "vuln_id" t.datetime "attempted_at" - t.boolean "exploited" - t.string "fail_reason" - t.string "username" - t.text "module" - t.integer "session_id" - t.integer "loot_id" - t.integer "port" - t.string "proto" - t.text "fail_detail" + t.boolean "exploited" + t.string "fail_reason" + t.string "username" + t.text "module" + t.integer "session_id" + t.integer "loot_id" + t.integer "port" + t.string "proto" + t.text "fail_detail" end - create_table "exploited_hosts", force: :cascade do |t| - t.integer "host_id", null: false - t.integer "service_id" - 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 + create_table "exploited_hosts", id: :serial, force: :cascade do |t| + t.integer "host_id", null: false + t.integer "service_id" + 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 end - create_table "host_details", force: :cascade do |t| + create_table "host_details", id: :serial, force: :cascade do |t| t.integer "host_id" t.integer "nx_console_id" t.integer "nx_device_id" - t.string "src" - t.string "nx_site_name" - t.string "nx_site_importance" - t.string "nx_scan_template" - t.float "nx_risk_score" + t.string "src" + t.string "nx_site_name" + t.string "nx_site_importance" + t.string "nx_scan_template" + t.float "nx_risk_score" end - create_table "hosts", force: :cascade do |t| + create_table "hosts", id: :serial, force: :cascade do |t| t.datetime "created_at" - t.inet "address", null: false - t.string "mac" - t.string "comm" - t.string "name" - t.string "state" - t.string "os_name" - t.string "os_flavor" - t.string "os_sp" - t.string "os_lang" - t.string "arch" - t.integer "workspace_id", null: false + t.inet "address", null: false + t.string "mac" + t.string "comm" + t.string "name" + t.string "state" + t.string "os_name" + t.string "os_flavor" + t.string "os_sp" + t.string "os_lang" + t.string "arch" + t.integer "workspace_id", null: false t.datetime "updated_at" - t.text "purpose" - t.string "info", limit: 65536 - t.text "comments" - t.text "scope" - t.text "virtual_host" - t.integer "note_count", default: 0 - t.integer "vuln_count", default: 0 - t.integer "service_count", default: 0 - t.integer "host_detail_count", default: 0 - t.integer "exploit_attempt_count", default: 0 - t.integer "cred_count", default: 0 - t.string "detected_arch" - t.string "os_family" + t.text "purpose" + t.string "info", limit: 65536 + t.text "comments" + t.text "scope" + t.text "virtual_host" + t.integer "note_count", default: 0 + t.integer "vuln_count", default: 0 + t.integer "service_count", default: 0 + t.integer "host_detail_count", default: 0 + t.integer "exploit_attempt_count", default: 0 + t.integer "cred_count", default: 0 + t.string "detected_arch" + t.string "os_family" + t.index ["name"], name: "index_hosts_on_name" + t.index ["os_flavor"], name: "index_hosts_on_os_flavor" + t.index ["os_name"], name: "index_hosts_on_os_name" + t.index ["purpose"], name: "index_hosts_on_purpose" + t.index ["state"], name: "index_hosts_on_state" + t.index ["workspace_id", "address"], name: "index_hosts_on_workspace_id_and_address", unique: true end - add_index "hosts", ["name"], name: "index_hosts_on_name", using: :btree - add_index "hosts", ["os_flavor"], name: "index_hosts_on_os_flavor", using: :btree - add_index "hosts", ["os_name"], name: "index_hosts_on_os_name", using: :btree - add_index "hosts", ["purpose"], name: "index_hosts_on_purpose", using: :btree - add_index "hosts", ["state"], name: "index_hosts_on_state", using: :btree - add_index "hosts", ["workspace_id", "address"], name: "index_hosts_on_workspace_id_and_address", unique: true, using: :btree - - create_table "hosts_tags", force: :cascade do |t| + create_table "hosts_tags", id: :serial, force: :cascade do |t| t.integer "host_id" t.integer "tag_id" end - create_table "listeners", force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "workspace_id", default: 1, null: false - t.integer "task_id" - t.boolean "enabled", default: true - t.text "owner" - t.text "payload" - t.text "address" - t.integer "port" - t.binary "options" - t.text "macro" + create_table "listeners", id: :serial, force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.integer "workspace_id", default: 1, null: false + t.integer "task_id" + t.boolean "enabled", default: true + t.text "owner" + t.text "payload" + t.text "address" + t.integer "port" + t.binary "options" + t.text "macro" end - create_table "loots", force: :cascade do |t| - t.integer "workspace_id", default: 1, null: false - t.integer "host_id" - t.integer "service_id" - 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.string "content_type" - t.text "name" - t.text "info" - t.integer "module_run_id" + create_table "loots", id: :serial, force: :cascade do |t| + t.integer "workspace_id", default: 1, null: false + t.integer "host_id" + t.integer "service_id" + 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.string "content_type" + t.text "name" + t.text "info" + t.integer "module_run_id" + t.index ["module_run_id"], name: "index_loots_on_module_run_id" end - add_index "loots", ["module_run_id"], name: "index_loots_on_module_run_id", using: :btree - - create_table "macros", force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "owner" - t.text "name" - t.text "description" - t.binary "actions" - t.binary "prefs" + create_table "macros", id: :serial, force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.text "owner" + t.text "name" + t.text "description" + t.binary "actions" + t.binary "prefs" end - create_table "metasploit_credential_cores", force: :cascade do |t| - t.integer "origin_id", null: false - t.string "origin_type", null: false - t.integer "private_id" - 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.integer "logins_count", default: 0 + create_table "metasploit_credential_cores", id: :serial, force: :cascade do |t| + t.string "origin_type", null: false + t.integer "origin_id", null: false + t.integer "private_id" + 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.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" + t.index ["public_id"], name: "index_metasploit_credential_cores_on_public_id" + t.index ["realm_id"], name: "index_metasploit_credential_cores_on_realm_id" + t.index ["workspace_id", "private_id"], name: "unique_private_metasploit_credential_cores", unique: true, where: "((realm_id IS NULL) AND (public_id IS NULL) AND (private_id IS NOT NULL))" + t.index ["workspace_id", "public_id", "private_id"], name: "unique_realmless_metasploit_credential_cores", unique: true, where: "((realm_id IS NULL) AND (public_id IS NOT NULL) AND (private_id IS NOT NULL))" + t.index ["workspace_id", "public_id"], name: "unique_public_metasploit_credential_cores", unique: true, where: "((realm_id IS NULL) AND (public_id IS NOT NULL) AND (private_id IS NULL))" + t.index ["workspace_id", "realm_id", "private_id"], name: "unique_publicless_metasploit_credential_cores", unique: true, where: "((realm_id IS NOT NULL) AND (public_id IS NULL) AND (private_id IS NOT NULL))" + t.index ["workspace_id", "realm_id", "public_id", "private_id"], name: "unique_complete_metasploit_credential_cores", unique: true, where: "((realm_id IS NOT NULL) AND (public_id IS NOT NULL) AND (private_id IS NOT NULL))" + t.index ["workspace_id", "realm_id", "public_id"], name: "unique_privateless_metasploit_credential_cores", unique: true, where: "((realm_id IS NOT NULL) AND (public_id IS NOT NULL) AND (private_id IS NULL))" + t.index ["workspace_id"], name: "index_metasploit_credential_cores_on_workspace_id" end - add_index "metasploit_credential_cores", ["origin_type", "origin_id"], name: "index_metasploit_credential_cores_on_origin_type_and_origin_id", using: :btree - add_index "metasploit_credential_cores", ["private_id"], name: "index_metasploit_credential_cores_on_private_id", using: :btree - add_index "metasploit_credential_cores", ["public_id"], name: "index_metasploit_credential_cores_on_public_id", using: :btree - add_index "metasploit_credential_cores", ["realm_id"], name: "index_metasploit_credential_cores_on_realm_id", using: :btree - add_index "metasploit_credential_cores", ["workspace_id", "private_id"], name: "unique_private_metasploit_credential_cores", unique: true, where: "((realm_id IS NULL) AND (public_id IS NULL) AND (private_id IS NOT NULL))", using: :btree - add_index "metasploit_credential_cores", ["workspace_id", "public_id", "private_id"], name: "unique_realmless_metasploit_credential_cores", unique: true, where: "((realm_id IS NULL) AND (public_id IS NOT NULL) AND (private_id IS NOT NULL))", using: :btree - add_index "metasploit_credential_cores", ["workspace_id", "public_id"], name: "unique_public_metasploit_credential_cores", unique: true, where: "((realm_id IS NULL) AND (public_id IS NOT NULL) AND (private_id IS NULL))", using: :btree - add_index "metasploit_credential_cores", ["workspace_id", "realm_id", "private_id"], name: "unique_publicless_metasploit_credential_cores", unique: true, where: "((realm_id IS NOT NULL) AND (public_id IS NULL) AND (private_id IS NOT NULL))", using: :btree - add_index "metasploit_credential_cores", ["workspace_id", "realm_id", "public_id", "private_id"], name: "unique_complete_metasploit_credential_cores", unique: true, where: "((realm_id IS NOT NULL) AND (public_id IS NOT NULL) AND (private_id IS NOT NULL))", using: :btree - add_index "metasploit_credential_cores", ["workspace_id", "realm_id", "public_id"], name: "unique_privateless_metasploit_credential_cores", unique: true, where: "((realm_id IS NOT NULL) AND (public_id IS NOT NULL) AND (private_id IS NULL))", using: :btree - add_index "metasploit_credential_cores", ["workspace_id"], name: "index_metasploit_credential_cores_on_workspace_id", using: :btree - - create_table "metasploit_credential_logins", force: :cascade do |t| - t.integer "core_id", null: false - t.integer "service_id", null: false - t.string "access_level" - t.string "status", null: false + create_table "metasploit_credential_logins", id: :serial, force: :cascade do |t| + t.integer "core_id", null: false + 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 - end - - add_index "metasploit_credential_logins", ["core_id", "service_id"], name: "index_metasploit_credential_logins_on_core_id_and_service_id", unique: true, using: :btree - add_index "metasploit_credential_logins", ["service_id", "core_id"], name: "index_metasploit_credential_logins_on_service_id_and_core_id", unique: true, using: :btree - - create_table "metasploit_credential_origin_cracked_passwords", force: :cascade do |t| - t.integer "metasploit_credential_core_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - end - - add_index "metasploit_credential_origin_cracked_passwords", ["metasploit_credential_core_id"], name: "originating_credential_cores", using: :btree - - create_table "metasploit_credential_origin_imports", 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.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 - add_index "metasploit_credential_origin_imports", ["task_id"], name: "index_metasploit_credential_origin_imports_on_task_id", using: :btree - - create_table "metasploit_credential_origin_manuals", force: :cascade do |t| - t.integer "user_id", null: false + 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.index ["metasploit_credential_core_id"], name: "originating_credential_cores" end - add_index "metasploit_credential_origin_manuals", ["user_id"], name: "index_metasploit_credential_origin_manuals_on_user_id", using: :btree - - create_table "metasploit_credential_origin_services", 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 - end - - add_index "metasploit_credential_origin_services", ["service_id", "module_full_name"], name: "unique_metasploit_credential_origin_services", unique: true, using: :btree - - create_table "metasploit_credential_origin_sessions", 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 - end - - add_index "metasploit_credential_origin_sessions", ["session_id", "post_reference_name"], name: "unique_metasploit_credential_origin_sessions", unique: true, using: :btree - - create_table "metasploit_credential_privates", force: :cascade do |t| - t.string "type", null: false - t.text "data", null: false + 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.string "jtr_format" + t.index ["task_id"], name: "index_metasploit_credential_origin_imports_on_task_id" end - add_index "metasploit_credential_privates", ["type", "data"], name: "index_metasploit_credential_privates_on_type_and_data", unique: true, where: "(NOT ((type)::text = 'Metasploit::Credential::SSHKey'::text))", using: :btree - add_index "metasploit_credential_privates", ["type"], name: "index_metasploit_credential_privates_on_type_and_data_sshkey", unique: true, where: "((type)::text = 'Metasploit::Credential::SSHKey'::text)", using: :btree - - create_table "metasploit_credential_publics", force: :cascade do |t| - t.string "username", null: false + 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.string "type", null: false + t.index ["user_id"], name: "index_metasploit_credential_origin_manuals_on_user_id" end - add_index "metasploit_credential_publics", ["username"], name: "index_metasploit_credential_publics_on_username", unique: true, using: :btree - - create_table "metasploit_credential_realms", force: :cascade do |t| - t.string "key", null: false - t.string "value", null: false + 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.index ["service_id", "module_full_name"], name: "unique_metasploit_credential_origin_services", unique: true end - add_index "metasploit_credential_realms", ["key", "value"], name: "index_metasploit_credential_realms_on_key_and_value", unique: true, using: :btree + 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.index ["session_id", "post_reference_name"], name: "unique_metasploit_credential_origin_sessions", unique: true + end - create_table "mod_refs", force: :cascade do |t| + 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.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))" + end + + 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.string "type", null: false + t.index ["username"], name: "index_metasploit_credential_publics_on_username", unique: true + end + + 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.index ["key", "value"], name: "index_metasploit_credential_realms_on_key_and_value", unique: true + end + + create_table "mod_refs", id: :serial, force: :cascade do |t| t.string "module", limit: 1024 - t.string "mtype", limit: 128 - t.text "ref" + t.string "mtype", limit: 128 + t.text "ref" end - create_table "module_actions", force: :cascade do |t| + create_table "module_actions", id: :serial, force: :cascade do |t| t.integer "detail_id" - t.text "name" + t.text "name" + t.index ["detail_id"], name: "index_module_actions_on_detail_id" end - add_index "module_actions", ["detail_id"], name: "index_module_actions_on_detail_id", using: :btree - - create_table "module_archs", force: :cascade do |t| + create_table "module_archs", id: :serial, force: :cascade do |t| t.integer "detail_id" - t.text "name" + t.text "name" + t.index ["detail_id"], name: "index_module_archs_on_detail_id" end - add_index "module_archs", ["detail_id"], name: "index_module_archs_on_detail_id", using: :btree - - create_table "module_authors", force: :cascade do |t| + create_table "module_authors", id: :serial, force: :cascade do |t| t.integer "detail_id" - t.text "name" - t.text "email" + t.text "name" + t.text "email" + t.index ["detail_id"], name: "index_module_authors_on_detail_id" end - add_index "module_authors", ["detail_id"], name: "index_module_authors_on_detail_id", using: :btree - - create_table "module_details", force: :cascade do |t| + create_table "module_details", id: :serial, force: :cascade do |t| t.datetime "mtime" - t.text "file" - t.string "mtype" - t.text "refname" - t.text "fullname" - t.text "name" - t.integer "rank" - t.text "description" - t.string "license" - t.boolean "privileged" + t.text "file" + t.string "mtype" + t.text "refname" + t.text "fullname" + t.text "name" + t.integer "rank" + t.text "description" + t.string "license" + t.boolean "privileged" t.datetime "disclosure_date" - t.integer "default_target" - t.text "default_action" - t.string "stance" - t.boolean "ready" + t.integer "default_target" + t.text "default_action" + t.string "stance" + t.boolean "ready" + t.index ["description"], name: "index_module_details_on_description" + t.index ["mtype"], name: "index_module_details_on_mtype" + t.index ["name"], name: "index_module_details_on_name" + t.index ["refname"], name: "index_module_details_on_refname" end - add_index "module_details", ["description"], name: "index_module_details_on_description", using: :btree - add_index "module_details", ["mtype"], name: "index_module_details_on_mtype", using: :btree - add_index "module_details", ["name"], name: "index_module_details_on_name", using: :btree - add_index "module_details", ["refname"], name: "index_module_details_on_refname", using: :btree - - create_table "module_mixins", force: :cascade do |t| + create_table "module_mixins", id: :serial, force: :cascade do |t| t.integer "detail_id" - t.text "name" + t.text "name" + t.index ["detail_id"], name: "index_module_mixins_on_detail_id" end - add_index "module_mixins", ["detail_id"], name: "index_module_mixins_on_detail_id", using: :btree - - create_table "module_platforms", force: :cascade do |t| + create_table "module_platforms", id: :serial, force: :cascade do |t| t.integer "detail_id" - t.text "name" + t.text "name" + t.index ["detail_id"], name: "index_module_platforms_on_detail_id" end - add_index "module_platforms", ["detail_id"], name: "index_module_platforms_on_detail_id", using: :btree - - create_table "module_refs", force: :cascade do |t| + create_table "module_refs", id: :serial, force: :cascade do |t| t.integer "detail_id" - t.text "name" + t.text "name" + t.index ["detail_id"], name: "index_module_refs_on_detail_id" + t.index ["name"], name: "index_module_refs_on_name" end - add_index "module_refs", ["detail_id"], name: "index_module_refs_on_detail_id", using: :btree - add_index "module_refs", ["name"], name: "index_module_refs_on_name", using: :btree - - create_table "module_runs", force: :cascade do |t| + create_table "module_runs", id: :serial, force: :cascade do |t| t.datetime "attempted_at" - t.text "fail_detail" - t.string "fail_reason" - t.text "module_fullname" - t.integer "port" - t.string "proto" - t.integer "session_id" - t.string "status" - t.integer "trackable_id" - t.string "trackable_type" - t.integer "user_id" - t.string "username" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + t.text "fail_detail" + t.string "fail_reason" + t.text "module_fullname" + t.integer "port" + t.string "proto" + t.integer "session_id" + t.string "status" + t.integer "trackable_id" + t.string "trackable_type" + t.integer "user_id" + t.string "username" + t.datetime "created_at", null: false + t.datetime "updated_at", 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 - add_index "module_runs", ["session_id"], name: "index_module_runs_on_session_id", using: :btree - add_index "module_runs", ["user_id"], name: "index_module_runs_on_user_id", using: :btree - - create_table "module_targets", force: :cascade do |t| + create_table "module_targets", id: :serial, force: :cascade do |t| t.integer "detail_id" t.integer "index" - t.text "name" + t.text "name" + t.index ["detail_id"], name: "index_module_targets_on_detail_id" end - add_index "module_targets", ["detail_id"], name: "index_module_targets_on_detail_id", using: :btree - - create_table "nexpose_consoles", force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "enabled", default: true - t.text "owner" - t.text "address" - t.integer "port", default: 3780 - t.text "username" - t.text "password" - t.text "status" - t.text "version" - t.text "cert" - t.binary "cached_sites" - t.text "name" + create_table "nexpose_consoles", id: :serial, force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "enabled", default: true + t.text "owner" + t.text "address" + t.integer "port", default: 3780 + t.text "username" + t.text "password" + t.text "status" + t.text "version" + t.text "cert" + t.binary "cached_sites" + t.text "name" end - create_table "notes", force: :cascade do |t| + create_table "notes", id: :serial, force: :cascade do |t| t.datetime "created_at" - t.string "ntype", limit: 512 - t.integer "workspace_id", default: 1, null: false - t.integer "service_id" - t.integer "host_id" + 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.boolean "critical" - t.boolean "seen" - t.text "data" - t.integer "vuln_id" + t.boolean "critical" + t.boolean "seen" + t.text "data" + t.integer "vuln_id" + t.index ["ntype"], name: "index_notes_on_ntype" + t.index ["vuln_id"], name: "index_notes_on_vuln_id" end - add_index "notes", ["ntype"], name: "index_notes_on_ntype", using: :btree - add_index "notes", ["vuln_id"], name: "index_notes_on_vuln_id", using: :btree - - create_table "payloads", force: :cascade do |t| - t.string "name" - t.string "uuid" - t.integer "uuid_mask" - t.integer "timestamp" - t.string "arch" - t.string "platform" - t.string "urls" - t.string "description" - t.string "raw_payload" - 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 + create_table "payloads", id: :serial, force: :cascade do |t| + t.string "name" + t.string "uuid" + t.integer "uuid_mask" + t.integer "timestamp" + t.string "arch" + t.string "platform" + t.string "urls" + t.string "description" + t.string "raw_payload" + 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 end - create_table "profiles", force: :cascade do |t| - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.boolean "active", default: true - t.text "name" - t.text "owner" - t.binary "settings" + create_table "profiles", id: :serial, force: :cascade do |t| + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.boolean "active", default: true + t.text "name" + t.text "owner" + t.binary "settings" end - create_table "refs", force: :cascade do |t| - t.integer "ref_id" + create_table "refs", id: :serial, force: :cascade do |t| + t.integer "ref_id" t.datetime "created_at" - t.string "name", limit: 512 + t.string "name", limit: 512 t.datetime "updated_at" + t.index ["name"], name: "index_refs_on_name" end - add_index "refs", ["name"], name: "index_refs_on_name", using: :btree - - create_table "report_templates", force: :cascade do |t| - t.integer "workspace_id", default: 1, null: false - t.string "created_by" - t.string "path", limit: 1024 - t.text "name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + create_table "report_templates", id: :serial, force: :cascade do |t| + t.integer "workspace_id", default: 1, null: false + t.string "created_by" + t.string "path", limit: 1024 + t.text "name" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false end - create_table "reports", force: :cascade do |t| - t.integer "workspace_id", default: 1, null: false - t.string "created_by" - t.string "rtype" - t.string "path", limit: 1024 - t.text "options" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false + create_table "reports", id: :serial, force: :cascade do |t| + t.integer "workspace_id", default: 1, null: false + t.string "created_by" + 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.integer "task_id" - t.string "name", limit: 63 + t.integer "task_id" + t.string "name", limit: 63 end - create_table "routes", force: :cascade do |t| + create_table "routes", id: :serial, force: :cascade do |t| t.integer "session_id" - t.string "subnet" - t.string "netmask" + t.string "subnet" + t.string "netmask" end - create_table "services", force: :cascade do |t| - t.integer "host_id" + create_table "services", id: :serial, force: :cascade do |t| + t.integer "host_id" t.datetime "created_at" - t.integer "port", null: false - t.string "proto", limit: 16, null: false - t.string "state" - t.string "name" + t.integer "port", null: false + t.string "proto", limit: 16, null: false + t.string "state" + t.string "name" t.datetime "updated_at" - t.text "info" + 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" + t.index ["port"], name: "index_services_on_port" + t.index ["proto"], name: "index_services_on_proto" + t.index ["state"], name: "index_services_on_state" end - add_index "services", ["host_id", "port", "proto"], name: "index_services_on_host_id_and_port_and_proto", unique: true, using: :btree - add_index "services", ["name"], name: "index_services_on_name", using: :btree - add_index "services", ["port"], name: "index_services_on_port", using: :btree - add_index "services", ["proto"], name: "index_services_on_proto", using: :btree - add_index "services", ["state"], name: "index_services_on_state", using: :btree - - create_table "session_events", force: :cascade do |t| - t.integer "session_id" - t.string "etype" - t.binary "command" - t.binary "output" - t.string "remote_path" - t.string "local_path" + create_table "session_events", id: :serial, force: :cascade do |t| + t.integer "session_id" + t.string "etype" + t.binary "command" + t.binary "output" + t.string "remote_path" + t.string "local_path" t.datetime "created_at" end - create_table "sessions", force: :cascade do |t| - t.integer "host_id" - t.string "stype" - t.string "via_exploit" - t.string "via_payload" - t.string "desc" - t.integer "port" - t.string "platform" - t.text "datastore" - t.datetime "opened_at", null: false + create_table "sessions", id: :serial, force: :cascade do |t| + t.integer "host_id" + t.string "stype" + t.string "via_exploit" + t.string "via_payload" + t.string "desc" + t.integer "port" + t.string "platform" + t.text "datastore" + t.datetime "opened_at", null: false t.datetime "closed_at" - t.string "close_reason" - t.integer "local_id" + t.string "close_reason" + t.integer "local_id" t.datetime "last_seen" - t.integer "module_run_id" + t.integer "module_run_id" + t.index ["module_run_id"], name: "index_sessions_on_module_run_id" end - add_index "sessions", ["module_run_id"], name: "index_sessions_on_module_run_id", using: :btree - - create_table "tags", force: :cascade do |t| - t.integer "user_id" - t.string "name", limit: 1024 - t.text "desc" - 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 - end - - create_table "task_creds", force: :cascade do |t| - t.integer "task_id", null: false - t.integer "cred_id", null: false + create_table "tags", id: :serial, force: :cascade do |t| + t.integer "user_id" + t.string "name", limit: 1024 + t.text "desc" + 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 end - create_table "task_hosts", force: :cascade do |t| - t.integer "task_id", null: false - t.integer "host_id", null: false + 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 end - create_table "task_services", force: :cascade do |t| - t.integer "task_id", null: false - t.integer "service_id", null: false + 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 end - create_table "task_sessions", force: :cascade do |t| - t.integer "task_id", null: false - t.integer "session_id", null: false + 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 end - create_table "tasks", force: :cascade do |t| - t.integer "workspace_id", default: 1, null: false - t.string "created_by" - t.string "module" + 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 + 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.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.text "result" - t.string "module_uuid", limit: 8 - t.binary "settings" + 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.text "result" + t.string "module_uuid", limit: 8 + t.binary "settings" end - create_table "users", force: :cascade do |t| - t.string "username" - 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.string "fullname" - t.string "email" - t.string "phone" - t.string "company" - t.string "prefs", limit: 524288 - t.boolean "admin", default: true, null: false + create_table "users", id: :serial, force: :cascade do |t| + t.string "username" + 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.string "fullname" + t.string "email" + t.string "phone" + t.string "company" + t.string "prefs", limit: 524288 + t.boolean "admin", default: true, null: false end - create_table "vuln_attempts", force: :cascade do |t| - t.integer "vuln_id" + create_table "vuln_attempts", id: :serial, force: :cascade do |t| + t.integer "vuln_id" t.datetime "attempted_at" - t.boolean "exploited" - t.string "fail_reason" - t.string "username" - t.text "module" - t.integer "session_id" - t.integer "loot_id" - t.text "fail_detail" + t.boolean "exploited" + t.string "fail_reason" + t.string "username" + t.text "module" + t.integer "session_id" + t.integer "loot_id" + t.text "fail_detail" end - create_table "vuln_details", force: :cascade do |t| - t.integer "vuln_id" - t.float "cvss_score" - t.string "cvss_vector" - t.string "title" - t.text "description" - t.text "solution" - t.binary "proof" - t.integer "nx_console_id" - t.integer "nx_device_id" - t.string "nx_vuln_id" - t.float "nx_severity" - t.float "nx_pci_severity" + create_table "vuln_details", id: :serial, force: :cascade do |t| + t.integer "vuln_id" + t.float "cvss_score" + t.string "cvss_vector" + t.string "title" + t.text "description" + t.text "solution" + t.binary "proof" + t.integer "nx_console_id" + t.integer "nx_device_id" + 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.text "nx_tags" - t.text "nx_vuln_status" - t.text "nx_proof_key" - t.string "src" - t.integer "nx_scan_id" + 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.string "nx_pci_compliance_status" + t.string "nx_pci_compliance_status" end - create_table "vulns", force: :cascade do |t| - t.integer "host_id" - t.integer "service_id" + create_table "vulns", id: :serial, force: :cascade do |t| + t.integer "host_id" + t.integer "service_id" t.datetime "created_at" - t.string "name" + t.string "name" t.datetime "updated_at" - t.string "info", limit: 65536 + t.string "info", limit: 65536 t.datetime "exploited_at" - t.integer "vuln_detail_count", default: 0 - t.integer "vuln_attempt_count", default: 0 - t.integer "origin_id" - t.string "origin_type" + t.integer "vuln_detail_count", default: 0 + t.integer "vuln_attempt_count", default: 0 + t.integer "origin_id" + t.string "origin_type" + t.index ["name"], name: "index_vulns_on_name" + t.index ["origin_id"], name: "index_vulns_on_origin_id" end - add_index "vulns", ["name"], name: "index_vulns_on_name", using: :btree - add_index "vulns", ["origin_id"], name: "index_vulns_on_origin_id", using: :btree - - create_table "vulns_refs", force: :cascade do |t| + create_table "vulns_refs", id: :serial, force: :cascade do |t| t.integer "ref_id" t.integer "vuln_id" end - create_table "web_forms", force: :cascade do |t| - t.integer "web_site_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "path" - t.string "method", limit: 1024 - t.text "params" - t.text "query" + 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.text "path" + t.string "method", limit: 1024 + t.text "params" + t.text "query" + t.index ["path"], name: "index_web_forms_on_path" end - add_index "web_forms", ["path"], name: "index_web_forms_on_path", using: :btree - - create_table "web_pages", force: :cascade do |t| - t.integer "web_site_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "path" - t.text "query" - t.integer "code", null: false - t.text "cookie" - t.text "auth" - t.text "ctype" + 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.text "path" + t.text "query" + t.integer "code", null: false + t.text "cookie" + t.text "auth" + t.text "ctype" t.datetime "mtime" - t.text "location" - t.text "headers" - t.binary "body" - t.binary "request" + t.text "location" + t.text "headers" + t.binary "body" + t.binary "request" + t.index ["path"], name: "index_web_pages_on_path" + t.index ["query"], name: "index_web_pages_on_query" end - add_index "web_pages", ["path"], name: "index_web_pages_on_path", using: :btree - add_index "web_pages", ["query"], name: "index_web_pages_on_query", using: :btree - - create_table "web_sites", force: :cascade do |t| - t.integer "service_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "vhost", limit: 2048 - t.text "comments" - t.text "options" + 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.string "vhost", limit: 2048 + t.text "comments" + t.text "options" + t.index ["comments"], name: "index_web_sites_on_comments" + t.index ["options"], name: "index_web_sites_on_options" + t.index ["vhost"], name: "index_web_sites_on_vhost" end - add_index "web_sites", ["comments"], name: "index_web_sites_on_comments", using: :btree - add_index "web_sites", ["options"], name: "index_web_sites_on_options", using: :btree - add_index "web_sites", ["vhost"], name: "index_web_sites_on_vhost", using: :btree - - create_table "web_vulns", force: :cascade do |t| - t.integer "web_site_id", null: false - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.text "path", null: false - t.string "method", limit: 1024, null: false - t.text "params" - t.text "pname" - t.integer "risk", null: false - t.string "name", limit: 1024, null: false - t.text "query" - t.text "category", null: false - t.integer "confidence", null: false - t.text "description" - t.text "blame" - t.binary "request" - t.binary "proof", null: false - t.string "owner" - t.text "payload" + 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.text "path", null: false + t.string "method", limit: 1024, null: false + t.text "params" + t.text "pname" + t.integer "risk", null: false + t.string "name", limit: 1024, null: false + t.text "query" + t.text "category", null: false + t.integer "confidence", null: false + t.text "description" + t.text "blame" + t.binary "request" + t.binary "proof", null: false + t.string "owner" + t.text "payload" + t.index ["method"], name: "index_web_vulns_on_method" + t.index ["name"], name: "index_web_vulns_on_name" + t.index ["path"], name: "index_web_vulns_on_path" end - add_index "web_vulns", ["method"], name: "index_web_vulns_on_method", using: :btree - add_index "web_vulns", ["name"], name: "index_web_vulns_on_name", using: :btree - add_index "web_vulns", ["path"], name: "index_web_vulns_on_path", using: :btree - - create_table "wmap_requests", force: :cascade do |t| - t.string "host" - t.inet "address" - t.integer "port" - t.integer "ssl" - t.string "meth", limit: 32 - t.text "path" - t.text "headers" - t.text "query" - t.text "body" - t.string "respcode", limit: 16 - t.text "resphead" - t.text "response" + create_table "wmap_requests", id: :serial, force: :cascade do |t| + t.string "host" + t.inet "address" + t.integer "port" + t.integer "ssl" + t.string "meth", limit: 32 + t.text "path" + t.text "headers" + t.text "query" + t.text "body" + t.string "respcode", limit: 16 + t.text "resphead" + t.text "response" t.datetime "created_at" t.datetime "updated_at" end - create_table "wmap_targets", force: :cascade do |t| - t.string "host" - t.inet "address" - t.integer "port" - t.integer "ssl" - t.integer "selected" + create_table "wmap_targets", id: :serial, force: :cascade do |t| + t.string "host" + t.inet "address" + t.integer "port" + t.integer "ssl" + t.integer "selected" t.datetime "created_at" t.datetime "updated_at" end create_table "workspace_members", id: false, force: :cascade do |t| t.integer "workspace_id", null: false - t.integer "user_id", null: false + t.integer "user_id", null: false end - create_table "workspaces", force: :cascade do |t| - t.string "name" - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.string "boundary", limit: 4096 - t.string "description", limit: 4096 - t.integer "owner_id" - t.boolean "limit_to_network", default: false, null: false - t.boolean "import_fingerprint", default: false + 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.string "boundary", limit: 4096 + t.string "description", limit: 4096 + t.integer "owner_id" + t.boolean "limit_to_network", default: false, null: false + t.boolean "import_fingerprint", default: false end end diff --git a/lib/metasploit/framework/credential.rb b/lib/metasploit/framework/credential.rb index 2c3d569a13..e21bba8d44 100644 --- a/lib/metasploit/framework/credential.rb +++ b/lib/metasploit/framework/credential.rb @@ -46,18 +46,18 @@ module Metasploit # If we have no public we MUST have a private (e.g. SNMP Community String) validates :private, exclusion: { in: [nil] }, - if: "public.nil? or paired" + if: -> { "public.nil? or paired" } # These values should be #demodularized from subclasses of # `Metasploit::Credential::Private` validates :private_type, inclusion: { in: [ :password, :ntlm_hash, :postgres_md5, :ssh_key ] }, - if: "private_type.present?" + if: -> { "private_type.present?" } # If we have no private we MUST have a public validates :public, presence: true, - if: "private.nil? or paired" + if: -> { "private.nil? or paired" } # @param attributes [Hash{Symbol => String,nil}] def initialize(attributes={}) diff --git a/lib/metasploit/framework/rails_version_constraint.rb b/lib/metasploit/framework/rails_version_constraint.rb index 488f8a0e52..a6ad345301 100644 --- a/lib/metasploit/framework/rails_version_constraint.rb +++ b/lib/metasploit/framework/rails_version_constraint.rb @@ -5,7 +5,7 @@ module Metasploit module RailsVersionConstraint # The Metasploit ecosystem is not yet ready for Rails 4.1: - RAILS_VERSION = '~> 4.2.6' + RAILS_VERSION = '~> 5.2.2' end end end diff --git a/lib/msf/core/db_manager/vuln.rb b/lib/msf/core/db_manager/vuln.rb index fc82a70ee7..89167a87ef 100644 --- a/lib/msf/core/db_manager/vuln.rb +++ b/lib/msf/core/db_manager/vuln.rb @@ -181,9 +181,9 @@ module Msf::DBManager::Vuln if not vuln and opts[:details_match] vuln = find_vuln_by_details(opts[:details_match], host, service) if vuln and service and not vuln.service - vuln.service = service + vuln.service = service + end end - end # No matches, so create a new vuln record unless vuln diff --git a/metasploit-framework.gemspec b/metasploit-framework.gemspec index 6ccc2a2b71..3c259869f4 100644 --- a/metasploit-framework.gemspec +++ b/metasploit-framework.gemspec @@ -61,14 +61,14 @@ Gem::Specification.new do |spec| # Metasm compiler/decompiler/assembler spec.add_runtime_dependency 'metasm' # Metasploit::Concern hooks - spec.add_runtime_dependency 'metasploit-concern', '~> 2.0.0' + spec.add_runtime_dependency 'metasploit-concern' # Metasploit::Credential database models - spec.add_runtime_dependency 'metasploit-credential', '~> 3.0.0' + spec.add_runtime_dependency 'metasploit-credential' # Database models shared between framework and Pro. - spec.add_runtime_dependency 'metasploit_data_models', '~> 3.0.10' + spec.add_runtime_dependency 'metasploit_data_models' # Things that would normally be part of the database model, but which # are needed when there's no database - spec.add_runtime_dependency 'metasploit-model', '~> 2.0.4' + spec.add_runtime_dependency 'metasploit-model' # Needed for Meterpreter spec.add_runtime_dependency 'metasploit-payloads', '1.4.4' # Needed for the next-generation POSIX Meterpreter @@ -88,7 +88,7 @@ Gem::Specification.new do |spec| # Used by the Metasploit data model, etc. # bound to 0.2x for Activerecord 4.2.8 deprecation warnings: # https://github.com/ged/ruby-pg/commit/c90ac644e861857ae75638eb6954b1cb49617090 - spec.add_runtime_dependency 'pg', '~> 0.20' + spec.add_runtime_dependency 'pg' # Run initializers for metasploit-concern, metasploit-credential, metasploit_data_models Rails::Engines spec.add_runtime_dependency 'railties' # required for OS fingerprinting