Skip to content

Commit 1099084

Browse files
committed
Land rapid7#4761, enforce unique port number per service
2 parents ffa6550 + 62fbf81 commit 1099084

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

Gemfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ PATH
2222
tzinfo
2323
metasploit-framework-db (4.11.0.pre.dev)
2424
activerecord (>= 3.2.21, < 4.0.0)
25-
metasploit-credential (~> 0.13.19)
25+
metasploit-credential (~> 0.14.0)
2626
metasploit-framework (= 4.11.0.pre.dev)
27-
metasploit_data_models (~> 0.22.8)
27+
metasploit_data_models (~> 0.23.0)
2828
pg (>= 0.11)
2929
metasploit-framework-pcap (4.11.0.pre.dev)
3030
metasploit-framework (= 4.11.0.pre.dev)
@@ -112,18 +112,18 @@ GEM
112112
metasploit-concern (0.3.0)
113113
activesupport (~> 3.0, >= 3.0.0)
114114
railties (< 4.0.0)
115-
metasploit-credential (0.13.19)
115+
metasploit-credential (0.14.0)
116116
metasploit-concern (~> 0.3.0)
117117
metasploit-model (~> 0.29.0)
118-
metasploit_data_models (~> 0.22.8)
118+
metasploit_data_models (~> 0.23.0)
119119
pg
120120
railties (< 4.0.0)
121121
rubyntlm
122122
rubyzip (~> 1.1)
123123
metasploit-model (0.29.0)
124124
activesupport
125125
railties (< 4.0.0)
126-
metasploit_data_models (0.22.8)
126+
metasploit_data_models (0.23.0)
127127
activerecord (>= 3.2.13, < 4.0.0)
128128
activesupport
129129
arel-helpers

db/schema.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#
1212
# It's strongly recommended to check this file into your version control system.
1313

14-
ActiveRecord::Schema.define(:version => 20150205192745) do
14+
ActiveRecord::Schema.define(:version => 20150212214222) do
1515

1616
create_table "api_keys", :force => true do |t|
1717
t.text "token"
@@ -102,7 +102,7 @@
102102

103103
create_table "hosts", :force => true do |t|
104104
t.datetime "created_at"
105-
t.string "address", :limit => nil, :null => false
105+
t.string "address", :null => false
106106
t.string "mac"
107107
t.string "comm"
108108
t.string "name"
@@ -454,6 +454,7 @@
454454
t.text "info"
455455
end
456456

457+
add_index "services", ["host_id", "port", "proto"], :name => "index_services_on_host_id_and_port_and_proto", :unique => true
457458
add_index "services", ["name"], :name => "index_services_on_name"
458459
add_index "services", ["port"], :name => "index_services_on_port"
459460
add_index "services", ["proto"], :name => "index_services_on_proto"
@@ -685,7 +686,7 @@
685686

686687
create_table "wmap_requests", :force => true do |t|
687688
t.string "host"
688-
t.string "address", :limit => nil
689+
t.string "address"
689690
t.integer "port"
690691
t.integer "ssl"
691692
t.string "meth", :limit => 32
@@ -702,7 +703,7 @@
702703

703704
create_table "wmap_targets", :force => true do |t|
704705
t.string "host"
705-
t.string "address", :limit => nil
706+
t.string "address"
706707
t.integer "port"
707708
t.integer "ssl"
708709
t.integer "selected"

metasploit-framework-db.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Gem::Specification.new do |spec|
2929

3030
spec.add_runtime_dependency 'activerecord', *Metasploit::Framework::RailsVersionConstraint::RAILS_VERSION
3131
# Metasploit::Credential database models
32-
spec.add_runtime_dependency 'metasploit-credential', '~> 0.13.19'
32+
spec.add_runtime_dependency 'metasploit-credential', '~> 0.14.0'
3333
# Database models shared between framework and Pro.
34-
spec.add_runtime_dependency 'metasploit_data_models', '~> 0.22.8'
34+
spec.add_runtime_dependency 'metasploit_data_models', '~> 0.23.0'
3535
# depend on metasploit-framewrok as the optional gems are useless with the actual code
3636
spec.add_runtime_dependency 'metasploit-framework', "= #{spec.version}"
3737
# Needed for module caching in Mdm::ModuleDetails

0 commit comments

Comments
 (0)