metasploit_data_models 0.6.13

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.
Files changed (211) hide show
  1. data/.gitignore +24 -0
  2. data/.rspec +3 -0
  3. data/.simplecov +38 -0
  4. data/.yardopts +4 -0
  5. data/Gemfile +27 -0
  6. data/LICENSE +27 -0
  7. data/README.md +72 -0
  8. data/Rakefile +53 -0
  9. data/app/models/mdm/api_key.rb +20 -0
  10. data/app/models/mdm/client.rb +9 -0
  11. data/app/models/mdm/cred.rb +80 -0
  12. data/app/models/mdm/event.rb +30 -0
  13. data/app/models/mdm/exploit_attempt.rb +14 -0
  14. data/app/models/mdm/exploited_host.rb +11 -0
  15. data/app/models/mdm/host.rb +134 -0
  16. data/app/models/mdm/host_detail.rb +15 -0
  17. data/app/models/mdm/host_tag.rb +13 -0
  18. data/app/models/mdm/imported_cred.rb +10 -0
  19. data/app/models/mdm/listener.rb +24 -0
  20. data/app/models/mdm/loot.rb +63 -0
  21. data/app/models/mdm/macro.rb +20 -0
  22. data/app/models/mdm/mod_ref.rb +3 -0
  23. data/app/models/mdm/module_action.rb +24 -0
  24. data/app/models/mdm/module_arch.rb +24 -0
  25. data/app/models/mdm/module_author.rb +25 -0
  26. data/app/models/mdm/module_detail.rb +59 -0
  27. data/app/models/mdm/module_mixin.rb +24 -0
  28. data/app/models/mdm/module_platform.rb +24 -0
  29. data/app/models/mdm/module_ref.rb +24 -0
  30. data/app/models/mdm/module_target.rb +26 -0
  31. data/app/models/mdm/nexpose_console.rb +20 -0
  32. data/app/models/mdm/note.rb +49 -0
  33. data/app/models/mdm/profile.rb +9 -0
  34. data/app/models/mdm/ref.rb +14 -0
  35. data/app/models/mdm/report.rb +50 -0
  36. data/app/models/mdm/report_template.rb +27 -0
  37. data/app/models/mdm/route.rb +9 -0
  38. data/app/models/mdm/service.rb +56 -0
  39. data/app/models/mdm/session.rb +48 -0
  40. data/app/models/mdm/session_event.rb +9 -0
  41. data/app/models/mdm/tag.rb +46 -0
  42. data/app/models/mdm/task.rb +41 -0
  43. data/app/models/mdm/user.rb +25 -0
  44. data/app/models/mdm/vuln.rb +60 -0
  45. data/app/models/mdm/vuln_attempt.rb +15 -0
  46. data/app/models/mdm/vuln_detail.rb +14 -0
  47. data/app/models/mdm/vuln_ref.rb +13 -0
  48. data/app/models/mdm/web_form.rb +16 -0
  49. data/app/models/mdm/web_page.rb +16 -0
  50. data/app/models/mdm/web_site.rb +47 -0
  51. data/app/models/mdm/web_vuln.rb +190 -0
  52. data/app/models/mdm/wmap_request.rb +3 -0
  53. data/app/models/mdm/wmap_target.rb +3 -0
  54. data/app/models/mdm/workspace.rb +196 -0
  55. data/bin/mdm_console +68 -0
  56. data/console_db.yml +9 -0
  57. data/db/migrate/000_create_tables.rb +79 -0
  58. data/db/migrate/001_add_wmap_tables.rb +35 -0
  59. data/db/migrate/002_add_workspaces.rb +36 -0
  60. data/db/migrate/003_move_notes.rb +20 -0
  61. data/db/migrate/004_add_events_table.rb +16 -0
  62. data/db/migrate/005_expand_info.rb +58 -0
  63. data/db/migrate/006_add_timestamps.rb +26 -0
  64. data/db/migrate/007_add_loots.rb +20 -0
  65. data/db/migrate/008_create_users.rb +16 -0
  66. data/db/migrate/009_add_loots_ctype.rb +10 -0
  67. data/db/migrate/010_add_alert_fields.rb +16 -0
  68. data/db/migrate/011_add_reports.rb +19 -0
  69. data/db/migrate/012_add_tasks.rb +24 -0
  70. data/db/migrate/013_add_tasks_result.rb +10 -0
  71. data/db/migrate/014_add_loots_fields.rb +12 -0
  72. data/db/migrate/015_rename_user.rb +16 -0
  73. data/db/migrate/016_add_host_purpose.rb +10 -0
  74. data/db/migrate/017_expand_info2.rb +58 -0
  75. data/db/migrate/018_add_workspace_user_info.rb +29 -0
  76. data/db/migrate/019_add_workspace_desc.rb +23 -0
  77. data/db/migrate/020_add_user_preferences.rb +11 -0
  78. data/db/migrate/021_standardize_info_and_data.rb +18 -0
  79. data/db/migrate/022_enlarge_event_info.rb +10 -0
  80. data/db/migrate/023_add_report_downloaded_at.rb +10 -0
  81. data/db/migrate/024_convert_service_info_to_text.rb +12 -0
  82. data/db/migrate/025_add_user_admin.rb +19 -0
  83. data/db/migrate/026_add_creds_table.rb +19 -0
  84. data/db/migrate/20100819123300_migrate_cred_data.rb +154 -0
  85. data/db/migrate/20100824151500_add_exploited_table.rb +16 -0
  86. data/db/migrate/20100908001428_add_owner_to_workspaces.rb +9 -0
  87. data/db/migrate/20100911122000_add_report_templates.rb +18 -0
  88. data/db/migrate/20100916151530_require_admin_flag.rb +15 -0
  89. data/db/migrate/20100916175000_add_campaigns_and_templates.rb +61 -0
  90. data/db/migrate/20100920012100_add_generate_exe_column.rb +8 -0
  91. data/db/migrate/20100926214000_add_template_prefs.rb +11 -0
  92. data/db/migrate/20101001000000_add_web_tables.rb +57 -0
  93. data/db/migrate/20101002000000_add_query.rb +10 -0
  94. data/db/migrate/20101007000000_add_vuln_info.rb +15 -0
  95. data/db/migrate/20101008111800_add_clients_to_campaigns.rb +10 -0
  96. data/db/migrate/20101009023300_add_campaign_attachments.rb +15 -0
  97. data/db/migrate/20101104135100_add_imported_creds.rb +17 -0
  98. data/db/migrate/20101203000000_fix_web_tables.rb +34 -0
  99. data/db/migrate/20101203000001_expand_host_comment.rb +12 -0
  100. data/db/migrate/20101206212033_add_limit_to_network_to_workspaces.rb +9 -0
  101. data/db/migrate/20110112154300_add_module_uuid_to_tasks.rb +9 -0
  102. data/db/migrate/20110204112800_add_host_tags.rb +28 -0
  103. data/db/migrate/20110317144932_add_session_table.rb +110 -0
  104. data/db/migrate/20110414180600_add_local_id_to_session_table.rb +11 -0
  105. data/db/migrate/20110415175705_add_routes_table.rb +18 -0
  106. data/db/migrate/20110422000000_convert_binary.rb +72 -0
  107. data/db/migrate/20110425095900_add_last_seen_to_sessions.rb +8 -0
  108. data/db/migrate/20110513143900_track_successful_exploits.rb +31 -0
  109. data/db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb +26 -0
  110. data/db/migrate/20110527000000_add_task_id_to_reports_table.rb +11 -0
  111. data/db/migrate/20110527000001_add_api_keys_table.rb +12 -0
  112. data/db/migrate/20110606000001_add_macros_table.rb +16 -0
  113. data/db/migrate/20110622000000_add_settings_to_tasks_table.rb +12 -0
  114. data/db/migrate/20110624000001_add_listeners_table.rb +19 -0
  115. data/db/migrate/20110625000001_add_macro_to_listeners_table.rb +12 -0
  116. data/db/migrate/20110630000001_add_nexpose_consoles_table.rb +21 -0
  117. data/db/migrate/20110630000002_add_name_to_nexpose_consoles_table.rb +12 -0
  118. data/db/migrate/20110717000001_add_profiles_table.rb +15 -0
  119. data/db/migrate/20110727163801_expand_cred_ptype_column.rb +9 -0
  120. data/db/migrate/20110730000001_add_initial_indexes.rb +85 -0
  121. data/db/migrate/20110812000001_prune_indexes.rb +23 -0
  122. data/db/migrate/20110922000000_expand_notes.rb +9 -0
  123. data/db/migrate/20110928101300_add_mod_ref_table.rb +17 -0
  124. data/db/migrate/20111011110000_add_display_name_to_reports_table.rb +24 -0
  125. data/db/migrate/20111203000000_inet_columns.rb +13 -0
  126. data/db/migrate/20111204000000_more_inet_columns.rb +17 -0
  127. data/db/migrate/20111210000000_add_scope_to_hosts.rb +9 -0
  128. data/db/migrate/20120126110000_add_virtual_host_to_hosts.rb +9 -0
  129. data/db/migrate/20120411173220_rename_workspace_members.rb +9 -0
  130. data/db/migrate/20120601152442_add_counter_caches_to_hosts.rb +21 -0
  131. data/db/migrate/20120625000000_add_vuln_details.rb +34 -0
  132. data/db/migrate/20120625000001_add_host_details.rb +16 -0
  133. data/db/migrate/20120625000002_expand_details.rb +16 -0
  134. data/db/migrate/20120625000003_expand_details2.rb +24 -0
  135. data/db/migrate/20120625000004_add_vuln_attempts.rb +19 -0
  136. data/db/migrate/20120625000005_add_vuln_and_host_counter_caches.rb +14 -0
  137. data/db/migrate/20120625000006_add_module_details.rb +118 -0
  138. data/db/migrate/20120625000007_add_exploit_attempts.rb +26 -0
  139. data/db/migrate/20120625000008_add_fail_message.rb +12 -0
  140. data/db/migrate/20120718202805_add_owner_and_payload_to_web_vulns.rb +13 -0
  141. data/db/migrate/20130228214900_change_required_columns_to_null_false_in_web_vulns.rb +35 -0
  142. data/lib/mdm.rb +12 -0
  143. data/lib/mdm/host/operating_system_normalization.rb +984 -0
  144. data/lib/metasploit_data_models.rb +60 -0
  145. data/lib/metasploit_data_models/base64_serializer.rb +103 -0
  146. data/lib/metasploit_data_models/engine.rb +23 -0
  147. data/lib/metasploit_data_models/serialized_prefs.rb +23 -0
  148. data/lib/metasploit_data_models/validators/ip_format_validator.rb +13 -0
  149. data/lib/metasploit_data_models/validators/password_is_strong_validator.rb +70 -0
  150. data/lib/metasploit_data_models/version.rb +8 -0
  151. data/lib/tasks/yard.rake +26 -0
  152. data/metasploit_data_models.gemspec +31 -0
  153. data/script/rails +8 -0
  154. data/spec/app/models/mdm/module_action_spec.rb +38 -0
  155. data/spec/app/models/mdm/module_arch_spec.rb +38 -0
  156. data/spec/app/models/mdm/module_author_spec.rb +50 -0
  157. data/spec/app/models/mdm/module_detail_spec.rb +291 -0
  158. data/spec/app/models/mdm/module_mixin_spec.rb +38 -0
  159. data/spec/app/models/mdm/module_platform_spec.rb +38 -0
  160. data/spec/app/models/mdm/module_ref_spec.rb +38 -0
  161. data/spec/app/models/mdm/module_target_spec.rb +41 -0
  162. data/spec/app/models/mdm/web_vuln_spec.rb +126 -0
  163. data/spec/dummy/Rakefile +7 -0
  164. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  165. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  166. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  167. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  168. data/spec/dummy/app/mailers/.gitkeep +0 -0
  169. data/spec/dummy/app/models/.gitkeep +0 -0
  170. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  171. data/spec/dummy/config.ru +4 -0
  172. data/spec/dummy/config/application.rb +61 -0
  173. data/spec/dummy/config/boot.rb +10 -0
  174. data/spec/dummy/config/database.yml.example +22 -0
  175. data/spec/dummy/config/environment.rb +5 -0
  176. data/spec/dummy/config/environments/development.rb +37 -0
  177. data/spec/dummy/config/environments/production.rb +67 -0
  178. data/spec/dummy/config/environments/test.rb +37 -0
  179. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  180. data/spec/dummy/config/initializers/inflections.rb +15 -0
  181. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  182. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  183. data/spec/dummy/config/initializers/session_store.rb +8 -0
  184. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  185. data/spec/dummy/config/routes.rb +2 -0
  186. data/spec/dummy/db/schema.rb +638 -0
  187. data/spec/dummy/lib/assets/.gitkeep +0 -0
  188. data/spec/dummy/log/.gitkeep +0 -0
  189. data/spec/dummy/public/404.html +26 -0
  190. data/spec/dummy/public/422.html +26 -0
  191. data/spec/dummy/public/500.html +25 -0
  192. data/spec/dummy/public/favicon.ico +0 -0
  193. data/spec/dummy/script/rails +6 -0
  194. data/spec/factories/mdm/addresses.rb +7 -0
  195. data/spec/factories/mdm/hosts.rb +18 -0
  196. data/spec/factories/mdm/module_actions.rb +14 -0
  197. data/spec/factories/mdm/module_archs.rb +14 -0
  198. data/spec/factories/mdm/module_authors.rb +22 -0
  199. data/spec/factories/mdm/module_details.rb +9 -0
  200. data/spec/factories/mdm/module_mixins.rb +14 -0
  201. data/spec/factories/mdm/module_platforms.rb +14 -0
  202. data/spec/factories/mdm/module_refs.rb +14 -0
  203. data/spec/factories/mdm/module_targets.rb +19 -0
  204. data/spec/factories/mdm/services.rb +35 -0
  205. data/spec/factories/mdm/users.rb +22 -0
  206. data/spec/factories/mdm/web_sites.rb +8 -0
  207. data/spec/factories/mdm/web_vulns.rb +64 -0
  208. data/spec/factories/mdm/workspaces.rb +23 -0
  209. data/spec/lib/base64_serializer_spec.rb +174 -0
  210. data/spec/spec_helper.rb +36 -0
  211. metadata +433 -0
@@ -0,0 +1,37 @@
1
+ Dummy::Application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Configure static asset server for tests with Cache-Control for performance
11
+ config.serve_static_assets = true
12
+ config.static_cache_control = "public, max-age=3600"
13
+
14
+ # Log error messages when you accidentally call methods on nil
15
+ config.whiny_nils = true
16
+
17
+ # Show full error reports and disable caching
18
+ config.consider_all_requests_local = true
19
+ config.action_controller.perform_caching = false
20
+
21
+ # Raise exceptions instead of rendering exception templates
22
+ config.action_dispatch.show_exceptions = false
23
+
24
+ # Disable request forgery protection in test environment
25
+ config.action_controller.allow_forgery_protection = false
26
+
27
+ # Tell Action Mailer not to deliver emails to the real world.
28
+ # The :test delivery method accumulates sent emails in the
29
+ # ActionMailer::Base.deliveries array.
30
+ config.action_mailer.delivery_method = :test
31
+
32
+ # Raise exception on mass assignment protection for Active Record models
33
+ config.active_record.mass_assignment_sanitizer = :strict
34
+
35
+ # Print deprecation notices to the stderr
36
+ config.active_support.deprecation = :stderr
37
+ end
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,15 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format
4
+ # (all these examples are active by default):
5
+ # ActiveSupport::Inflector.inflections do |inflect|
6
+ # inflect.plural /^(ox)$/i, '\1en'
7
+ # inflect.singular /^(ox)en/i, '\1'
8
+ # inflect.irregular 'person', 'people'
9
+ # inflect.uncountable %w( fish sheep )
10
+ # end
11
+ #
12
+ # These inflection rules are supported but not enabled by default:
13
+ # ActiveSupport::Inflector.inflections do |inflect|
14
+ # inflect.acronym 'RESTful'
15
+ # end
@@ -0,0 +1,5 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
5
+ # Mime::Type.register_alias "text/html", :iphone
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Your secret key for verifying the integrity of signed cookies.
4
+ # If you change this key, all old signed cookies will become invalid!
5
+ # Make sure the secret is at least 30 characters and all random,
6
+ # no regular words or you'll be exposed to dictionary attacks.
7
+ Dummy::Application.config.secret_token = 'f04f565f9a4db0f0af88f4bd8b79952d139b02434b889a7c7bb3fe83405e9032409bd16bca7b0d7d68a8b119b6ddfd31b17d19155cd699a27e19a48bd05eb200'
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
4
+
5
+ # Use the database for sessions instead of the cookie-based default,
6
+ # which shouldn't be used to store highly confidential information
7
+ # (create the session table with "rails generate session_migration")
8
+ # Dummy::Application.config.session_store :active_record_store
@@ -0,0 +1,14 @@
1
+ # Be sure to restart your server when you modify this file.
2
+ #
3
+ # This file contains settings for ActionController::ParamsWrapper which
4
+ # is enabled by default.
5
+
6
+ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
+ ActiveSupport.on_load(:action_controller) do
8
+ wrap_parameters format: [:json]
9
+ end
10
+
11
+ # Disable root element in JSON by default.
12
+ ActiveSupport.on_load(:active_record) do
13
+ self.include_root_in_json = false
14
+ end
@@ -0,0 +1,2 @@
1
+ Rails.application.routes.draw do
2
+ end
@@ -0,0 +1,638 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20130228214900) do
15
+
16
+ create_table "api_keys", :force => true do |t|
17
+ t.text "token"
18
+ t.datetime "created_at", :null => false
19
+ t.datetime "updated_at", :null => false
20
+ end
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
+ create_table "clients", :force => true do |t|
47
+ t.integer "host_id"
48
+ t.datetime "created_at"
49
+ t.string "ua_string", :limit => 1024, :null => false
50
+ t.string "ua_name", :limit => 64
51
+ t.string "ua_ver", :limit => 32
52
+ t.datetime "updated_at"
53
+ t.integer "campaign_id"
54
+ end
55
+
56
+ create_table "creds", :force => true do |t|
57
+ t.integer "service_id", :null => false
58
+ t.datetime "created_at", :null => false
59
+ t.datetime "updated_at", :null => false
60
+ t.string "user", :limit => 2048
61
+ t.string "pass", :limit => 4096
62
+ t.boolean "active", :default => true
63
+ t.string "proof", :limit => 4096
64
+ t.string "ptype", :limit => 256
65
+ t.integer "source_id"
66
+ t.string "source_type"
67
+ end
68
+
69
+ create_table "email_addresses", :force => true do |t|
70
+ t.integer "campaign_id", :null => false
71
+ t.string "first_name", :limit => 512
72
+ t.string "last_name", :limit => 512
73
+ t.string "address", :limit => 512
74
+ t.boolean "sent", :default => false, :null => false
75
+ t.datetime "clicked_at"
76
+ end
77
+
78
+ create_table "email_templates", :force => true do |t|
79
+ t.string "name", :limit => 512
80
+ t.string "subject", :limit => 1024
81
+ t.text "body"
82
+ t.integer "parent_id"
83
+ t.integer "campaign_id"
84
+ t.text "prefs"
85
+ end
86
+
87
+ create_table "events", :force => true do |t|
88
+ t.integer "workspace_id"
89
+ t.integer "host_id"
90
+ t.datetime "created_at"
91
+ t.string "name"
92
+ t.datetime "updated_at"
93
+ t.boolean "critical"
94
+ t.boolean "seen"
95
+ t.string "username"
96
+ t.text "info"
97
+ end
98
+
99
+ create_table "exploit_attempts", :force => true do |t|
100
+ t.integer "host_id"
101
+ t.integer "service_id"
102
+ t.integer "vuln_id"
103
+ t.datetime "attempted_at"
104
+ t.boolean "exploited"
105
+ t.string "fail_reason"
106
+ t.string "username"
107
+ t.text "module"
108
+ t.integer "session_id"
109
+ t.integer "loot_id"
110
+ t.integer "port"
111
+ t.string "proto"
112
+ t.text "fail_detail"
113
+ end
114
+
115
+ create_table "exploited_hosts", :force => true do |t|
116
+ t.integer "host_id", :null => false
117
+ t.integer "service_id"
118
+ t.string "session_uuid", :limit => 8
119
+ t.string "name", :limit => 2048
120
+ t.string "payload", :limit => 2048
121
+ t.datetime "created_at", :null => false
122
+ t.datetime "updated_at", :null => false
123
+ end
124
+
125
+ create_table "host_details", :force => true do |t|
126
+ t.integer "host_id"
127
+ t.integer "nx_console_id"
128
+ t.integer "nx_device_id"
129
+ t.string "src"
130
+ t.string "nx_site_name"
131
+ t.string "nx_site_importance"
132
+ t.string "nx_scan_template"
133
+ t.float "nx_risk_score"
134
+ end
135
+
136
+ create_table "hosts", :force => true do |t|
137
+ t.datetime "created_at"
138
+ t.string "address", :limit => nil
139
+ t.string "mac"
140
+ t.string "comm"
141
+ t.string "name"
142
+ t.string "state"
143
+ t.string "os_name"
144
+ t.string "os_flavor"
145
+ t.string "os_sp"
146
+ t.string "os_lang"
147
+ t.string "arch"
148
+ t.integer "workspace_id"
149
+ t.datetime "updated_at"
150
+ t.text "purpose"
151
+ t.string "info", :limit => 65536
152
+ t.text "comments"
153
+ t.text "scope"
154
+ t.text "virtual_host"
155
+ t.integer "note_count", :default => 0
156
+ t.integer "vuln_count", :default => 0
157
+ t.integer "service_count", :default => 0
158
+ t.integer "host_detail_count", :default => 0
159
+ t.integer "exploit_attempt_count", :default => 0
160
+ end
161
+
162
+ add_index "hosts", ["address"], :name => "index_hosts_on_address"
163
+ add_index "hosts", ["name"], :name => "index_hosts_on_name"
164
+ add_index "hosts", ["os_flavor"], :name => "index_hosts_on_os_flavor"
165
+ add_index "hosts", ["os_name"], :name => "index_hosts_on_os_name"
166
+ add_index "hosts", ["purpose"], :name => "index_hosts_on_purpose"
167
+ add_index "hosts", ["state"], :name => "index_hosts_on_state"
168
+
169
+ create_table "hosts_tags", :id => false, :force => true do |t|
170
+ t.integer "host_id"
171
+ t.integer "tag_id"
172
+ end
173
+
174
+ create_table "imported_creds", :force => true do |t|
175
+ t.integer "workspace_id", :default => 1, :null => false
176
+ t.string "user", :limit => 512
177
+ t.string "pass", :limit => 512
178
+ t.string "ptype", :limit => 16, :default => "password"
179
+ end
180
+
181
+ create_table "listeners", :force => true do |t|
182
+ t.datetime "created_at", :null => false
183
+ t.datetime "updated_at", :null => false
184
+ t.integer "workspace_id", :default => 1, :null => false
185
+ t.integer "task_id"
186
+ t.boolean "enabled", :default => true
187
+ t.text "owner"
188
+ t.text "payload"
189
+ t.text "address"
190
+ t.integer "port"
191
+ t.binary "options"
192
+ t.text "macro"
193
+ end
194
+
195
+ create_table "loots", :force => true do |t|
196
+ t.integer "workspace_id", :default => 1, :null => false
197
+ t.integer "host_id"
198
+ t.integer "service_id"
199
+ t.string "ltype", :limit => 512
200
+ t.string "path", :limit => 1024
201
+ t.text "data"
202
+ t.datetime "created_at", :null => false
203
+ t.datetime "updated_at", :null => false
204
+ t.string "content_type"
205
+ t.text "name"
206
+ t.text "info"
207
+ end
208
+
209
+ create_table "macros", :force => true do |t|
210
+ t.datetime "created_at", :null => false
211
+ t.datetime "updated_at", :null => false
212
+ t.text "owner"
213
+ t.text "name"
214
+ t.text "description"
215
+ t.binary "actions"
216
+ t.binary "prefs"
217
+ end
218
+
219
+ create_table "mod_refs", :force => true do |t|
220
+ t.string "module", :limit => 1024
221
+ t.string "mtype", :limit => 128
222
+ t.text "ref"
223
+ end
224
+
225
+ create_table "module_actions", :force => true do |t|
226
+ t.integer "module_detail_id"
227
+ t.text "name"
228
+ end
229
+
230
+ add_index "module_actions", ["module_detail_id"], :name => "index_module_actions_on_module_detail_id"
231
+
232
+ create_table "module_archs", :force => true do |t|
233
+ t.integer "module_detail_id"
234
+ t.text "name"
235
+ end
236
+
237
+ add_index "module_archs", ["module_detail_id"], :name => "index_module_archs_on_module_detail_id"
238
+
239
+ create_table "module_authors", :force => true do |t|
240
+ t.integer "module_detail_id"
241
+ t.text "name"
242
+ t.text "email"
243
+ end
244
+
245
+ add_index "module_authors", ["module_detail_id"], :name => "index_module_authors_on_module_detail_id"
246
+
247
+ create_table "module_details", :force => true do |t|
248
+ t.datetime "mtime"
249
+ t.text "file"
250
+ t.string "mtype"
251
+ t.text "refname"
252
+ t.text "fullname"
253
+ t.text "name"
254
+ t.integer "rank"
255
+ t.text "description"
256
+ t.string "license"
257
+ t.boolean "privileged"
258
+ t.datetime "disclosure_date"
259
+ t.integer "default_target"
260
+ t.text "default_action"
261
+ t.string "stance"
262
+ t.boolean "ready"
263
+ end
264
+
265
+ add_index "module_details", ["description"], :name => "index_module_details_on_description"
266
+ add_index "module_details", ["mtype"], :name => "index_module_details_on_mtype"
267
+ add_index "module_details", ["name"], :name => "index_module_details_on_name"
268
+ add_index "module_details", ["refname"], :name => "index_module_details_on_refname"
269
+
270
+ create_table "module_mixins", :force => true do |t|
271
+ t.integer "module_detail_id"
272
+ t.text "name"
273
+ end
274
+
275
+ add_index "module_mixins", ["module_detail_id"], :name => "index_module_mixins_on_module_detail_id"
276
+
277
+ create_table "module_platforms", :force => true do |t|
278
+ t.integer "module_detail_id"
279
+ t.text "name"
280
+ end
281
+
282
+ add_index "module_platforms", ["module_detail_id"], :name => "index_module_platforms_on_module_detail_id"
283
+
284
+ create_table "module_refs", :force => true do |t|
285
+ t.integer "module_detail_id"
286
+ t.text "name"
287
+ end
288
+
289
+ add_index "module_refs", ["module_detail_id"], :name => "index_module_refs_on_module_detail_id"
290
+ add_index "module_refs", ["name"], :name => "index_module_refs_on_name"
291
+
292
+ create_table "module_targets", :force => true do |t|
293
+ t.integer "module_detail_id"
294
+ t.integer "index"
295
+ t.text "name"
296
+ end
297
+
298
+ add_index "module_targets", ["module_detail_id"], :name => "index_module_targets_on_module_detail_id"
299
+
300
+ create_table "nexpose_consoles", :force => true do |t|
301
+ t.datetime "created_at", :null => false
302
+ t.datetime "updated_at", :null => false
303
+ t.boolean "enabled", :default => true
304
+ t.text "owner"
305
+ t.text "address"
306
+ t.integer "port", :default => 3780
307
+ t.text "username"
308
+ t.text "password"
309
+ t.text "status"
310
+ t.text "version"
311
+ t.text "cert"
312
+ t.binary "cached_sites"
313
+ t.text "name"
314
+ end
315
+
316
+ create_table "notes", :force => true do |t|
317
+ t.datetime "created_at"
318
+ t.string "ntype", :limit => 512
319
+ t.integer "workspace_id", :default => 1, :null => false
320
+ t.integer "service_id"
321
+ t.integer "host_id"
322
+ t.datetime "updated_at"
323
+ t.boolean "critical"
324
+ t.boolean "seen"
325
+ t.text "data"
326
+ end
327
+
328
+ add_index "notes", ["ntype"], :name => "index_notes_on_ntype"
329
+
330
+ create_table "profiles", :force => true do |t|
331
+ t.datetime "created_at", :null => false
332
+ t.datetime "updated_at", :null => false
333
+ t.boolean "active", :default => true
334
+ t.text "name"
335
+ t.text "owner"
336
+ t.binary "settings"
337
+ end
338
+
339
+ create_table "refs", :force => true do |t|
340
+ t.integer "ref_id"
341
+ t.datetime "created_at"
342
+ t.string "name", :limit => 512
343
+ t.datetime "updated_at"
344
+ end
345
+
346
+ add_index "refs", ["name"], :name => "index_refs_on_name"
347
+
348
+ create_table "report_templates", :force => true do |t|
349
+ t.integer "workspace_id", :default => 1, :null => false
350
+ t.string "created_by"
351
+ t.string "path", :limit => 1024
352
+ t.text "name"
353
+ t.datetime "created_at", :null => false
354
+ t.datetime "updated_at", :null => false
355
+ end
356
+
357
+ create_table "reports", :force => true do |t|
358
+ t.integer "workspace_id", :default => 1, :null => false
359
+ t.string "created_by"
360
+ t.string "rtype"
361
+ t.string "path", :limit => 1024
362
+ t.text "options"
363
+ t.datetime "created_at", :null => false
364
+ t.datetime "updated_at", :null => false
365
+ t.datetime "downloaded_at"
366
+ t.integer "task_id"
367
+ t.string "name", :limit => 63
368
+ end
369
+
370
+ create_table "routes", :force => true do |t|
371
+ t.integer "session_id"
372
+ t.string "subnet"
373
+ t.string "netmask"
374
+ end
375
+
376
+ create_table "services", :force => true do |t|
377
+ t.integer "host_id"
378
+ t.datetime "created_at"
379
+ t.integer "port", :null => false
380
+ t.string "proto", :limit => 16, :null => false
381
+ t.string "state"
382
+ t.string "name"
383
+ t.datetime "updated_at"
384
+ t.text "info"
385
+ end
386
+
387
+ add_index "services", ["name"], :name => "index_services_on_name"
388
+ add_index "services", ["port"], :name => "index_services_on_port"
389
+ add_index "services", ["proto"], :name => "index_services_on_proto"
390
+ add_index "services", ["state"], :name => "index_services_on_state"
391
+
392
+ create_table "session_events", :force => true do |t|
393
+ t.integer "session_id"
394
+ t.string "etype"
395
+ t.binary "command"
396
+ t.binary "output"
397
+ t.string "remote_path"
398
+ t.string "local_path"
399
+ t.datetime "created_at"
400
+ end
401
+
402
+ create_table "sessions", :force => true do |t|
403
+ t.integer "host_id"
404
+ t.string "stype"
405
+ t.string "via_exploit"
406
+ t.string "via_payload"
407
+ t.string "desc"
408
+ t.integer "port"
409
+ t.string "platform"
410
+ t.text "datastore"
411
+ t.datetime "opened_at", :null => false
412
+ t.datetime "closed_at"
413
+ t.string "close_reason"
414
+ t.integer "local_id"
415
+ t.datetime "last_seen"
416
+ end
417
+
418
+ create_table "tags", :force => true do |t|
419
+ t.integer "user_id"
420
+ t.string "name", :limit => 1024
421
+ t.text "desc"
422
+ t.boolean "report_summary", :default => false, :null => false
423
+ t.boolean "report_detail", :default => false, :null => false
424
+ t.boolean "critical", :default => false, :null => false
425
+ t.datetime "created_at", :null => false
426
+ t.datetime "updated_at", :null => false
427
+ end
428
+
429
+ create_table "tasks", :force => true do |t|
430
+ t.integer "workspace_id", :default => 1, :null => false
431
+ t.string "created_by"
432
+ t.string "module"
433
+ t.datetime "completed_at"
434
+ t.string "path", :limit => 1024
435
+ t.string "info"
436
+ t.string "description"
437
+ t.integer "progress"
438
+ t.text "options"
439
+ t.text "error"
440
+ t.datetime "created_at", :null => false
441
+ t.datetime "updated_at", :null => false
442
+ t.text "result"
443
+ t.string "module_uuid", :limit => 8
444
+ t.binary "settings"
445
+ end
446
+
447
+ create_table "users", :force => true do |t|
448
+ t.string "username"
449
+ t.string "crypted_password"
450
+ t.string "password_salt"
451
+ t.string "persistence_token"
452
+ t.datetime "created_at", :null => false
453
+ t.datetime "updated_at", :null => false
454
+ t.string "fullname"
455
+ t.string "email"
456
+ t.string "phone"
457
+ t.string "company"
458
+ t.string "prefs", :limit => 524288
459
+ t.boolean "admin", :default => true, :null => false
460
+ end
461
+
462
+ create_table "vuln_attempts", :force => true do |t|
463
+ t.integer "vuln_id"
464
+ t.datetime "attempted_at"
465
+ t.boolean "exploited"
466
+ t.string "fail_reason"
467
+ t.string "username"
468
+ t.text "module"
469
+ t.integer "session_id"
470
+ t.integer "loot_id"
471
+ t.text "fail_detail"
472
+ end
473
+
474
+ create_table "vuln_details", :force => true do |t|
475
+ t.integer "vuln_id"
476
+ t.float "cvss_score"
477
+ t.string "cvss_vector"
478
+ t.string "title"
479
+ t.text "description"
480
+ t.text "solution"
481
+ t.binary "proof"
482
+ t.integer "nx_console_id"
483
+ t.integer "nx_device_id"
484
+ t.string "nx_vuln_id"
485
+ t.float "nx_severity"
486
+ t.float "nx_pci_severity"
487
+ t.datetime "nx_published"
488
+ t.datetime "nx_added"
489
+ t.datetime "nx_modified"
490
+ t.text "nx_tags"
491
+ t.text "nx_vuln_status"
492
+ t.text "nx_proof_key"
493
+ t.string "src"
494
+ t.integer "nx_scan_id"
495
+ t.datetime "nx_vulnerable_since"
496
+ t.string "nx_pci_compliance_status"
497
+ end
498
+
499
+ create_table "vulns", :force => true do |t|
500
+ t.integer "host_id"
501
+ t.integer "service_id"
502
+ t.datetime "created_at"
503
+ t.string "name"
504
+ t.datetime "updated_at"
505
+ t.string "info", :limit => 65536
506
+ t.datetime "exploited_at"
507
+ t.integer "vuln_detail_count", :default => 0
508
+ t.integer "vuln_attempt_count", :default => 0
509
+ end
510
+
511
+ add_index "vulns", ["name"], :name => "index_vulns_on_name"
512
+
513
+ create_table "vulns_refs", :id => false, :force => true do |t|
514
+ t.integer "ref_id"
515
+ t.integer "vuln_id"
516
+ end
517
+
518
+ create_table "web_forms", :force => true do |t|
519
+ t.integer "web_site_id", :null => false
520
+ t.datetime "created_at", :null => false
521
+ t.datetime "updated_at", :null => false
522
+ t.text "path"
523
+ t.string "method", :limit => 1024
524
+ t.text "params"
525
+ t.text "query"
526
+ end
527
+
528
+ add_index "web_forms", ["path"], :name => "index_web_forms_on_path"
529
+
530
+ create_table "web_pages", :force => true do |t|
531
+ t.integer "web_site_id", :null => false
532
+ t.datetime "created_at", :null => false
533
+ t.datetime "updated_at", :null => false
534
+ t.text "path"
535
+ t.text "query"
536
+ t.integer "code", :null => false
537
+ t.text "cookie"
538
+ t.text "auth"
539
+ t.text "ctype"
540
+ t.datetime "mtime"
541
+ t.text "location"
542
+ t.text "headers"
543
+ t.binary "body"
544
+ t.binary "request"
545
+ end
546
+
547
+ add_index "web_pages", ["path"], :name => "index_web_pages_on_path"
548
+ add_index "web_pages", ["query"], :name => "index_web_pages_on_query"
549
+
550
+ create_table "web_sites", :force => true do |t|
551
+ t.integer "service_id", :null => false
552
+ t.datetime "created_at", :null => false
553
+ t.datetime "updated_at", :null => false
554
+ t.string "vhost", :limit => 2048
555
+ t.text "comments"
556
+ t.text "options"
557
+ end
558
+
559
+ add_index "web_sites", ["comments"], :name => "index_web_sites_on_comments"
560
+ add_index "web_sites", ["options"], :name => "index_web_sites_on_options"
561
+ add_index "web_sites", ["vhost"], :name => "index_web_sites_on_vhost"
562
+
563
+ create_table "web_templates", :force => true do |t|
564
+ t.string "name", :limit => 512
565
+ t.string "title", :limit => 512
566
+ t.string "body", :limit => 524288
567
+ t.integer "campaign_id"
568
+ t.text "prefs"
569
+ end
570
+
571
+ create_table "web_vulns", :force => true do |t|
572
+ t.integer "web_site_id", :null => false
573
+ t.datetime "created_at", :null => false
574
+ t.datetime "updated_at", :null => false
575
+ t.text "path", :null => false
576
+ t.string "method", :limit => 1024, :null => false
577
+ t.text "params", :null => false
578
+ t.text "pname", :null => false
579
+ t.integer "risk", :null => false
580
+ t.string "name", :limit => 1024, :null => false
581
+ t.text "query"
582
+ t.text "category", :null => false
583
+ t.text "confidence", :null => false
584
+ t.text "description"
585
+ t.text "blame"
586
+ t.binary "request"
587
+ t.binary "proof", :null => false
588
+ t.string "owner"
589
+ t.text "payload"
590
+ end
591
+
592
+ add_index "web_vulns", ["method"], :name => "index_web_vulns_on_method"
593
+ add_index "web_vulns", ["name"], :name => "index_web_vulns_on_name"
594
+ add_index "web_vulns", ["path"], :name => "index_web_vulns_on_path"
595
+
596
+ create_table "wmap_requests", :force => true do |t|
597
+ t.string "host"
598
+ t.string "address", :limit => nil
599
+ t.integer "port"
600
+ t.integer "ssl"
601
+ t.string "meth", :limit => 32
602
+ t.text "path"
603
+ t.text "headers"
604
+ t.text "query"
605
+ t.text "body"
606
+ t.string "respcode", :limit => 16
607
+ t.text "resphead"
608
+ t.text "response"
609
+ t.datetime "created_at"
610
+ t.datetime "updated_at"
611
+ end
612
+
613
+ create_table "wmap_targets", :force => true do |t|
614
+ t.string "host"
615
+ t.string "address", :limit => nil
616
+ t.integer "port"
617
+ t.integer "ssl"
618
+ t.integer "selected"
619
+ t.datetime "created_at"
620
+ t.datetime "updated_at"
621
+ end
622
+
623
+ create_table "workspace_members", :id => false, :force => true do |t|
624
+ t.integer "workspace_id", :null => false
625
+ t.integer "user_id", :null => false
626
+ end
627
+
628
+ create_table "workspaces", :force => true do |t|
629
+ t.string "name"
630
+ t.datetime "created_at", :null => false
631
+ t.datetime "updated_at", :null => false
632
+ t.string "boundary", :limit => 4096
633
+ t.string "description", :limit => 4096
634
+ t.integer "owner_id"
635
+ t.boolean "limit_to_network", :default => false, :null => false
636
+ end
637
+
638
+ end