CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/db/schema.rb
Views: 11703
1
# This file is auto-generated from the current state of the database. Instead
2
# of editing this file, please use the migrations feature of Active Record to
3
# incrementally modify your database, and then regenerate this schema definition.
4
#
5
# This file is the source Rails uses to define your schema when running `bin/rails
6
# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to
7
# be faster and is potentially less error prone than running all of your
8
# migrations from scratch. Old migrations may fail to apply correctly if those
9
# migrations use external dependencies or application code.
10
#
11
# It's strongly recommended that you check this file into your version control system.
12
13
ActiveRecord::Schema[7.0].define(version: 2022_12_09_005658) do
14
# These are extensions that must be enabled in order to support this database
15
enable_extension "plpgsql"
16
17
create_table "api_keys", id: :serial, force: :cascade do |t|
18
t.text "token"
19
t.datetime "created_at", precision: nil, null: false
20
t.datetime "updated_at", precision: nil, null: false
21
end
22
23
create_table "async_callbacks", id: :serial, force: :cascade do |t|
24
t.string "uuid", null: false
25
t.integer "timestamp", null: false
26
t.string "listener_uri"
27
t.string "target_host"
28
t.string "target_port"
29
t.datetime "created_at", precision: nil, null: false
30
t.datetime "updated_at", precision: nil, null: false
31
end
32
33
create_table "automatic_exploitation_match_results", id: :serial, force: :cascade do |t|
34
t.integer "match_id"
35
t.integer "run_id"
36
t.string "state", null: false
37
t.datetime "created_at", precision: nil, null: false
38
t.datetime "updated_at", precision: nil, null: false
39
t.index ["match_id"], name: "index_automatic_exploitation_match_results_on_match_id"
40
t.index ["run_id"], name: "index_automatic_exploitation_match_results_on_run_id"
41
end
42
43
create_table "automatic_exploitation_match_sets", id: :serial, force: :cascade do |t|
44
t.integer "workspace_id"
45
t.integer "user_id"
46
t.datetime "created_at", precision: nil, null: false
47
t.datetime "updated_at", precision: nil, null: false
48
t.index ["user_id"], name: "index_automatic_exploitation_match_sets_on_user_id"
49
t.index ["workspace_id"], name: "index_automatic_exploitation_match_sets_on_workspace_id"
50
end
51
52
create_table "automatic_exploitation_matches", id: :serial, force: :cascade do |t|
53
t.integer "module_detail_id"
54
t.string "state"
55
t.integer "nexpose_data_vulnerability_definition_id"
56
t.datetime "created_at", precision: nil, null: false
57
t.datetime "updated_at", precision: nil, null: false
58
t.integer "match_set_id"
59
t.string "matchable_type"
60
t.integer "matchable_id"
61
t.text "module_fullname"
62
t.index ["module_detail_id"], name: "index_automatic_exploitation_matches_on_module_detail_id"
63
t.index ["module_fullname"], name: "index_automatic_exploitation_matches_on_module_fullname"
64
end
65
66
create_table "automatic_exploitation_runs", id: :serial, force: :cascade do |t|
67
t.integer "workspace_id"
68
t.integer "user_id"
69
t.integer "match_set_id"
70
t.datetime "created_at", precision: nil, null: false
71
t.datetime "updated_at", precision: nil, null: false
72
t.index ["match_set_id"], name: "index_automatic_exploitation_runs_on_match_set_id"
73
t.index ["user_id"], name: "index_automatic_exploitation_runs_on_user_id"
74
t.index ["workspace_id"], name: "index_automatic_exploitation_runs_on_workspace_id"
75
end
76
77
create_table "clients", id: :serial, force: :cascade do |t|
78
t.integer "host_id"
79
t.datetime "created_at", precision: nil
80
t.string "ua_string", limit: 1024, null: false
81
t.string "ua_name", limit: 64
82
t.string "ua_ver", limit: 32
83
t.datetime "updated_at", precision: nil
84
end
85
86
create_table "credential_cores_tasks", id: false, force: :cascade do |t|
87
t.integer "core_id"
88
t.integer "task_id"
89
end
90
91
create_table "credential_logins_tasks", id: false, force: :cascade do |t|
92
t.integer "login_id"
93
t.integer "task_id"
94
end
95
96
create_table "creds", id: :serial, force: :cascade do |t|
97
t.integer "service_id", null: false
98
t.datetime "created_at", precision: nil, null: false
99
t.datetime "updated_at", precision: nil, null: false
100
t.string "user", limit: 2048
101
t.string "pass", limit: 4096
102
t.boolean "active", default: true
103
t.string "proof", limit: 4096
104
t.string "ptype", limit: 256
105
t.integer "source_id"
106
t.string "source_type"
107
end
108
109
create_table "events", id: :serial, force: :cascade do |t|
110
t.integer "workspace_id"
111
t.integer "host_id"
112
t.datetime "created_at", precision: nil
113
t.string "name"
114
t.datetime "updated_at", precision: nil
115
t.boolean "critical"
116
t.boolean "seen"
117
t.string "username"
118
t.text "info"
119
end
120
121
create_table "exploit_attempts", id: :serial, force: :cascade do |t|
122
t.integer "host_id"
123
t.integer "service_id"
124
t.integer "vuln_id"
125
t.datetime "attempted_at", precision: nil
126
t.boolean "exploited"
127
t.string "fail_reason"
128
t.string "username"
129
t.text "module"
130
t.integer "session_id"
131
t.integer "loot_id"
132
t.integer "port"
133
t.string "proto"
134
t.text "fail_detail"
135
end
136
137
create_table "exploited_hosts", id: :serial, force: :cascade do |t|
138
t.integer "host_id", null: false
139
t.integer "service_id"
140
t.string "session_uuid", limit: 8
141
t.string "name", limit: 2048
142
t.string "payload", limit: 2048
143
t.datetime "created_at", precision: nil, null: false
144
t.datetime "updated_at", precision: nil, null: false
145
end
146
147
create_table "host_details", id: :serial, force: :cascade do |t|
148
t.integer "host_id"
149
t.integer "nx_console_id"
150
t.integer "nx_device_id"
151
t.string "src"
152
t.string "nx_site_name"
153
t.string "nx_site_importance"
154
t.string "nx_scan_template"
155
t.float "nx_risk_score"
156
end
157
158
create_table "hosts", id: :serial, force: :cascade do |t|
159
t.datetime "created_at", precision: nil
160
t.inet "address", null: false
161
t.string "mac"
162
t.string "comm"
163
t.string "name"
164
t.string "state"
165
t.string "os_name"
166
t.string "os_flavor"
167
t.string "os_sp"
168
t.string "os_lang"
169
t.string "arch"
170
t.integer "workspace_id", null: false
171
t.datetime "updated_at", precision: nil
172
t.text "purpose"
173
t.string "info", limit: 65536
174
t.text "comments"
175
t.text "scope"
176
t.text "virtual_host"
177
t.integer "note_count", default: 0
178
t.integer "vuln_count", default: 0
179
t.integer "service_count", default: 0
180
t.integer "host_detail_count", default: 0
181
t.integer "exploit_attempt_count", default: 0
182
t.integer "cred_count", default: 0
183
t.string "detected_arch"
184
t.string "os_family"
185
t.index ["name"], name: "index_hosts_on_name"
186
t.index ["os_flavor"], name: "index_hosts_on_os_flavor"
187
t.index ["os_name"], name: "index_hosts_on_os_name"
188
t.index ["purpose"], name: "index_hosts_on_purpose"
189
t.index ["state"], name: "index_hosts_on_state"
190
t.index ["workspace_id", "address"], name: "index_hosts_on_workspace_id_and_address", unique: true
191
end
192
193
create_table "hosts_tags", id: :serial, force: :cascade do |t|
194
t.integer "host_id"
195
t.integer "tag_id"
196
end
197
198
create_table "listeners", id: :serial, force: :cascade do |t|
199
t.datetime "created_at", precision: nil, null: false
200
t.datetime "updated_at", precision: nil, null: false
201
t.integer "workspace_id", default: 1, null: false
202
t.integer "task_id"
203
t.boolean "enabled", default: true
204
t.text "owner"
205
t.text "payload"
206
t.text "address"
207
t.integer "port"
208
t.binary "options"
209
t.text "macro"
210
end
211
212
create_table "loots", id: :serial, force: :cascade do |t|
213
t.integer "workspace_id", default: 1, null: false
214
t.integer "host_id"
215
t.integer "service_id"
216
t.string "ltype", limit: 512
217
t.string "path", limit: 1024
218
t.text "data"
219
t.datetime "created_at", precision: nil, null: false
220
t.datetime "updated_at", precision: nil, null: false
221
t.string "content_type"
222
t.text "name"
223
t.text "info"
224
t.integer "module_run_id"
225
t.index ["module_run_id"], name: "index_loots_on_module_run_id"
226
end
227
228
create_table "macros", id: :serial, force: :cascade do |t|
229
t.datetime "created_at", precision: nil, null: false
230
t.datetime "updated_at", precision: nil, null: false
231
t.text "owner"
232
t.text "name"
233
t.text "description"
234
t.binary "actions"
235
t.binary "prefs"
236
end
237
238
create_table "metasploit_credential_cores", id: :serial, force: :cascade do |t|
239
t.string "origin_type", null: false
240
t.integer "origin_id", null: false
241
t.integer "private_id"
242
t.integer "public_id"
243
t.integer "realm_id"
244
t.integer "workspace_id", null: false
245
t.datetime "created_at", precision: nil, null: false
246
t.datetime "updated_at", precision: nil, null: false
247
t.integer "logins_count", default: 0
248
t.index ["origin_type", "origin_id"], name: "index_metasploit_credential_cores_on_origin_type_and_origin_id"
249
t.index ["private_id"], name: "index_metasploit_credential_cores_on_private_id"
250
t.index ["public_id"], name: "index_metasploit_credential_cores_on_public_id"
251
t.index ["realm_id"], name: "index_metasploit_credential_cores_on_realm_id"
252
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))"
253
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))"
254
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))"
255
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))"
256
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))"
257
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))"
258
t.index ["workspace_id"], name: "index_metasploit_credential_cores_on_workspace_id"
259
end
260
261
create_table "metasploit_credential_logins", id: :serial, force: :cascade do |t|
262
t.integer "core_id", null: false
263
t.integer "service_id", null: false
264
t.string "access_level"
265
t.string "status", null: false
266
t.datetime "last_attempted_at", precision: nil
267
t.datetime "created_at", precision: nil, null: false
268
t.datetime "updated_at", precision: nil, null: false
269
t.index ["core_id", "service_id"], name: "index_metasploit_credential_logins_on_core_id_and_service_id", unique: true
270
t.index ["service_id", "core_id"], name: "index_metasploit_credential_logins_on_service_id_and_core_id", unique: true
271
end
272
273
create_table "metasploit_credential_origin_cracked_passwords", id: :serial, force: :cascade do |t|
274
t.integer "metasploit_credential_core_id", null: false
275
t.datetime "created_at", precision: nil, null: false
276
t.datetime "updated_at", precision: nil, null: false
277
t.index ["metasploit_credential_core_id"], name: "originating_credential_cores"
278
end
279
280
create_table "metasploit_credential_origin_imports", id: :serial, force: :cascade do |t|
281
t.text "filename", null: false
282
t.integer "task_id"
283
t.datetime "created_at", precision: nil, null: false
284
t.datetime "updated_at", precision: nil, null: false
285
t.index ["task_id"], name: "index_metasploit_credential_origin_imports_on_task_id"
286
end
287
288
create_table "metasploit_credential_origin_manuals", id: :serial, force: :cascade do |t|
289
t.integer "user_id", null: false
290
t.datetime "created_at", precision: nil, null: false
291
t.datetime "updated_at", precision: nil, null: false
292
t.index ["user_id"], name: "index_metasploit_credential_origin_manuals_on_user_id"
293
end
294
295
create_table "metasploit_credential_origin_services", id: :serial, force: :cascade do |t|
296
t.integer "service_id", null: false
297
t.text "module_full_name", null: false
298
t.datetime "created_at", precision: nil, null: false
299
t.datetime "updated_at", precision: nil, null: false
300
t.index ["service_id", "module_full_name"], name: "unique_metasploit_credential_origin_services", unique: true
301
end
302
303
create_table "metasploit_credential_origin_sessions", id: :serial, force: :cascade do |t|
304
t.text "post_reference_name", null: false
305
t.integer "session_id", null: false
306
t.datetime "created_at", precision: nil, null: false
307
t.datetime "updated_at", precision: nil, null: false
308
t.index ["session_id", "post_reference_name"], name: "unique_metasploit_credential_origin_sessions", unique: true
309
end
310
311
create_table "metasploit_credential_privates", id: :serial, force: :cascade do |t|
312
t.string "type", null: false
313
t.text "data", null: false
314
t.datetime "created_at", precision: nil, null: false
315
t.datetime "updated_at", precision: nil, null: false
316
t.string "jtr_format"
317
t.index "type, decode(md5(data), 'hex'::text)", name: "index_metasploit_credential_privates_on_type_and_data_pkcs12", unique: true, where: "((type)::text = 'Metasploit::Credential::Pkcs12'::text)"
318
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)"
319
t.index ["type", "data"], name: "index_metasploit_credential_privates_on_type_and_data", unique: true, where: "(NOT (((type)::text = 'Metasploit::Credential::SSHKey'::text) OR ((type)::text = 'Metasploit::Credential::Pkcs12'::text)))"
320
end
321
322
create_table "metasploit_credential_publics", id: :serial, force: :cascade do |t|
323
t.string "username", null: false
324
t.datetime "created_at", precision: nil, null: false
325
t.datetime "updated_at", precision: nil, null: false
326
t.string "type", null: false
327
t.index ["username"], name: "index_metasploit_credential_publics_on_username", unique: true
328
end
329
330
create_table "metasploit_credential_realms", id: :serial, force: :cascade do |t|
331
t.string "key", null: false
332
t.string "value", null: false
333
t.datetime "created_at", precision: nil, null: false
334
t.datetime "updated_at", precision: nil, null: false
335
t.index ["key", "value"], name: "index_metasploit_credential_realms_on_key_and_value", unique: true
336
end
337
338
create_table "mod_refs", id: :serial, force: :cascade do |t|
339
t.string "module", limit: 1024
340
t.string "mtype", limit: 128
341
t.text "ref"
342
end
343
344
create_table "module_actions", id: :serial, force: :cascade do |t|
345
t.integer "detail_id"
346
t.text "name"
347
t.index ["detail_id"], name: "index_module_actions_on_detail_id"
348
end
349
350
create_table "module_archs", id: :serial, force: :cascade do |t|
351
t.integer "detail_id"
352
t.text "name"
353
t.index ["detail_id"], name: "index_module_archs_on_detail_id"
354
end
355
356
create_table "module_authors", id: :serial, force: :cascade do |t|
357
t.integer "detail_id"
358
t.text "name"
359
t.text "email"
360
t.index ["detail_id"], name: "index_module_authors_on_detail_id"
361
end
362
363
create_table "module_details", id: :serial, force: :cascade do |t|
364
t.datetime "mtime", precision: nil
365
t.text "file"
366
t.string "mtype"
367
t.text "refname"
368
t.text "fullname"
369
t.text "name"
370
t.integer "rank"
371
t.text "description"
372
t.string "license"
373
t.boolean "privileged"
374
t.datetime "disclosure_date", precision: nil
375
t.integer "default_target"
376
t.text "default_action"
377
t.string "stance"
378
t.boolean "ready"
379
t.index ["description"], name: "index_module_details_on_description"
380
t.index ["mtype"], name: "index_module_details_on_mtype"
381
t.index ["name"], name: "index_module_details_on_name"
382
t.index ["refname"], name: "index_module_details_on_refname"
383
end
384
385
create_table "module_mixins", id: :serial, force: :cascade do |t|
386
t.integer "detail_id"
387
t.text "name"
388
t.index ["detail_id"], name: "index_module_mixins_on_detail_id"
389
end
390
391
create_table "module_platforms", id: :serial, force: :cascade do |t|
392
t.integer "detail_id"
393
t.text "name"
394
t.index ["detail_id"], name: "index_module_platforms_on_detail_id"
395
end
396
397
create_table "module_refs", id: :serial, force: :cascade do |t|
398
t.integer "detail_id"
399
t.text "name"
400
t.index ["detail_id"], name: "index_module_refs_on_detail_id"
401
t.index ["name"], name: "index_module_refs_on_name"
402
end
403
404
create_table "module_runs", id: :serial, force: :cascade do |t|
405
t.datetime "attempted_at", precision: nil
406
t.text "fail_detail"
407
t.string "fail_reason"
408
t.text "module_fullname"
409
t.integer "port"
410
t.string "proto"
411
t.integer "session_id"
412
t.string "status"
413
t.integer "trackable_id"
414
t.string "trackable_type"
415
t.integer "user_id"
416
t.string "username"
417
t.datetime "created_at", precision: nil, null: false
418
t.datetime "updated_at", precision: nil, null: false
419
t.index ["session_id"], name: "index_module_runs_on_session_id"
420
t.index ["user_id"], name: "index_module_runs_on_user_id"
421
end
422
423
create_table "module_targets", id: :serial, force: :cascade do |t|
424
t.integer "detail_id"
425
t.integer "index"
426
t.text "name"
427
t.index ["detail_id"], name: "index_module_targets_on_detail_id"
428
end
429
430
create_table "nexpose_consoles", id: :serial, force: :cascade do |t|
431
t.datetime "created_at", precision: nil, null: false
432
t.datetime "updated_at", precision: nil, null: false
433
t.boolean "enabled", default: true
434
t.text "owner"
435
t.text "address"
436
t.integer "port", default: 3780
437
t.text "username"
438
t.text "password"
439
t.text "status"
440
t.text "version"
441
t.text "cert"
442
t.binary "cached_sites"
443
t.text "name"
444
end
445
446
create_table "notes", id: :serial, force: :cascade do |t|
447
t.datetime "created_at", precision: nil
448
t.string "ntype", limit: 512
449
t.integer "workspace_id", default: 1, null: false
450
t.integer "service_id"
451
t.integer "host_id"
452
t.datetime "updated_at", precision: nil
453
t.boolean "critical"
454
t.boolean "seen"
455
t.text "data"
456
t.integer "vuln_id"
457
t.index ["ntype"], name: "index_notes_on_ntype"
458
t.index ["vuln_id"], name: "index_notes_on_vuln_id"
459
end
460
461
create_table "payloads", id: :serial, force: :cascade do |t|
462
t.string "name"
463
t.string "uuid"
464
t.integer "uuid_mask"
465
t.integer "timestamp"
466
t.string "arch"
467
t.string "platform"
468
t.string "urls"
469
t.string "description"
470
t.string "raw_payload"
471
t.string "raw_payload_hash"
472
t.string "build_status"
473
t.string "build_opts"
474
t.datetime "created_at", precision: nil, null: false
475
t.datetime "updated_at", precision: nil, null: false
476
end
477
478
create_table "profiles", id: :serial, force: :cascade do |t|
479
t.datetime "created_at", precision: nil, null: false
480
t.datetime "updated_at", precision: nil, null: false
481
t.boolean "active", default: true
482
t.text "name"
483
t.text "owner"
484
t.binary "settings"
485
end
486
487
create_table "refs", id: :serial, force: :cascade do |t|
488
t.integer "ref_id"
489
t.datetime "created_at", precision: nil
490
t.string "name", limit: 512
491
t.datetime "updated_at", precision: nil
492
t.index ["name"], name: "index_refs_on_name"
493
end
494
495
create_table "report_templates", id: :serial, force: :cascade do |t|
496
t.integer "workspace_id", default: 1, null: false
497
t.string "created_by"
498
t.string "path", limit: 1024
499
t.text "name"
500
t.datetime "created_at", precision: nil, null: false
501
t.datetime "updated_at", precision: nil, null: false
502
end
503
504
create_table "reports", id: :serial, force: :cascade do |t|
505
t.integer "workspace_id", default: 1, null: false
506
t.string "created_by"
507
t.string "rtype"
508
t.string "path", limit: 1024
509
t.text "options"
510
t.datetime "created_at", precision: nil, null: false
511
t.datetime "updated_at", precision: nil, null: false
512
t.datetime "downloaded_at", precision: nil
513
t.integer "task_id"
514
t.string "name", limit: 63
515
end
516
517
create_table "routes", id: :serial, force: :cascade do |t|
518
t.integer "session_id"
519
t.string "subnet"
520
t.string "netmask"
521
end
522
523
create_table "services", id: :serial, force: :cascade do |t|
524
t.integer "host_id"
525
t.datetime "created_at", precision: nil
526
t.integer "port", null: false
527
t.string "proto", limit: 16, null: false
528
t.string "state"
529
t.string "name"
530
t.datetime "updated_at", precision: nil
531
t.text "info"
532
t.index ["host_id", "port", "proto"], name: "index_services_on_host_id_and_port_and_proto", unique: true
533
t.index ["name"], name: "index_services_on_name"
534
t.index ["port"], name: "index_services_on_port"
535
t.index ["proto"], name: "index_services_on_proto"
536
t.index ["state"], name: "index_services_on_state"
537
end
538
539
create_table "session_events", id: :serial, force: :cascade do |t|
540
t.integer "session_id"
541
t.string "etype"
542
t.binary "command"
543
t.binary "output"
544
t.string "remote_path"
545
t.string "local_path"
546
t.datetime "created_at", precision: nil
547
end
548
549
create_table "sessions", id: :serial, force: :cascade do |t|
550
t.integer "host_id"
551
t.string "stype"
552
t.string "via_exploit"
553
t.string "via_payload"
554
t.string "desc"
555
t.integer "port"
556
t.string "platform"
557
t.text "datastore"
558
t.datetime "opened_at", precision: nil, null: false
559
t.datetime "closed_at", precision: nil
560
t.string "close_reason"
561
t.integer "local_id"
562
t.datetime "last_seen", precision: nil
563
t.integer "module_run_id"
564
t.index ["module_run_id"], name: "index_sessions_on_module_run_id"
565
end
566
567
create_table "tags", id: :serial, force: :cascade do |t|
568
t.integer "user_id"
569
t.string "name", limit: 1024
570
t.text "desc"
571
t.boolean "report_summary", default: false, null: false
572
t.boolean "report_detail", default: false, null: false
573
t.boolean "critical", default: false, null: false
574
t.datetime "created_at", precision: nil, null: false
575
t.datetime "updated_at", precision: nil, null: false
576
end
577
578
create_table "task_creds", id: :serial, force: :cascade do |t|
579
t.integer "task_id", null: false
580
t.integer "cred_id", null: false
581
t.datetime "created_at", precision: nil, null: false
582
t.datetime "updated_at", precision: nil, null: false
583
end
584
585
create_table "task_hosts", id: :serial, force: :cascade do |t|
586
t.integer "task_id", null: false
587
t.integer "host_id", null: false
588
t.datetime "created_at", precision: nil, null: false
589
t.datetime "updated_at", precision: nil, null: false
590
end
591
592
create_table "task_services", id: :serial, force: :cascade do |t|
593
t.integer "task_id", null: false
594
t.integer "service_id", null: false
595
t.datetime "created_at", precision: nil, null: false
596
t.datetime "updated_at", precision: nil, null: false
597
end
598
599
create_table "task_sessions", id: :serial, force: :cascade do |t|
600
t.integer "task_id", null: false
601
t.integer "session_id", null: false
602
t.datetime "created_at", precision: nil, null: false
603
t.datetime "updated_at", precision: nil, null: false
604
end
605
606
create_table "tasks", id: :serial, force: :cascade do |t|
607
t.integer "workspace_id", default: 1, null: false
608
t.string "created_by"
609
t.string "module"
610
t.datetime "completed_at", precision: nil
611
t.string "path", limit: 1024
612
t.string "info"
613
t.string "description"
614
t.integer "progress"
615
t.text "options"
616
t.text "error"
617
t.datetime "created_at", precision: nil, null: false
618
t.datetime "updated_at", precision: nil, null: false
619
t.text "result"
620
t.string "module_uuid", limit: 8
621
t.binary "settings"
622
end
623
624
create_table "users", id: :serial, force: :cascade do |t|
625
t.string "username"
626
t.string "crypted_password"
627
t.string "password_salt"
628
t.string "persistence_token"
629
t.datetime "created_at", precision: nil, null: false
630
t.datetime "updated_at", precision: nil, null: false
631
t.string "fullname"
632
t.string "email"
633
t.string "phone"
634
t.string "company"
635
t.string "prefs", limit: 524288
636
t.boolean "admin", default: true, null: false
637
end
638
639
create_table "vuln_attempts", id: :serial, force: :cascade do |t|
640
t.integer "vuln_id"
641
t.datetime "attempted_at", precision: nil
642
t.boolean "exploited"
643
t.string "fail_reason"
644
t.string "username"
645
t.text "module"
646
t.integer "session_id"
647
t.integer "loot_id"
648
t.text "fail_detail"
649
end
650
651
create_table "vuln_details", id: :serial, force: :cascade do |t|
652
t.integer "vuln_id"
653
t.float "cvss_score"
654
t.string "cvss_vector"
655
t.string "title"
656
t.text "description"
657
t.text "solution"
658
t.binary "proof"
659
t.integer "nx_console_id"
660
t.integer "nx_device_id"
661
t.string "nx_vuln_id"
662
t.float "nx_severity"
663
t.float "nx_pci_severity"
664
t.datetime "nx_published", precision: nil
665
t.datetime "nx_added", precision: nil
666
t.datetime "nx_modified", precision: nil
667
t.text "nx_tags"
668
t.text "nx_vuln_status"
669
t.text "nx_proof_key"
670
t.string "src"
671
t.integer "nx_scan_id"
672
t.datetime "nx_vulnerable_since", precision: nil
673
t.string "nx_pci_compliance_status"
674
end
675
676
create_table "vulns", id: :serial, force: :cascade do |t|
677
t.integer "host_id"
678
t.integer "service_id"
679
t.datetime "created_at", precision: nil
680
t.string "name"
681
t.datetime "updated_at", precision: nil
682
t.string "info", limit: 65536
683
t.datetime "exploited_at", precision: nil
684
t.integer "vuln_detail_count", default: 0
685
t.integer "vuln_attempt_count", default: 0
686
t.integer "origin_id"
687
t.string "origin_type"
688
t.index ["name"], name: "index_vulns_on_name"
689
t.index ["origin_id"], name: "index_vulns_on_origin_id"
690
end
691
692
create_table "vulns_refs", id: :serial, force: :cascade do |t|
693
t.integer "ref_id"
694
t.integer "vuln_id"
695
end
696
697
create_table "web_forms", id: :serial, force: :cascade do |t|
698
t.integer "web_site_id", null: false
699
t.datetime "created_at", precision: nil, null: false
700
t.datetime "updated_at", precision: nil, null: false
701
t.text "path"
702
t.string "method", limit: 1024
703
t.text "params"
704
t.text "query"
705
t.index ["path"], name: "index_web_forms_on_path"
706
end
707
708
create_table "web_pages", id: :serial, force: :cascade do |t|
709
t.integer "web_site_id", null: false
710
t.datetime "created_at", precision: nil, null: false
711
t.datetime "updated_at", precision: nil, null: false
712
t.text "path"
713
t.text "query"
714
t.integer "code", null: false
715
t.text "cookie"
716
t.text "auth"
717
t.text "ctype"
718
t.datetime "mtime", precision: nil
719
t.text "location"
720
t.text "headers"
721
t.binary "body"
722
t.binary "request"
723
t.index ["path"], name: "index_web_pages_on_path"
724
t.index ["query"], name: "index_web_pages_on_query"
725
end
726
727
create_table "web_sites", id: :serial, force: :cascade do |t|
728
t.integer "service_id", null: false
729
t.datetime "created_at", precision: nil, null: false
730
t.datetime "updated_at", precision: nil, null: false
731
t.string "vhost", limit: 2048
732
t.text "comments"
733
t.text "options"
734
t.index ["comments"], name: "index_web_sites_on_comments"
735
t.index ["options"], name: "index_web_sites_on_options"
736
t.index ["vhost"], name: "index_web_sites_on_vhost"
737
end
738
739
create_table "web_vulns", id: :serial, force: :cascade do |t|
740
t.integer "web_site_id", null: false
741
t.datetime "created_at", precision: nil, null: false
742
t.datetime "updated_at", precision: nil, null: false
743
t.text "path", null: false
744
t.string "method", limit: 1024, null: false
745
t.text "params"
746
t.text "pname"
747
t.integer "risk", null: false
748
t.string "name", limit: 1024, null: false
749
t.text "query"
750
t.text "category", null: false
751
t.integer "confidence", null: false
752
t.text "description"
753
t.text "blame"
754
t.binary "request"
755
t.binary "proof", null: false
756
t.string "owner"
757
t.text "payload"
758
t.index ["method"], name: "index_web_vulns_on_method"
759
t.index ["name"], name: "index_web_vulns_on_name"
760
t.index ["path"], name: "index_web_vulns_on_path"
761
end
762
763
create_table "wmap_requests", id: :serial, force: :cascade do |t|
764
t.string "host"
765
t.inet "address"
766
t.integer "port"
767
t.integer "ssl"
768
t.string "meth", limit: 32
769
t.text "path"
770
t.text "headers"
771
t.text "query"
772
t.text "body"
773
t.string "respcode", limit: 16
774
t.text "resphead"
775
t.text "response"
776
t.datetime "created_at", precision: nil
777
t.datetime "updated_at", precision: nil
778
end
779
780
create_table "wmap_targets", id: :serial, force: :cascade do |t|
781
t.string "host"
782
t.inet "address"
783
t.integer "port"
784
t.integer "ssl"
785
t.integer "selected"
786
t.datetime "created_at", precision: nil
787
t.datetime "updated_at", precision: nil
788
end
789
790
create_table "workspace_members", id: false, force: :cascade do |t|
791
t.integer "workspace_id", null: false
792
t.integer "user_id", null: false
793
end
794
795
create_table "workspaces", id: :serial, force: :cascade do |t|
796
t.string "name"
797
t.datetime "created_at", precision: nil, null: false
798
t.datetime "updated_at", precision: nil, null: false
799
t.string "boundary", limit: 4096
800
t.string "description", limit: 4096
801
t.integer "owner_id"
802
t.boolean "limit_to_network", default: false, null: false
803
t.boolean "import_fingerprint", default: false
804
end
805
806
end
807
808