metasploit_data_models 0.16.1-java → 0.16.3-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Gemfile CHANGED
@@ -11,7 +11,9 @@ group :development, :test do
11
11
  # auto-load factories from spec/factories
12
12
  gem 'factory_girl_rails'
13
13
  # rails is only used for the dummy application in spec/dummy
14
- gem 'rails'
14
+ # restrict from rails 4.0 as it requires protected_attributes gem and other changes for compatibility
15
+ # @see https://www.pivotaltracker.com/story/show/52309083
16
+ gem 'rails', '>= 3.2', '< 4.0.0'
15
17
  end
16
18
 
17
19
  group :test do
@@ -9,7 +9,7 @@ class Mdm::NexposeConsole < ActiveRecord::Base
9
9
  # Validations
10
10
  #
11
11
 
12
- validates :address, :ip_format => true, :presence => true
12
+ validates :address, :presence => true
13
13
  validates :name, :presence => true
14
14
  validates :password, :presence => true
15
15
  validates :port, :numericality => { :only_integer => true }, :inclusion => {:in => 1..65535}
@@ -0,0 +1,30 @@
1
+ # Drops obsolete attachments_email_templates join table.
2
+ class DropAttachmentsEmailTemplates < ActiveRecord::Migration
3
+ #
4
+ # CONSTANTS
5
+ #
6
+
7
+ # Table being dropped.
8
+ TABLE_NAME = :attachments_email_templates
9
+
10
+ #
11
+ # Methods
12
+ #
13
+
14
+ # Recreates attachments_email_templates table
15
+ #
16
+ # @return [void]
17
+ def down
18
+ create_table TABLE_NAME, :id => false do |t|
19
+ t.references :attachment
20
+ t.references :email_template
21
+ end
22
+ end
23
+
24
+ # Drops attachmetns_email_templates table
25
+ #
26
+ # @return [void]
27
+ def up
28
+ drop_table TABLE_NAME
29
+ end
30
+ end
@@ -0,0 +1,46 @@
1
+ # Drops obsolete attachments table.
2
+ class DropAttachments < ActiveRecord::Migration
3
+ #
4
+ # CONSTANTS
5
+ #
6
+
7
+ # Table name
8
+ TABLE_NAME = :attachments
9
+
10
+
11
+ # Recreates attachments, but without data.
12
+ #
13
+ # @return [void]
14
+ def down
15
+ create_table TABLE_NAME do |t|
16
+ #
17
+ # Columns
18
+ #
19
+
20
+ t.binary :data
21
+ t.string :content_type,
22
+ :limit => 512
23
+ t.boolean :inline,
24
+ :default => true,
25
+ :null => false
26
+ t.string :name,
27
+ :limit => 512
28
+ t.boolean :zip,
29
+ :default => false,
30
+ :null => false
31
+
32
+ #
33
+ # Foreign Keys
34
+ #
35
+
36
+ t.references :campaign
37
+ end
38
+ end
39
+
40
+ # Drops attachments
41
+ #
42
+ # @return [void]
43
+ def up
44
+ drop_table TABLE_NAME
45
+ end
46
+ end
@@ -0,0 +1,49 @@
1
+ # Drops obsolete email_addresses.
2
+ class DropEmailAddresses < ActiveRecord::Migration
3
+ #
4
+ # CONSTANTS
5
+ #
6
+
7
+ # Table being dropped.
8
+ TABLE_NAME = :email_addresses
9
+
10
+ #
11
+ # Methods
12
+ #
13
+
14
+ # Recreates email_addresses, but does not restore data.
15
+ #
16
+ # @return [void]
17
+ def down
18
+ create_table TABLE_NAME do |t|
19
+ #
20
+ # Columns
21
+ #
22
+
23
+ t.string :address,
24
+ :limit => 512
25
+ t.datetime :clicked_at
26
+ t.string :first_name,
27
+ :limit => 512
28
+ t.string :last_name,
29
+ :limit => 512
30
+ t.boolean :sent,
31
+ :default => false,
32
+ :null => false
33
+
34
+ #
35
+ # Foreign Keys
36
+ #
37
+
38
+ t.references :campaign,
39
+ :null => false
40
+ end
41
+ end
42
+
43
+ # Drops email_addresses
44
+ #
45
+ # @return [void]
46
+ def up
47
+ drop_table TABLE_NAME
48
+ end
49
+ end
@@ -0,0 +1,41 @@
1
+ # Drops email_templates table that used to back obsolete Mdm::EmailTemplate module for old-style campaigns.
2
+ class DropEmailTemplates < ActiveRecord::Migration
3
+ #
4
+ # CONSTANTS
5
+ #
6
+
7
+ # Table being dropped.
8
+ TABLE_NAME = :email_templates
9
+
10
+ # Recreates email_templates, but does not restore data.
11
+ #
12
+ # @return [void]
13
+ def down
14
+ create_table TABLE_NAME do |t|
15
+ #
16
+ # Columns
17
+ #
18
+
19
+ t.text :body
20
+ t.string :name,
21
+ :limit => 512
22
+ t.text :prefs
23
+ t.string :subject,
24
+ :limit => 1024
25
+
26
+ #
27
+ # Foreign Keys
28
+ #
29
+
30
+ t.references :parent
31
+ t.references :campaign
32
+ end
33
+ end
34
+
35
+ # Drops email_templates
36
+ #
37
+ # @return [void]
38
+ def up
39
+ drop_table TABLE_NAME
40
+ end
41
+ end
@@ -0,0 +1,41 @@
1
+ # Drops web_teamplates that was used with obsolete Mdm::WebTemplates model for old-style campaigns.
2
+ class DropWebTemplates < ActiveRecord::Migration
3
+ #
4
+ # CONSTANTS
5
+ #
6
+
7
+ # Table being dropped.
8
+ TABLE_NAME = :web_templates
9
+
10
+ # Recreates web_templates, but does not restore data.
11
+ #
12
+ # @return [void]
13
+ def down
14
+ create_table TABLE_NAME do |t|
15
+ #
16
+ # Columns
17
+ #
18
+
19
+ t.string :body,
20
+ :limit => 524288
21
+ t.string :name,
22
+ :limit => 512
23
+ t.text :prefs
24
+ t.string :title,
25
+ :limit => 512
26
+
27
+ #
28
+ # Foreign Keys
29
+ #
30
+
31
+ t.references :campaign
32
+ end
33
+ end
34
+
35
+ # Drops web_templates
36
+ #
37
+ # @return [void]
38
+ def up
39
+ drop_table TABLE_NAME
40
+ end
41
+ end
@@ -0,0 +1,45 @@
1
+ # Drop campaigns table for old-style campaigns
2
+ class DropCampaigns < ActiveRecord::Migration
3
+ #
4
+ # CONSTANTS
5
+ #
6
+
7
+ # Table being dropped
8
+ TABLE_NAME = :campaigns
9
+
10
+ # Recreates campaigns, but does not restore data.
11
+ #
12
+ # @return [void]
13
+ def down
14
+ create_table TABLE_NAME do |t|
15
+ #
16
+ # Columns
17
+ #
18
+
19
+ t.datetime :created_at,
20
+ :null => false
21
+ t.string :name,
22
+ :limit => 512
23
+ t.text :prefs
24
+ t.datetime :started_at
25
+ t.integer :status,
26
+ :default => 0
27
+ t.datetime :updated_at,
28
+ :null => false
29
+
30
+ #
31
+ # Foreign Keys
32
+ #
33
+
34
+ t.references :workspace,
35
+ :null => false
36
+ end
37
+ end
38
+
39
+ # Drop campaigns
40
+ #
41
+ # @return [void]
42
+ def up
43
+ drop_table TABLE_NAME
44
+ end
45
+ end
@@ -4,5 +4,5 @@ module MetasploitDataModels
4
4
  # metasploit-framework/data/sql/migrate to db/migrate in this project, not all models have specs that verify the
5
5
  # migrations (with have_db_column and have_db_index) and certain models may not be shared between metasploit-framework
6
6
  # and pro, so models may be removed in the future. Because of the unstable API the version should remain below 1.0.0
7
- VERSION = '0.16.1'
7
+ VERSION = '0.16.3'
8
8
  end
@@ -60,11 +60,6 @@ describe Mdm::NexposeConsole do
60
60
  ipv6_nexpose_console = FactoryGirl.build(:mdm_nexpose_console, :address => '2001:0db8:85a3:0000:0000:8a2e:0370:7334')
61
61
  ipv6_nexpose_console.should be_valid
62
62
  end
63
-
64
- it 'should not be valid for strings not conforming to IPv4 or IPv6' do
65
- invalid_nexpose_console = FactoryGirl.build(:mdm_nexpose_console, :address => '1234-fark')
66
- invalid_nexpose_console.should_not be_valid
67
- end
68
63
  end
69
64
 
70
65
  context 'port' do
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended to check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(:version => 20130604145732) do
14
+ ActiveRecord::Schema.define(:version => 20130619192506) do
15
15
 
16
16
  create_table "api_keys", :force => true do |t|
17
17
  t.text "token"
@@ -19,30 +19,6 @@ ActiveRecord::Schema.define(:version => 20130604145732) do
19
19
  t.datetime "updated_at", :null => false
20
20
  end
21
21
 
22
- create_table "attachments", :force => true do |t|
23
- t.string "name", :limit => 512
24
- t.binary "data"
25
- t.string "content_type", :limit => 512
26
- t.boolean "inline", :default => true, :null => false
27
- t.boolean "zip", :default => false, :null => false
28
- t.integer "campaign_id"
29
- end
30
-
31
- create_table "attachments_email_templates", :id => false, :force => true do |t|
32
- t.integer "attachment_id"
33
- t.integer "email_template_id"
34
- end
35
-
36
- create_table "campaigns", :force => true do |t|
37
- t.integer "workspace_id", :null => false
38
- t.string "name", :limit => 512
39
- t.text "prefs"
40
- t.integer "status", :default => 0
41
- t.datetime "started_at"
42
- t.datetime "created_at", :null => false
43
- t.datetime "updated_at", :null => false
44
- end
45
-
46
22
  create_table "clients", :force => true do |t|
47
23
  t.integer "host_id"
48
24
  t.datetime "created_at"
@@ -65,24 +41,6 @@ ActiveRecord::Schema.define(:version => 20130604145732) do
65
41
  t.string "source_type"
66
42
  end
67
43
 
68
- create_table "email_addresses", :force => true do |t|
69
- t.integer "campaign_id", :null => false
70
- t.string "first_name", :limit => 512
71
- t.string "last_name", :limit => 512
72
- t.string "address", :limit => 512
73
- t.boolean "sent", :default => false, :null => false
74
- t.datetime "clicked_at"
75
- end
76
-
77
- create_table "email_templates", :force => true do |t|
78
- t.string "name", :limit => 512
79
- t.string "subject", :limit => 1024
80
- t.text "body"
81
- t.integer "parent_id"
82
- t.integer "campaign_id"
83
- t.text "prefs"
84
- end
85
-
86
44
  create_table "events", :force => true do |t|
87
45
  t.integer "workspace_id"
88
46
  t.integer "host_id"
@@ -581,14 +539,6 @@ ActiveRecord::Schema.define(:version => 20130604145732) do
581
539
  add_index "web_sites", ["options"], :name => "index_web_sites_on_options"
582
540
  add_index "web_sites", ["vhost"], :name => "index_web_sites_on_vhost"
583
541
 
584
- create_table "web_templates", :force => true do |t|
585
- t.string "name", :limit => 512
586
- t.string "title", :limit => 512
587
- t.string "body", :limit => 524288
588
- t.integer "campaign_id"
589
- t.text "prefs"
590
- end
591
-
592
542
  create_table "web_vulns", :force => true do |t|
593
543
  t.integer "web_site_id", :null => false
594
544
  t.datetime "created_at", :null => false
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: metasploit_data_models
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.16.1
5
+ version: 0.16.3
6
6
  platform: java
7
7
  authors:
8
8
  - Samuel Huckins
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2013-06-04 00:00:00.000000000 Z
15
+ date: 2013-07-05 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: rake
@@ -335,6 +335,12 @@ files:
335
335
  - db/migrate/20130525212420_drop_table_imported_creds.rb
336
336
  - db/migrate/20130531144949_making_host_tags_a_real_ar_model.rb
337
337
  - db/migrate/20130604145732_create_task_sessions.rb
338
+ - db/migrate/20130619160512_drop_attachments_email_templates.rb
339
+ - db/migrate/20130619162051_drop_attachments.rb
340
+ - db/migrate/20130619185710_drop_email_addresses.rb
341
+ - db/migrate/20130619190652_drop_email_templates.rb
342
+ - db/migrate/20130619191802_drop_web_templates.rb
343
+ - db/migrate/20130619192506_drop_campaigns.rb
338
344
  - lib/mdm.rb
339
345
  - lib/mdm/host/operating_system_normalization.rb
340
346
  - lib/mdm/module.rb