metasploit_data_models 0.7.0-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (214) hide show
  1. data/.gitignore +24 -0
  2. data/.rspec +3 -0
  3. data/.simplecov +38 -0
  4. data/.travis.yml +6 -0
  5. data/.yardopts +4 -0
  6. data/Gemfile +27 -0
  7. data/LICENSE +27 -0
  8. data/README.md +72 -0
  9. data/Rakefile +53 -0
  10. data/app/models/mdm/api_key.rb +20 -0
  11. data/app/models/mdm/client.rb +9 -0
  12. data/app/models/mdm/cred.rb +93 -0
  13. data/app/models/mdm/event.rb +30 -0
  14. data/app/models/mdm/exploit_attempt.rb +14 -0
  15. data/app/models/mdm/exploited_host.rb +11 -0
  16. data/app/models/mdm/host.rb +134 -0
  17. data/app/models/mdm/host_detail.rb +15 -0
  18. data/app/models/mdm/host_tag.rb +13 -0
  19. data/app/models/mdm/imported_cred.rb +10 -0
  20. data/app/models/mdm/listener.rb +24 -0
  21. data/app/models/mdm/loot.rb +63 -0
  22. data/app/models/mdm/macro.rb +20 -0
  23. data/app/models/mdm/mod_ref.rb +3 -0
  24. data/app/models/mdm/module_action.rb +24 -0
  25. data/app/models/mdm/module_arch.rb +24 -0
  26. data/app/models/mdm/module_author.rb +25 -0
  27. data/app/models/mdm/module_detail.rb +59 -0
  28. data/app/models/mdm/module_mixin.rb +24 -0
  29. data/app/models/mdm/module_platform.rb +24 -0
  30. data/app/models/mdm/module_ref.rb +24 -0
  31. data/app/models/mdm/module_target.rb +26 -0
  32. data/app/models/mdm/nexpose_console.rb +20 -0
  33. data/app/models/mdm/note.rb +49 -0
  34. data/app/models/mdm/profile.rb +9 -0
  35. data/app/models/mdm/ref.rb +14 -0
  36. data/app/models/mdm/report.rb +50 -0
  37. data/app/models/mdm/report_template.rb +27 -0
  38. data/app/models/mdm/route.rb +9 -0
  39. data/app/models/mdm/service.rb +56 -0
  40. data/app/models/mdm/session.rb +48 -0
  41. data/app/models/mdm/session_event.rb +9 -0
  42. data/app/models/mdm/tag.rb +46 -0
  43. data/app/models/mdm/task.rb +41 -0
  44. data/app/models/mdm/user.rb +25 -0
  45. data/app/models/mdm/vuln.rb +60 -0
  46. data/app/models/mdm/vuln_attempt.rb +15 -0
  47. data/app/models/mdm/vuln_detail.rb +14 -0
  48. data/app/models/mdm/vuln_ref.rb +13 -0
  49. data/app/models/mdm/web_form.rb +16 -0
  50. data/app/models/mdm/web_page.rb +16 -0
  51. data/app/models/mdm/web_site.rb +47 -0
  52. data/app/models/mdm/web_vuln.rb +190 -0
  53. data/app/models/mdm/wmap_request.rb +3 -0
  54. data/app/models/mdm/wmap_target.rb +3 -0
  55. data/app/models/mdm/workspace.rb +196 -0
  56. data/bin/mdm_console +68 -0
  57. data/console_db.yml +9 -0
  58. data/db/migrate/000_create_tables.rb +79 -0
  59. data/db/migrate/001_add_wmap_tables.rb +35 -0
  60. data/db/migrate/002_add_workspaces.rb +36 -0
  61. data/db/migrate/003_move_notes.rb +20 -0
  62. data/db/migrate/004_add_events_table.rb +16 -0
  63. data/db/migrate/005_expand_info.rb +58 -0
  64. data/db/migrate/006_add_timestamps.rb +26 -0
  65. data/db/migrate/007_add_loots.rb +20 -0
  66. data/db/migrate/008_create_users.rb +16 -0
  67. data/db/migrate/009_add_loots_ctype.rb +10 -0
  68. data/db/migrate/010_add_alert_fields.rb +16 -0
  69. data/db/migrate/011_add_reports.rb +19 -0
  70. data/db/migrate/012_add_tasks.rb +24 -0
  71. data/db/migrate/013_add_tasks_result.rb +10 -0
  72. data/db/migrate/014_add_loots_fields.rb +12 -0
  73. data/db/migrate/015_rename_user.rb +16 -0
  74. data/db/migrate/016_add_host_purpose.rb +10 -0
  75. data/db/migrate/017_expand_info2.rb +58 -0
  76. data/db/migrate/018_add_workspace_user_info.rb +29 -0
  77. data/db/migrate/019_add_workspace_desc.rb +23 -0
  78. data/db/migrate/020_add_user_preferences.rb +11 -0
  79. data/db/migrate/021_standardize_info_and_data.rb +18 -0
  80. data/db/migrate/022_enlarge_event_info.rb +10 -0
  81. data/db/migrate/023_add_report_downloaded_at.rb +10 -0
  82. data/db/migrate/024_convert_service_info_to_text.rb +12 -0
  83. data/db/migrate/025_add_user_admin.rb +19 -0
  84. data/db/migrate/026_add_creds_table.rb +19 -0
  85. data/db/migrate/20100819123300_migrate_cred_data.rb +154 -0
  86. data/db/migrate/20100824151500_add_exploited_table.rb +16 -0
  87. data/db/migrate/20100908001428_add_owner_to_workspaces.rb +9 -0
  88. data/db/migrate/20100911122000_add_report_templates.rb +18 -0
  89. data/db/migrate/20100916151530_require_admin_flag.rb +15 -0
  90. data/db/migrate/20100916175000_add_campaigns_and_templates.rb +61 -0
  91. data/db/migrate/20100920012100_add_generate_exe_column.rb +8 -0
  92. data/db/migrate/20100926214000_add_template_prefs.rb +11 -0
  93. data/db/migrate/20101001000000_add_web_tables.rb +57 -0
  94. data/db/migrate/20101002000000_add_query.rb +10 -0
  95. data/db/migrate/20101007000000_add_vuln_info.rb +15 -0
  96. data/db/migrate/20101008111800_add_clients_to_campaigns.rb +10 -0
  97. data/db/migrate/20101009023300_add_campaign_attachments.rb +15 -0
  98. data/db/migrate/20101104135100_add_imported_creds.rb +17 -0
  99. data/db/migrate/20101203000000_fix_web_tables.rb +34 -0
  100. data/db/migrate/20101203000001_expand_host_comment.rb +12 -0
  101. data/db/migrate/20101206212033_add_limit_to_network_to_workspaces.rb +9 -0
  102. data/db/migrate/20110112154300_add_module_uuid_to_tasks.rb +9 -0
  103. data/db/migrate/20110204112800_add_host_tags.rb +28 -0
  104. data/db/migrate/20110317144932_add_session_table.rb +110 -0
  105. data/db/migrate/20110414180600_add_local_id_to_session_table.rb +11 -0
  106. data/db/migrate/20110415175705_add_routes_table.rb +18 -0
  107. data/db/migrate/20110422000000_convert_binary.rb +73 -0
  108. data/db/migrate/20110425095900_add_last_seen_to_sessions.rb +8 -0
  109. data/db/migrate/20110513143900_track_successful_exploits.rb +31 -0
  110. data/db/migrate/20110517160800_rename_and_prune_nessus_vulns.rb +26 -0
  111. data/db/migrate/20110527000000_add_task_id_to_reports_table.rb +11 -0
  112. data/db/migrate/20110527000001_add_api_keys_table.rb +12 -0
  113. data/db/migrate/20110606000001_add_macros_table.rb +16 -0
  114. data/db/migrate/20110622000000_add_settings_to_tasks_table.rb +12 -0
  115. data/db/migrate/20110624000001_add_listeners_table.rb +19 -0
  116. data/db/migrate/20110625000001_add_macro_to_listeners_table.rb +12 -0
  117. data/db/migrate/20110630000001_add_nexpose_consoles_table.rb +21 -0
  118. data/db/migrate/20110630000002_add_name_to_nexpose_consoles_table.rb +12 -0
  119. data/db/migrate/20110717000001_add_profiles_table.rb +15 -0
  120. data/db/migrate/20110727163801_expand_cred_ptype_column.rb +9 -0
  121. data/db/migrate/20110730000001_add_initial_indexes.rb +85 -0
  122. data/db/migrate/20110812000001_prune_indexes.rb +23 -0
  123. data/db/migrate/20110922000000_expand_notes.rb +9 -0
  124. data/db/migrate/20110928101300_add_mod_ref_table.rb +17 -0
  125. data/db/migrate/20111011110000_add_display_name_to_reports_table.rb +24 -0
  126. data/db/migrate/20111203000000_inet_columns.rb +13 -0
  127. data/db/migrate/20111204000000_more_inet_columns.rb +17 -0
  128. data/db/migrate/20111210000000_add_scope_to_hosts.rb +9 -0
  129. data/db/migrate/20120126110000_add_virtual_host_to_hosts.rb +9 -0
  130. data/db/migrate/20120411173220_rename_workspace_members.rb +9 -0
  131. data/db/migrate/20120601152442_add_counter_caches_to_hosts.rb +21 -0
  132. data/db/migrate/20120625000000_add_vuln_details.rb +34 -0
  133. data/db/migrate/20120625000001_add_host_details.rb +16 -0
  134. data/db/migrate/20120625000002_expand_details.rb +16 -0
  135. data/db/migrate/20120625000003_expand_details2.rb +24 -0
  136. data/db/migrate/20120625000004_add_vuln_attempts.rb +19 -0
  137. data/db/migrate/20120625000005_add_vuln_and_host_counter_caches.rb +14 -0
  138. data/db/migrate/20120625000006_add_module_details.rb +118 -0
  139. data/db/migrate/20120625000007_add_exploit_attempts.rb +26 -0
  140. data/db/migrate/20120625000008_add_fail_message.rb +12 -0
  141. data/db/migrate/20120718202805_add_owner_and_payload_to_web_vulns.rb +13 -0
  142. data/db/migrate/20130228214900_change_required_columns_to_null_false_in_web_vulns.rb +35 -0
  143. data/db/migrate/20130423211152_add_creds_counter_cache.rb +24 -0
  144. data/lib/mdm.rb +12 -0
  145. data/lib/mdm/host/operating_system_normalization.rb +984 -0
  146. data/lib/metasploit_data_models.rb +60 -0
  147. data/lib/metasploit_data_models/base64_serializer.rb +103 -0
  148. data/lib/metasploit_data_models/engine.rb +23 -0
  149. data/lib/metasploit_data_models/serialized_prefs.rb +23 -0
  150. data/lib/metasploit_data_models/validators/ip_format_validator.rb +13 -0
  151. data/lib/metasploit_data_models/validators/password_is_strong_validator.rb +70 -0
  152. data/lib/metasploit_data_models/version.rb +8 -0
  153. data/lib/tasks/yard.rake +26 -0
  154. data/metasploit_data_models.gemspec +54 -0
  155. data/script/rails +8 -0
  156. data/spec/app/models/mdm/module_action_spec.rb +38 -0
  157. data/spec/app/models/mdm/module_arch_spec.rb +38 -0
  158. data/spec/app/models/mdm/module_author_spec.rb +50 -0
  159. data/spec/app/models/mdm/module_detail_spec.rb +291 -0
  160. data/spec/app/models/mdm/module_mixin_spec.rb +38 -0
  161. data/spec/app/models/mdm/module_platform_spec.rb +38 -0
  162. data/spec/app/models/mdm/module_ref_spec.rb +38 -0
  163. data/spec/app/models/mdm/module_target_spec.rb +41 -0
  164. data/spec/app/models/mdm/web_vuln_spec.rb +126 -0
  165. data/spec/dummy/Rakefile +7 -0
  166. data/spec/dummy/app/assets/javascripts/application.js +15 -0
  167. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  168. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  169. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  170. data/spec/dummy/app/mailers/.gitkeep +0 -0
  171. data/spec/dummy/app/models/.gitkeep +0 -0
  172. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  173. data/spec/dummy/config.ru +4 -0
  174. data/spec/dummy/config/application.rb +61 -0
  175. data/spec/dummy/config/boot.rb +10 -0
  176. data/spec/dummy/config/database.yml.example +22 -0
  177. data/spec/dummy/config/database.yml.travis +22 -0
  178. data/spec/dummy/config/environment.rb +5 -0
  179. data/spec/dummy/config/environments/development.rb +37 -0
  180. data/spec/dummy/config/environments/production.rb +67 -0
  181. data/spec/dummy/config/environments/test.rb +37 -0
  182. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  183. data/spec/dummy/config/initializers/inflections.rb +15 -0
  184. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  185. data/spec/dummy/config/initializers/secret_token.rb +7 -0
  186. data/spec/dummy/config/initializers/session_store.rb +8 -0
  187. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  188. data/spec/dummy/config/routes.rb +2 -0
  189. data/spec/dummy/db/schema.rb +639 -0
  190. data/spec/dummy/lib/assets/.gitkeep +0 -0
  191. data/spec/dummy/log/.gitkeep +0 -0
  192. data/spec/dummy/public/404.html +26 -0
  193. data/spec/dummy/public/422.html +26 -0
  194. data/spec/dummy/public/500.html +25 -0
  195. data/spec/dummy/public/favicon.ico +0 -0
  196. data/spec/dummy/script/rails +6 -0
  197. data/spec/factories/mdm/addresses.rb +7 -0
  198. data/spec/factories/mdm/hosts.rb +18 -0
  199. data/spec/factories/mdm/module_actions.rb +14 -0
  200. data/spec/factories/mdm/module_archs.rb +14 -0
  201. data/spec/factories/mdm/module_authors.rb +22 -0
  202. data/spec/factories/mdm/module_details.rb +9 -0
  203. data/spec/factories/mdm/module_mixins.rb +14 -0
  204. data/spec/factories/mdm/module_platforms.rb +14 -0
  205. data/spec/factories/mdm/module_refs.rb +14 -0
  206. data/spec/factories/mdm/module_targets.rb +19 -0
  207. data/spec/factories/mdm/services.rb +35 -0
  208. data/spec/factories/mdm/users.rb +22 -0
  209. data/spec/factories/mdm/web_sites.rb +8 -0
  210. data/spec/factories/mdm/web_vulns.rb +64 -0
  211. data/spec/factories/mdm/workspaces.rb +23 -0
  212. data/spec/lib/base64_serializer_spec.rb +174 -0
  213. data/spec/spec_helper.rb +36 -0
  214. metadata +472 -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,639 @@
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 => 20130423211152) 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"
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
+ t.integer "cred_count", :default => 0
161
+ end
162
+
163
+ add_index "hosts", ["address"], :name => "index_hosts_on_address"
164
+ add_index "hosts", ["name"], :name => "index_hosts_on_name"
165
+ add_index "hosts", ["os_flavor"], :name => "index_hosts_on_os_flavor"
166
+ add_index "hosts", ["os_name"], :name => "index_hosts_on_os_name"
167
+ add_index "hosts", ["purpose"], :name => "index_hosts_on_purpose"
168
+ add_index "hosts", ["state"], :name => "index_hosts_on_state"
169
+
170
+ create_table "hosts_tags", :id => false, :force => true do |t|
171
+ t.integer "host_id"
172
+ t.integer "tag_id"
173
+ end
174
+
175
+ create_table "imported_creds", :force => true do |t|
176
+ t.integer "workspace_id", :default => 1, :null => false
177
+ t.string "user", :limit => 512
178
+ t.string "pass", :limit => 512
179
+ t.string "ptype", :limit => 16, :default => "password"
180
+ end
181
+
182
+ create_table "listeners", :force => true do |t|
183
+ t.datetime "created_at", :null => false
184
+ t.datetime "updated_at", :null => false
185
+ t.integer "workspace_id", :default => 1, :null => false
186
+ t.integer "task_id"
187
+ t.boolean "enabled", :default => true
188
+ t.text "owner"
189
+ t.text "payload"
190
+ t.text "address"
191
+ t.integer "port"
192
+ t.binary "options"
193
+ t.text "macro"
194
+ end
195
+
196
+ create_table "loots", :force => true do |t|
197
+ t.integer "workspace_id", :default => 1, :null => false
198
+ t.integer "host_id"
199
+ t.integer "service_id"
200
+ t.string "ltype", :limit => 512
201
+ t.string "path", :limit => 1024
202
+ t.text "data"
203
+ t.datetime "created_at", :null => false
204
+ t.datetime "updated_at", :null => false
205
+ t.string "content_type"
206
+ t.text "name"
207
+ t.text "info"
208
+ end
209
+
210
+ create_table "macros", :force => true do |t|
211
+ t.datetime "created_at", :null => false
212
+ t.datetime "updated_at", :null => false
213
+ t.text "owner"
214
+ t.text "name"
215
+ t.text "description"
216
+ t.binary "actions"
217
+ t.binary "prefs"
218
+ end
219
+
220
+ create_table "mod_refs", :force => true do |t|
221
+ t.string "module", :limit => 1024
222
+ t.string "mtype", :limit => 128
223
+ t.text "ref"
224
+ end
225
+
226
+ create_table "module_actions", :force => true do |t|
227
+ t.integer "module_detail_id"
228
+ t.text "name"
229
+ end
230
+
231
+ add_index "module_actions", ["module_detail_id"], :name => "index_module_actions_on_module_detail_id"
232
+
233
+ create_table "module_archs", :force => true do |t|
234
+ t.integer "module_detail_id"
235
+ t.text "name"
236
+ end
237
+
238
+ add_index "module_archs", ["module_detail_id"], :name => "index_module_archs_on_module_detail_id"
239
+
240
+ create_table "module_authors", :force => true do |t|
241
+ t.integer "module_detail_id"
242
+ t.text "name"
243
+ t.text "email"
244
+ end
245
+
246
+ add_index "module_authors", ["module_detail_id"], :name => "index_module_authors_on_module_detail_id"
247
+
248
+ create_table "module_details", :force => true do |t|
249
+ t.datetime "mtime"
250
+ t.text "file"
251
+ t.string "mtype"
252
+ t.text "refname"
253
+ t.text "fullname"
254
+ t.text "name"
255
+ t.integer "rank"
256
+ t.text "description"
257
+ t.string "license"
258
+ t.boolean "privileged"
259
+ t.datetime "disclosure_date"
260
+ t.integer "default_target"
261
+ t.text "default_action"
262
+ t.string "stance"
263
+ t.boolean "ready"
264
+ end
265
+
266
+ add_index "module_details", ["description"], :name => "index_module_details_on_description"
267
+ add_index "module_details", ["mtype"], :name => "index_module_details_on_mtype"
268
+ add_index "module_details", ["name"], :name => "index_module_details_on_name"
269
+ add_index "module_details", ["refname"], :name => "index_module_details_on_refname"
270
+
271
+ create_table "module_mixins", :force => true do |t|
272
+ t.integer "module_detail_id"
273
+ t.text "name"
274
+ end
275
+
276
+ add_index "module_mixins", ["module_detail_id"], :name => "index_module_mixins_on_module_detail_id"
277
+
278
+ create_table "module_platforms", :force => true do |t|
279
+ t.integer "module_detail_id"
280
+ t.text "name"
281
+ end
282
+
283
+ add_index "module_platforms", ["module_detail_id"], :name => "index_module_platforms_on_module_detail_id"
284
+
285
+ create_table "module_refs", :force => true do |t|
286
+ t.integer "module_detail_id"
287
+ t.text "name"
288
+ end
289
+
290
+ add_index "module_refs", ["module_detail_id"], :name => "index_module_refs_on_module_detail_id"
291
+ add_index "module_refs", ["name"], :name => "index_module_refs_on_name"
292
+
293
+ create_table "module_targets", :force => true do |t|
294
+ t.integer "module_detail_id"
295
+ t.integer "index"
296
+ t.text "name"
297
+ end
298
+
299
+ add_index "module_targets", ["module_detail_id"], :name => "index_module_targets_on_module_detail_id"
300
+
301
+ create_table "nexpose_consoles", :force => true do |t|
302
+ t.datetime "created_at", :null => false
303
+ t.datetime "updated_at", :null => false
304
+ t.boolean "enabled", :default => true
305
+ t.text "owner"
306
+ t.text "address"
307
+ t.integer "port", :default => 3780
308
+ t.text "username"
309
+ t.text "password"
310
+ t.text "status"
311
+ t.text "version"
312
+ t.text "cert"
313
+ t.binary "cached_sites"
314
+ t.text "name"
315
+ end
316
+
317
+ create_table "notes", :force => true do |t|
318
+ t.datetime "created_at"
319
+ t.string "ntype", :limit => 512
320
+ t.integer "workspace_id", :default => 1, :null => false
321
+ t.integer "service_id"
322
+ t.integer "host_id"
323
+ t.datetime "updated_at"
324
+ t.boolean "critical"
325
+ t.boolean "seen"
326
+ t.text "data"
327
+ end
328
+
329
+ add_index "notes", ["ntype"], :name => "index_notes_on_ntype"
330
+
331
+ create_table "profiles", :force => true do |t|
332
+ t.datetime "created_at", :null => false
333
+ t.datetime "updated_at", :null => false
334
+ t.boolean "active", :default => true
335
+ t.text "name"
336
+ t.text "owner"
337
+ t.binary "settings"
338
+ end
339
+
340
+ create_table "refs", :force => true do |t|
341
+ t.integer "ref_id"
342
+ t.datetime "created_at"
343
+ t.string "name", :limit => 512
344
+ t.datetime "updated_at"
345
+ end
346
+
347
+ add_index "refs", ["name"], :name => "index_refs_on_name"
348
+
349
+ create_table "report_templates", :force => true do |t|
350
+ t.integer "workspace_id", :default => 1, :null => false
351
+ t.string "created_by"
352
+ t.string "path", :limit => 1024
353
+ t.text "name"
354
+ t.datetime "created_at", :null => false
355
+ t.datetime "updated_at", :null => false
356
+ end
357
+
358
+ create_table "reports", :force => true do |t|
359
+ t.integer "workspace_id", :default => 1, :null => false
360
+ t.string "created_by"
361
+ t.string "rtype"
362
+ t.string "path", :limit => 1024
363
+ t.text "options"
364
+ t.datetime "created_at", :null => false
365
+ t.datetime "updated_at", :null => false
366
+ t.datetime "downloaded_at"
367
+ t.integer "task_id"
368
+ t.string "name", :limit => 63
369
+ end
370
+
371
+ create_table "routes", :force => true do |t|
372
+ t.integer "session_id"
373
+ t.string "subnet"
374
+ t.string "netmask"
375
+ end
376
+
377
+ create_table "services", :force => true do |t|
378
+ t.integer "host_id"
379
+ t.datetime "created_at"
380
+ t.integer "port", :null => false
381
+ t.string "proto", :limit => 16, :null => false
382
+ t.string "state"
383
+ t.string "name"
384
+ t.datetime "updated_at"
385
+ t.text "info"
386
+ end
387
+
388
+ add_index "services", ["name"], :name => "index_services_on_name"
389
+ add_index "services", ["port"], :name => "index_services_on_port"
390
+ add_index "services", ["proto"], :name => "index_services_on_proto"
391
+ add_index "services", ["state"], :name => "index_services_on_state"
392
+
393
+ create_table "session_events", :force => true do |t|
394
+ t.integer "session_id"
395
+ t.string "etype"
396
+ t.binary "command"
397
+ t.binary "output"
398
+ t.string "remote_path"
399
+ t.string "local_path"
400
+ t.datetime "created_at"
401
+ end
402
+
403
+ create_table "sessions", :force => true do |t|
404
+ t.integer "host_id"
405
+ t.string "stype"
406
+ t.string "via_exploit"
407
+ t.string "via_payload"
408
+ t.string "desc"
409
+ t.integer "port"
410
+ t.string "platform"
411
+ t.text "datastore"
412
+ t.datetime "opened_at", :null => false
413
+ t.datetime "closed_at"
414
+ t.string "close_reason"
415
+ t.integer "local_id"
416
+ t.datetime "last_seen"
417
+ end
418
+
419
+ create_table "tags", :force => true do |t|
420
+ t.integer "user_id"
421
+ t.string "name", :limit => 1024
422
+ t.text "desc"
423
+ t.boolean "report_summary", :default => false, :null => false
424
+ t.boolean "report_detail", :default => false, :null => false
425
+ t.boolean "critical", :default => false, :null => false
426
+ t.datetime "created_at", :null => false
427
+ t.datetime "updated_at", :null => false
428
+ end
429
+
430
+ create_table "tasks", :force => true do |t|
431
+ t.integer "workspace_id", :default => 1, :null => false
432
+ t.string "created_by"
433
+ t.string "module"
434
+ t.datetime "completed_at"
435
+ t.string "path", :limit => 1024
436
+ t.string "info"
437
+ t.string "description"
438
+ t.integer "progress"
439
+ t.text "options"
440
+ t.text "error"
441
+ t.datetime "created_at", :null => false
442
+ t.datetime "updated_at", :null => false
443
+ t.text "result"
444
+ t.string "module_uuid", :limit => 8
445
+ t.binary "settings"
446
+ end
447
+
448
+ create_table "users", :force => true do |t|
449
+ t.string "username"
450
+ t.string "crypted_password"
451
+ t.string "password_salt"
452
+ t.string "persistence_token"
453
+ t.datetime "created_at", :null => false
454
+ t.datetime "updated_at", :null => false
455
+ t.string "fullname"
456
+ t.string "email"
457
+ t.string "phone"
458
+ t.string "company"
459
+ t.string "prefs", :limit => 524288
460
+ t.boolean "admin", :default => true, :null => false
461
+ end
462
+
463
+ create_table "vuln_attempts", :force => true do |t|
464
+ t.integer "vuln_id"
465
+ t.datetime "attempted_at"
466
+ t.boolean "exploited"
467
+ t.string "fail_reason"
468
+ t.string "username"
469
+ t.text "module"
470
+ t.integer "session_id"
471
+ t.integer "loot_id"
472
+ t.text "fail_detail"
473
+ end
474
+
475
+ create_table "vuln_details", :force => true do |t|
476
+ t.integer "vuln_id"
477
+ t.float "cvss_score"
478
+ t.string "cvss_vector"
479
+ t.string "title"
480
+ t.text "description"
481
+ t.text "solution"
482
+ t.binary "proof"
483
+ t.integer "nx_console_id"
484
+ t.integer "nx_device_id"
485
+ t.string "nx_vuln_id"
486
+ t.float "nx_severity"
487
+ t.float "nx_pci_severity"
488
+ t.datetime "nx_published"
489
+ t.datetime "nx_added"
490
+ t.datetime "nx_modified"
491
+ t.text "nx_tags"
492
+ t.text "nx_vuln_status"
493
+ t.text "nx_proof_key"
494
+ t.string "src"
495
+ t.integer "nx_scan_id"
496
+ t.datetime "nx_vulnerable_since"
497
+ t.string "nx_pci_compliance_status"
498
+ end
499
+
500
+ create_table "vulns", :force => true do |t|
501
+ t.integer "host_id"
502
+ t.integer "service_id"
503
+ t.datetime "created_at"
504
+ t.string "name"
505
+ t.datetime "updated_at"
506
+ t.string "info", :limit => 65536
507
+ t.datetime "exploited_at"
508
+ t.integer "vuln_detail_count", :default => 0
509
+ t.integer "vuln_attempt_count", :default => 0
510
+ end
511
+
512
+ add_index "vulns", ["name"], :name => "index_vulns_on_name"
513
+
514
+ create_table "vulns_refs", :id => false, :force => true do |t|
515
+ t.integer "ref_id"
516
+ t.integer "vuln_id"
517
+ end
518
+
519
+ create_table "web_forms", :force => true do |t|
520
+ t.integer "web_site_id", :null => false
521
+ t.datetime "created_at", :null => false
522
+ t.datetime "updated_at", :null => false
523
+ t.text "path"
524
+ t.string "method", :limit => 1024
525
+ t.text "params"
526
+ t.text "query"
527
+ end
528
+
529
+ add_index "web_forms", ["path"], :name => "index_web_forms_on_path"
530
+
531
+ create_table "web_pages", :force => true do |t|
532
+ t.integer "web_site_id", :null => false
533
+ t.datetime "created_at", :null => false
534
+ t.datetime "updated_at", :null => false
535
+ t.text "path"
536
+ t.text "query"
537
+ t.integer "code", :null => false
538
+ t.text "cookie"
539
+ t.text "auth"
540
+ t.text "ctype"
541
+ t.datetime "mtime"
542
+ t.text "location"
543
+ t.text "headers"
544
+ t.binary "body"
545
+ t.binary "request"
546
+ end
547
+
548
+ add_index "web_pages", ["path"], :name => "index_web_pages_on_path"
549
+ add_index "web_pages", ["query"], :name => "index_web_pages_on_query"
550
+
551
+ create_table "web_sites", :force => true do |t|
552
+ t.integer "service_id", :null => false
553
+ t.datetime "created_at", :null => false
554
+ t.datetime "updated_at", :null => false
555
+ t.string "vhost", :limit => 2048
556
+ t.text "comments"
557
+ t.text "options"
558
+ end
559
+
560
+ add_index "web_sites", ["comments"], :name => "index_web_sites_on_comments"
561
+ add_index "web_sites", ["options"], :name => "index_web_sites_on_options"
562
+ add_index "web_sites", ["vhost"], :name => "index_web_sites_on_vhost"
563
+
564
+ create_table "web_templates", :force => true do |t|
565
+ t.string "name", :limit => 512
566
+ t.string "title", :limit => 512
567
+ t.string "body", :limit => 524288
568
+ t.integer "campaign_id"
569
+ t.text "prefs"
570
+ end
571
+
572
+ create_table "web_vulns", :force => true do |t|
573
+ t.integer "web_site_id", :null => false
574
+ t.datetime "created_at", :null => false
575
+ t.datetime "updated_at", :null => false
576
+ t.text "path", :null => false
577
+ t.string "method", :limit => 1024, :null => false
578
+ t.text "params", :null => false
579
+ t.text "pname", :null => false
580
+ t.integer "risk", :null => false
581
+ t.string "name", :limit => 1024, :null => false
582
+ t.text "query"
583
+ t.text "category", :null => false
584
+ t.text "confidence", :null => false
585
+ t.text "description"
586
+ t.text "blame"
587
+ t.binary "request"
588
+ t.binary "proof", :null => false
589
+ t.string "owner"
590
+ t.text "payload"
591
+ end
592
+
593
+ add_index "web_vulns", ["method"], :name => "index_web_vulns_on_method"
594
+ add_index "web_vulns", ["name"], :name => "index_web_vulns_on_name"
595
+ add_index "web_vulns", ["path"], :name => "index_web_vulns_on_path"
596
+
597
+ create_table "wmap_requests", :force => true do |t|
598
+ t.string "host"
599
+ t.string "address"
600
+ t.integer "port"
601
+ t.integer "ssl"
602
+ t.string "meth", :limit => 32
603
+ t.text "path"
604
+ t.text "headers"
605
+ t.text "query"
606
+ t.text "body"
607
+ t.string "respcode", :limit => 16
608
+ t.text "resphead"
609
+ t.text "response"
610
+ t.datetime "created_at"
611
+ t.datetime "updated_at"
612
+ end
613
+
614
+ create_table "wmap_targets", :force => true do |t|
615
+ t.string "host"
616
+ t.string "address"
617
+ t.integer "port"
618
+ t.integer "ssl"
619
+ t.integer "selected"
620
+ t.datetime "created_at"
621
+ t.datetime "updated_at"
622
+ end
623
+
624
+ create_table "workspace_members", :id => false, :force => true do |t|
625
+ t.integer "workspace_id", :null => false
626
+ t.integer "user_id", :null => false
627
+ end
628
+
629
+ create_table "workspaces", :force => true do |t|
630
+ t.string "name"
631
+ t.datetime "created_at", :null => false
632
+ t.datetime "updated_at", :null => false
633
+ t.string "boundary", :limit => 4096
634
+ t.string "description", :limit => 4096
635
+ t.integer "owner_id"
636
+ t.boolean "limit_to_network", :default => false, :null => false
637
+ end
638
+
639
+ end