metasploit-credential 0.7.16 → 0.7.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,6 +5,7 @@ describe Metasploit::Credential::Login do
5
5
 
6
6
  context 'associations' do
7
7
  it { should belong_to(:core).class_name('Metasploit::Credential::Core') }
8
+ it { should have_one(:host).class_name('Mdm::Host') }
8
9
  it { should belong_to(:service).class_name('Mdm::Service')}
9
10
  end
10
11
 
@@ -165,11 +166,18 @@ describe Metasploit::Credential::Login do
165
166
  end
166
167
 
167
168
  context 'search' do
168
- context 'attributes' do
169
- let(:base_class) {
170
- described_class
171
- }
169
+ let(:base_class) {
170
+ described_class
171
+ }
172
+
173
+ context 'associations' do
174
+ it_should_behave_like 'search_association',
175
+ :host
176
+ it_should_behave_like 'search_association',
177
+ :service
178
+ end
172
179
 
180
+ context 'attributes' do
173
181
  it_should_behave_like 'search_attribute',
174
182
  :access_level,
175
183
  type: :string
@@ -286,6 +286,7 @@ describe MetasploitDataModels::Search::Visitor::Relation do
286
286
 
287
287
  context 'with Metasploit::Credential::Login' do
288
288
  include_context 'Mdm::Workspace'
289
+ include_context 'Rex::Text'
289
290
 
290
291
  #
291
292
  # lets
@@ -299,6 +300,71 @@ describe MetasploitDataModels::Search::Visitor::Relation do
299
300
  'admin'
300
301
  }
301
302
 
303
+ let(:matching_credential_core) {
304
+ FactoryGirl.create(
305
+ :metasploit_credential_core
306
+ )
307
+ }
308
+
309
+ let(:matching_host) {
310
+ FactoryGirl.create(
311
+ :mdm_host,
312
+ address: matching_host_address,
313
+ name: matching_host_name,
314
+ os_flavor: matching_host_os_flavor,
315
+ os_name: matching_host_os_name,
316
+ os_sp: matching_host_os_sp,
317
+ workspace: matching_credential_core.workspace
318
+ )
319
+ }
320
+
321
+ let(:matching_host_address) {
322
+ '1.2.3.4'
323
+ }
324
+
325
+ let(:matching_host_name) {
326
+ 'mdm_host_name_a'
327
+ }
328
+
329
+ let(:matching_host_os_flavor) {
330
+ 'mdm_host_os_flavor_a'
331
+ }
332
+
333
+ let(:matching_host_os_name) {
334
+ 'mdm_host_os_name_a'
335
+ }
336
+
337
+ let(:matching_host_os_sp) {
338
+ 'mdm_host_os_sp_a'
339
+ }
340
+
341
+ let(:matching_service) {
342
+ FactoryGirl.create(
343
+ :mdm_service,
344
+ host: matching_host,
345
+ info: matching_service_info,
346
+ name: matching_service_name,
347
+ port: matching_service_port,
348
+ proto: matching_service_proto
349
+ )
350
+ }
351
+
352
+ let(:matching_service_info) {
353
+ 'mdm_service_info_a'
354
+ }
355
+
356
+ let(:matching_service_name) {
357
+ 'mdm_service_name_a'
358
+ }
359
+
360
+ let(:matching_service_port) {
361
+ 1
362
+ }
363
+
364
+ let(:matching_service_proto) {
365
+ 'tcp'
366
+ }
367
+
302
368
  let(:matching_status) {
303
369
  matching_record.status
304
370
  }
@@ -307,6 +373,71 @@ describe MetasploitDataModels::Search::Visitor::Relation do
307
373
  'normal'
308
374
  }
309
375
 
376
+ let(:non_matching_credential_core) {
377
+ FactoryGirl.create(
378
+ :metasploit_credential_core
379
+ )
380
+ }
381
+
382
+ let(:non_matching_host) {
383
+ FactoryGirl.create(
384
+ :mdm_host,
385
+ address: non_matching_host_address,
386
+ name: non_matching_host_name,
387
+ os_flavor: non_matching_host_os_flavor,
388
+ os_name: non_matching_host_os_name,
389
+ os_sp: non_matching_host_os_sp,
390
+ workspace: non_matching_credential_core.workspace
391
+ )
392
+ }
393
+
394
+ let(:non_matching_host_address) {
395
+ '5.6.7.8'
396
+ }
397
+
398
+ let(:non_matching_host_name) {
399
+ 'mdm_host_name_b'
400
+ }
401
+
402
+ let(:non_matching_host_os_flavor) {
403
+ 'mdm_host_os_flavor_b'
404
+ }
405
+
406
+ let(:non_matching_host_os_name) {
407
+ 'mdm_host_os_name_b'
408
+ }
409
+
410
+ let(:non_matching_host_os_sp) {
411
+ 'mdm_host_os_sp_b'
412
+ }
413
+
414
+ let(:non_matching_service) {
415
+ FactoryGirl.create(
416
+ :mdm_service,
417
+ host: non_matching_host,
418
+ info: non_matching_service_info,
419
+ name: non_matching_service_name,
420
+ port: non_matching_service_port,
421
+ proto: non_matching_service_proto
422
+ )
423
+ }
424
+
425
+ let(:non_matching_service_info) {
426
+ 'mdm_service_info_b'
427
+ }
428
+
429
+ let(:non_matching_service_name) {
430
+ 'mdm_service_name_b'
431
+ }
432
+
433
+ let(:non_matching_service_port) {
434
+ 2
435
+ }
436
+
437
+ let(:non_matching_service_proto) {
438
+ 'udp'
439
+ }
440
+
310
441
  #
311
442
  # let!s
312
443
  #
@@ -314,25 +445,158 @@ describe MetasploitDataModels::Search::Visitor::Relation do
314
445
  let!(:matching_record) {
315
446
  FactoryGirl.create(
316
447
  :metasploit_credential_login,
317
- access_level: matching_access_level
448
+ access_level: matching_access_level,
449
+ core: matching_credential_core,
450
+ service: matching_service
318
451
  )
319
452
  }
320
453
 
321
454
  let!(:non_matching_record) {
322
455
  FactoryGirl.create(
323
456
  :metasploit_credential_login,
324
- access_level: non_matching_access_level
457
+ access_level: non_matching_access_level,
458
+ core: non_matching_credential_core,
459
+ service: non_matching_service
325
460
  )
326
461
  }
327
462
 
328
463
  it_should_behave_like 'MetasploitDataModels::Search::Visitor::Relation#visit matching record',
329
464
  attribute: :access_level
465
+
330
466
  it_should_behave_like 'MetasploitDataModels::Search::Visitor::Relation#visit matching record',
331
467
  attribute: :status
332
468
 
469
+
470
+ context 'with host.address operator' do
471
+ let(:formatted) do
472
+ "host.address:#{formatted_address}"
473
+ end
474
+
475
+ context 'with CIDR' do
476
+ let(:formatted_address) {
477
+ '1.3.4.5/8'
478
+ }
479
+
480
+ it 'should find only matching record' do
481
+ expect(visit).to match_array([matching_record])
482
+ end
483
+ end
484
+
485
+ context 'with Range' do
486
+ let(:formatted_address) {
487
+ '1.1.1.1-5.6.7.7'
488
+ }
489
+
490
+ it 'should find only matching record' do
491
+ expect(visit).to match_array([matching_record])
492
+ end
493
+ end
494
+
495
+ context 'with single' do
496
+ let(:formatted_address) {
497
+ '1.2.3.4'
498
+ }
499
+
500
+ it 'should find only matching record' do
501
+ expect(visit).to match_array([matching_record])
502
+ end
503
+ end
504
+ end
505
+
506
+ context 'with host.os' do
507
+ let(:matching_host_os_flavor) {
508
+ 'XP'
509
+ }
510
+
511
+ let(:matching_host_os_name) {
512
+ 'Microsoft Windows'
513
+ }
514
+
515
+ let(:matching_host_os_sp) {
516
+ 'SP1'
517
+ }
518
+
519
+ context 'with a combination of Mdm::Host#os_name and Mdm:Host#os_sp' do
520
+ let(:formatted) {
521
+ %Q{host.os:"win xp"}
522
+ }
523
+
524
+ it 'finds matching record' do
525
+ expect(visit).to match_array [matching_record]
526
+ end
527
+ end
528
+
529
+ context 'with a combination of Mdm::Host#os_flavor and Mdm::Host#os_sp' do
530
+ let(:formatted) {
531
+ %Q{host.os:"xp sp1"}
532
+ }
533
+
534
+ it 'finds matching record' do
535
+ expect(visit).to match_array [matching_record]
536
+ end
537
+ end
538
+
539
+ context 'with multiple records matching one word' do
540
+ let(:formatted) {
541
+ %Q{host.os:"win xp"}
542
+ }
543
+
544
+ let(:non_matching_host_os_name) {
545
+ 'Microsoft Windows'
546
+ }
547
+
548
+ it 'finds only matching record by other words refining search' do
549
+ expect(visit).to match_array [matching_record]
550
+ end
551
+ end
552
+ end
553
+
554
+ it_should_behave_like 'MetasploitDataModels::Search::Visitor::Relation#visit matching record',
555
+ association: :host,
556
+ attribute: :name
557
+
558
+ it_should_behave_like 'MetasploitDataModels::Search::Visitor::Relation#visit matching record',
559
+ association: :host,
560
+ attribute: :os_flavor
561
+
562
+ it_should_behave_like 'MetasploitDataModels::Search::Visitor::Relation#visit matching record',
563
+ association: :host,
564
+ attribute: :os_name
565
+
566
+ it_should_behave_like 'MetasploitDataModels::Search::Visitor::Relation#visit matching record',
567
+ association: :host,
568
+ attribute: :os_sp
569
+
570
+ it_should_behave_like 'MetasploitDataModels::Search::Visitor::Relation#visit matching record',
571
+ association: :service,
572
+ attribute: :info
573
+
574
+ it_should_behave_like 'MetasploitDataModels::Search::Visitor::Relation#visit matching record',
575
+ association: :service,
576
+ attribute: :name
577
+
578
+ it_should_behave_like 'MetasploitDataModels::Search::Visitor::Relation#visit matching record',
579
+ association: :service,
580
+ attribute: :proto
581
+
333
582
  context 'with all operators' do
334
583
  let(:formatted) {
335
- %Q{access_level:"#{matching_access_level}" status:"#{matching_status}"}
584
+ %Q{
585
+ access_level:"#{matching_access_level}"
586
+ status:"#{matching_status}"
587
+ host.address:1.3.4.5/8
588
+ host.address:1.1.1.1-5.6.7.7
589
+ host.address:1.2.3.4
590
+ host.name:#{matching_host_name}
591
+ host.os:"#{matching_host_os_name} #{matching_host_os_flavor} #{matching_host_os_sp}"
592
+ host.os_flavor:#{matching_host_os_flavor}
593
+ host.os_name:#{matching_host_os_name}
594
+ host.os_sp:#{matching_host_os_sp}
595
+ service.info:#{matching_service_info}
596
+ service.name:#{matching_service_name}
597
+ service.port:#{matching_service_port}
598
+ service.proto:#{matching_service_proto}
599
+ }
336
600
  }
337
601
 
338
602
  it 'returns only matching record' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metasploit-credential
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.16
4
+ version: 0.7.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Imhoff
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-07-28 00:00:00.000000000 Z
12
+ date: 2014-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: metasploit-concern
@@ -31,28 +31,28 @@ dependencies:
31
31
  requirements:
32
32
  - - ~>
33
33
  - !ruby/object:Gem::Version
34
- version: '0.19'
34
+ version: 0.19.4
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - ~>
40
40
  - !ruby/object:Gem::Version
41
- version: '0.19'
41
+ version: 0.19.4
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: metasploit-model
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - ! '>='
46
+ - - ~>
47
47
  - !ruby/object:Gem::Version
48
- version: 0.25.6
48
+ version: 0.26.1
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - ! '>='
53
+ - - ~>
54
54
  - !ruby/object:Gem::Version
55
- version: 0.25.6
55
+ version: 0.26.1
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: rubyntlm
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -198,7 +198,7 @@ files:
198
198
  - spec/dummy/config/initializers/wrap_parameters.rb
199
199
  - spec/dummy/config/locales/en.yml
200
200
  - spec/dummy/config/routes.rb
201
- - spec/dummy/db/schema.rb
201
+ - spec/dummy/db/structure.sql
202
202
  - spec/dummy/log/development.log
203
203
  - spec/dummy/log/test.log
204
204
  - spec/dummy/public/404.html
@@ -315,7 +315,7 @@ test_files:
315
315
  - spec/dummy/config/initializers/wrap_parameters.rb
316
316
  - spec/dummy/config/locales/en.yml
317
317
  - spec/dummy/config/routes.rb
318
- - spec/dummy/db/schema.rb
318
+ - spec/dummy/db/structure.sql
319
319
  - spec/dummy/log/development.log
320
320
  - spec/dummy/log/test.log
321
321
  - spec/dummy/public/404.html
@@ -1,720 +0,0 @@
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 => 20140722174919) 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 "clients", :force => true do |t|
23
- t.integer "host_id"
24
- t.datetime "created_at"
25
- t.string "ua_string", :limit => 1024, :null => false
26
- t.string "ua_name", :limit => 64
27
- t.string "ua_ver", :limit => 32
28
- t.datetime "updated_at"
29
- end
30
-
31
- create_table "credential_cores_tasks", :id => false, :force => true do |t|
32
- t.integer "core_id"
33
- t.integer "task_id"
34
- end
35
-
36
- create_table "credential_logins_tasks", :id => false, :force => true do |t|
37
- t.integer "login_id"
38
- t.integer "task_id"
39
- end
40
-
41
- create_table "creds", :force => true do |t|
42
- t.integer "service_id", :null => false
43
- t.datetime "created_at", :null => false
44
- t.datetime "updated_at", :null => false
45
- t.string "user", :limit => 2048
46
- t.string "pass", :limit => 4096
47
- t.boolean "active", :default => true
48
- t.string "proof", :limit => 4096
49
- t.string "ptype", :limit => 256
50
- t.integer "source_id"
51
- t.string "source_type"
52
- end
53
-
54
- create_table "events", :force => true do |t|
55
- t.integer "workspace_id"
56
- t.integer "host_id"
57
- t.datetime "created_at"
58
- t.string "name"
59
- t.datetime "updated_at"
60
- t.boolean "critical"
61
- t.boolean "seen"
62
- t.string "username"
63
- t.text "info"
64
- end
65
-
66
- create_table "exploit_attempts", :force => true do |t|
67
- t.integer "host_id"
68
- t.integer "service_id"
69
- t.integer "vuln_id"
70
- t.datetime "attempted_at"
71
- t.boolean "exploited"
72
- t.string "fail_reason"
73
- t.string "username"
74
- t.text "module"
75
- t.integer "session_id"
76
- t.integer "loot_id"
77
- t.integer "port"
78
- t.string "proto"
79
- t.text "fail_detail"
80
- end
81
-
82
- create_table "exploited_hosts", :force => true do |t|
83
- t.integer "host_id", :null => false
84
- t.integer "service_id"
85
- t.string "session_uuid", :limit => 8
86
- t.string "name", :limit => 2048
87
- t.string "payload", :limit => 2048
88
- t.datetime "created_at", :null => false
89
- t.datetime "updated_at", :null => false
90
- end
91
-
92
- create_table "host_details", :force => true do |t|
93
- t.integer "host_id"
94
- t.integer "nx_console_id"
95
- t.integer "nx_device_id"
96
- t.string "src"
97
- t.string "nx_site_name"
98
- t.string "nx_site_importance"
99
- t.string "nx_scan_template"
100
- t.float "nx_risk_score"
101
- end
102
-
103
- create_table "hosts", :force => true do |t|
104
- t.datetime "created_at"
105
- t.string "address", :null => false
106
- t.string "mac"
107
- t.string "comm"
108
- t.string "name"
109
- t.string "state"
110
- t.string "os_name"
111
- t.string "os_flavor"
112
- t.string "os_sp"
113
- t.string "os_lang"
114
- t.string "arch"
115
- t.integer "workspace_id", :null => false
116
- t.datetime "updated_at"
117
- t.text "purpose"
118
- t.string "info", :limit => 65536
119
- t.text "comments"
120
- t.text "scope"
121
- t.text "virtual_host"
122
- t.integer "note_count", :default => 0
123
- t.integer "vuln_count", :default => 0
124
- t.integer "service_count", :default => 0
125
- t.integer "host_detail_count", :default => 0
126
- t.integer "exploit_attempt_count", :default => 0
127
- t.integer "cred_count", :default => 0
128
- end
129
-
130
- add_index "hosts", ["name"], :name => "index_hosts_on_name"
131
- add_index "hosts", ["os_flavor"], :name => "index_hosts_on_os_flavor"
132
- add_index "hosts", ["os_name"], :name => "index_hosts_on_os_name"
133
- add_index "hosts", ["purpose"], :name => "index_hosts_on_purpose"
134
- add_index "hosts", ["state"], :name => "index_hosts_on_state"
135
- add_index "hosts", ["workspace_id", "address"], :name => "index_hosts_on_workspace_id_and_address", :unique => true
136
-
137
- create_table "hosts_tags", :force => true do |t|
138
- t.integer "host_id"
139
- t.integer "tag_id"
140
- end
141
-
142
- create_table "listeners", :force => true do |t|
143
- t.datetime "created_at", :null => false
144
- t.datetime "updated_at", :null => false
145
- t.integer "workspace_id", :default => 1, :null => false
146
- t.integer "task_id"
147
- t.boolean "enabled", :default => true
148
- t.text "owner"
149
- t.text "payload"
150
- t.text "address"
151
- t.integer "port"
152
- t.binary "options"
153
- t.text "macro"
154
- end
155
-
156
- create_table "loots", :force => true do |t|
157
- t.integer "workspace_id", :default => 1, :null => false
158
- t.integer "host_id"
159
- t.integer "service_id"
160
- t.string "ltype", :limit => 512
161
- t.string "path", :limit => 1024
162
- t.text "data"
163
- t.datetime "created_at", :null => false
164
- t.datetime "updated_at", :null => false
165
- t.string "content_type"
166
- t.text "name"
167
- t.text "info"
168
- end
169
-
170
- create_table "macros", :force => true do |t|
171
- t.datetime "created_at", :null => false
172
- t.datetime "updated_at", :null => false
173
- t.text "owner"
174
- t.text "name"
175
- t.text "description"
176
- t.binary "actions"
177
- t.binary "prefs"
178
- end
179
-
180
- create_table "metasploit_credential_cores", :force => true do |t|
181
- t.integer "origin_id", :null => false
182
- t.string "origin_type", :null => false
183
- t.integer "private_id"
184
- t.integer "public_id"
185
- t.integer "realm_id"
186
- t.integer "workspace_id", :null => false
187
- t.datetime "created_at", :null => false
188
- t.datetime "updated_at", :null => false
189
- t.integer "logins_count", :default => 0
190
- end
191
-
192
- add_index "metasploit_credential_cores", ["origin_type", "origin_id"], :name => "index_metasploit_credential_cores_on_origin_type_and_origin_id"
193
- add_index "metasploit_credential_cores", ["private_id"], :name => "index_metasploit_credential_cores_on_private_id"
194
- add_index "metasploit_credential_cores", ["public_id"], :name => "index_metasploit_credential_cores_on_public_id"
195
- add_index "metasploit_credential_cores", ["realm_id"], :name => "index_metasploit_credential_cores_on_realm_id"
196
- add_index "metasploit_credential_cores", ["workspace_id"], :name => "index_metasploit_credential_cores_on_workspace_id"
197
-
198
- create_table "metasploit_credential_logins", :force => true do |t|
199
- t.integer "core_id", :null => false
200
- t.integer "service_id", :null => false
201
- t.string "access_level"
202
- t.string "status", :null => false
203
- t.datetime "last_attempted_at"
204
- t.datetime "created_at", :null => false
205
- t.datetime "updated_at", :null => false
206
- end
207
-
208
- add_index "metasploit_credential_logins", ["core_id", "service_id"], :name => "index_metasploit_credential_logins_on_core_id_and_service_id", :unique => true
209
- add_index "metasploit_credential_logins", ["service_id", "core_id"], :name => "index_metasploit_credential_logins_on_service_id_and_core_id", :unique => true
210
-
211
- create_table "metasploit_credential_origin_cracked_passwords", :force => true do |t|
212
- t.integer "metasploit_credential_core_id", :null => false
213
- t.datetime "created_at", :null => false
214
- t.datetime "updated_at", :null => false
215
- end
216
-
217
- add_index "metasploit_credential_origin_cracked_passwords", ["metasploit_credential_core_id"], :name => "originating_credential_cores"
218
-
219
- create_table "metasploit_credential_origin_imports", :force => true do |t|
220
- t.text "filename", :null => false
221
- t.integer "task_id"
222
- t.datetime "created_at", :null => false
223
- t.datetime "updated_at", :null => false
224
- end
225
-
226
- add_index "metasploit_credential_origin_imports", ["task_id"], :name => "index_metasploit_credential_origin_imports_on_task_id"
227
-
228
- create_table "metasploit_credential_origin_manuals", :force => true do |t|
229
- t.integer "user_id", :null => false
230
- t.datetime "created_at", :null => false
231
- t.datetime "updated_at", :null => false
232
- end
233
-
234
- add_index "metasploit_credential_origin_manuals", ["user_id"], :name => "index_metasploit_credential_origin_manuals_on_user_id"
235
-
236
- create_table "metasploit_credential_origin_services", :force => true do |t|
237
- t.integer "service_id", :null => false
238
- t.text "module_full_name", :null => false
239
- t.datetime "created_at", :null => false
240
- t.datetime "updated_at", :null => false
241
- end
242
-
243
- add_index "metasploit_credential_origin_services", ["service_id", "module_full_name"], :name => "unique_metasploit_credential_origin_services", :unique => true
244
-
245
- create_table "metasploit_credential_origin_sessions", :force => true do |t|
246
- t.text "post_reference_name", :null => false
247
- t.integer "session_id", :null => false
248
- t.datetime "created_at", :null => false
249
- t.datetime "updated_at", :null => false
250
- end
251
-
252
- add_index "metasploit_credential_origin_sessions", ["session_id", "post_reference_name"], :name => "unique_metasploit_credential_origin_sessions", :unique => true
253
-
254
- create_table "metasploit_credential_privates", :force => true do |t|
255
- t.string "type", :null => false
256
- t.text "data", :null => false
257
- t.datetime "created_at", :null => false
258
- t.datetime "updated_at", :null => false
259
- t.string "jtr_format"
260
- end
261
-
262
- add_index "metasploit_credential_privates", ["type", "data"], :name => "index_metasploit_credential_privates_on_type_and_data", :unique => true
263
-
264
- create_table "metasploit_credential_publics", :force => true do |t|
265
- t.string "username", :null => false
266
- t.datetime "created_at", :null => false
267
- t.datetime "updated_at", :null => false
268
- end
269
-
270
- add_index "metasploit_credential_publics", ["username"], :name => "index_metasploit_credential_publics_on_username", :unique => true
271
-
272
- create_table "metasploit_credential_realms", :force => true do |t|
273
- t.string "key", :null => false
274
- t.string "value", :null => false
275
- t.datetime "created_at", :null => false
276
- t.datetime "updated_at", :null => false
277
- end
278
-
279
- add_index "metasploit_credential_realms", ["key", "value"], :name => "index_metasploit_credential_realms_on_key_and_value", :unique => true
280
-
281
- create_table "mod_refs", :force => true do |t|
282
- t.string "module", :limit => 1024
283
- t.string "mtype", :limit => 128
284
- t.text "ref"
285
- end
286
-
287
- create_table "module_actions", :force => true do |t|
288
- t.integer "detail_id"
289
- t.text "name"
290
- end
291
-
292
- add_index "module_actions", ["detail_id"], :name => "index_module_actions_on_module_detail_id"
293
-
294
- create_table "module_archs", :force => true do |t|
295
- t.integer "detail_id"
296
- t.text "name"
297
- end
298
-
299
- add_index "module_archs", ["detail_id"], :name => "index_module_archs_on_module_detail_id"
300
-
301
- create_table "module_authors", :force => true do |t|
302
- t.integer "detail_id"
303
- t.text "name"
304
- t.text "email"
305
- end
306
-
307
- add_index "module_authors", ["detail_id"], :name => "index_module_authors_on_module_detail_id"
308
-
309
- create_table "module_details", :force => true do |t|
310
- t.datetime "mtime"
311
- t.text "file"
312
- t.string "mtype"
313
- t.text "refname"
314
- t.text "fullname"
315
- t.text "name"
316
- t.integer "rank"
317
- t.text "description"
318
- t.string "license"
319
- t.boolean "privileged"
320
- t.datetime "disclosure_date"
321
- t.integer "default_target"
322
- t.text "default_action"
323
- t.string "stance"
324
- t.boolean "ready"
325
- end
326
-
327
- add_index "module_details", ["description"], :name => "index_module_details_on_description"
328
- add_index "module_details", ["mtype"], :name => "index_module_details_on_mtype"
329
- add_index "module_details", ["name"], :name => "index_module_details_on_name"
330
- add_index "module_details", ["refname"], :name => "index_module_details_on_refname"
331
-
332
- create_table "module_mixins", :force => true do |t|
333
- t.integer "detail_id"
334
- t.text "name"
335
- end
336
-
337
- add_index "module_mixins", ["detail_id"], :name => "index_module_mixins_on_module_detail_id"
338
-
339
- create_table "module_platforms", :force => true do |t|
340
- t.integer "detail_id"
341
- t.text "name"
342
- end
343
-
344
- add_index "module_platforms", ["detail_id"], :name => "index_module_platforms_on_module_detail_id"
345
-
346
- create_table "module_refs", :force => true do |t|
347
- t.integer "detail_id"
348
- t.text "name"
349
- end
350
-
351
- add_index "module_refs", ["detail_id"], :name => "index_module_refs_on_module_detail_id"
352
- add_index "module_refs", ["name"], :name => "index_module_refs_on_name"
353
-
354
- create_table "module_targets", :force => true do |t|
355
- t.integer "detail_id"
356
- t.integer "index"
357
- t.text "name"
358
- end
359
-
360
- add_index "module_targets", ["detail_id"], :name => "index_module_targets_on_module_detail_id"
361
-
362
- create_table "nexpose_consoles", :force => true do |t|
363
- t.datetime "created_at", :null => false
364
- t.datetime "updated_at", :null => false
365
- t.boolean "enabled", :default => true
366
- t.text "owner"
367
- t.text "address"
368
- t.integer "port", :default => 3780
369
- t.text "username"
370
- t.text "password"
371
- t.text "status"
372
- t.text "version"
373
- t.text "cert"
374
- t.binary "cached_sites"
375
- t.text "name"
376
- end
377
-
378
- create_table "notes", :force => true do |t|
379
- t.datetime "created_at"
380
- t.string "ntype", :limit => 512
381
- t.integer "workspace_id", :default => 1, :null => false
382
- t.integer "service_id"
383
- t.integer "host_id"
384
- t.datetime "updated_at"
385
- t.boolean "critical"
386
- t.boolean "seen"
387
- t.text "data"
388
- end
389
-
390
- add_index "notes", ["ntype"], :name => "index_notes_on_ntype"
391
-
392
- create_table "profiles", :force => true do |t|
393
- t.datetime "created_at", :null => false
394
- t.datetime "updated_at", :null => false
395
- t.boolean "active", :default => true
396
- t.text "name"
397
- t.text "owner"
398
- t.binary "settings"
399
- end
400
-
401
- create_table "refs", :force => true do |t|
402
- t.integer "ref_id"
403
- t.datetime "created_at"
404
- t.string "name", :limit => 512
405
- t.datetime "updated_at"
406
- end
407
-
408
- add_index "refs", ["name"], :name => "index_refs_on_name"
409
-
410
- create_table "report_templates", :force => true do |t|
411
- t.integer "workspace_id", :default => 1, :null => false
412
- t.string "created_by"
413
- t.string "path", :limit => 1024
414
- t.text "name"
415
- t.datetime "created_at", :null => false
416
- t.datetime "updated_at", :null => false
417
- end
418
-
419
- create_table "reports", :force => true do |t|
420
- t.integer "workspace_id", :default => 1, :null => false
421
- t.string "created_by"
422
- t.string "rtype"
423
- t.string "path", :limit => 1024
424
- t.text "options"
425
- t.datetime "created_at", :null => false
426
- t.datetime "updated_at", :null => false
427
- t.datetime "downloaded_at"
428
- t.integer "task_id"
429
- t.string "name", :limit => 63
430
- end
431
-
432
- create_table "routes", :force => true do |t|
433
- t.integer "session_id"
434
- t.string "subnet"
435
- t.string "netmask"
436
- end
437
-
438
- create_table "services", :force => true do |t|
439
- t.integer "host_id"
440
- t.datetime "created_at"
441
- t.integer "port", :null => false
442
- t.string "proto", :limit => 16, :null => false
443
- t.string "state"
444
- t.string "name"
445
- t.datetime "updated_at"
446
- t.text "info"
447
- end
448
-
449
- add_index "services", ["name"], :name => "index_services_on_name"
450
- add_index "services", ["port"], :name => "index_services_on_port"
451
- add_index "services", ["proto"], :name => "index_services_on_proto"
452
- add_index "services", ["state"], :name => "index_services_on_state"
453
-
454
- create_table "session_events", :force => true do |t|
455
- t.integer "session_id"
456
- t.string "etype"
457
- t.binary "command"
458
- t.binary "output"
459
- t.string "remote_path"
460
- t.string "local_path"
461
- t.datetime "created_at"
462
- end
463
-
464
- create_table "sessions", :force => true do |t|
465
- t.integer "host_id"
466
- t.string "stype"
467
- t.string "via_exploit"
468
- t.string "via_payload"
469
- t.string "desc"
470
- t.integer "port"
471
- t.string "platform"
472
- t.text "datastore"
473
- t.datetime "opened_at", :null => false
474
- t.datetime "closed_at"
475
- t.string "close_reason"
476
- t.integer "local_id"
477
- t.datetime "last_seen"
478
- end
479
-
480
- create_table "tags", :force => true do |t|
481
- t.integer "user_id"
482
- t.string "name", :limit => 1024
483
- t.text "desc"
484
- t.boolean "report_summary", :default => false, :null => false
485
- t.boolean "report_detail", :default => false, :null => false
486
- t.boolean "critical", :default => false, :null => false
487
- t.datetime "created_at", :null => false
488
- t.datetime "updated_at", :null => false
489
- end
490
-
491
- create_table "task_creds", :force => true do |t|
492
- t.integer "task_id", :null => false
493
- t.integer "cred_id", :null => false
494
- t.datetime "created_at", :null => false
495
- t.datetime "updated_at", :null => false
496
- end
497
-
498
- create_table "task_hosts", :force => true do |t|
499
- t.integer "task_id", :null => false
500
- t.integer "host_id", :null => false
501
- t.datetime "created_at", :null => false
502
- t.datetime "updated_at", :null => false
503
- end
504
-
505
- create_table "task_services", :force => true do |t|
506
- t.integer "task_id", :null => false
507
- t.integer "service_id", :null => false
508
- t.datetime "created_at", :null => false
509
- t.datetime "updated_at", :null => false
510
- end
511
-
512
- create_table "task_sessions", :force => true do |t|
513
- t.integer "task_id", :null => false
514
- t.integer "session_id", :null => false
515
- t.datetime "created_at", :null => false
516
- t.datetime "updated_at", :null => false
517
- end
518
-
519
- create_table "tasks", :force => true do |t|
520
- t.integer "workspace_id", :default => 1, :null => false
521
- t.string "created_by"
522
- t.string "module"
523
- t.datetime "completed_at"
524
- t.string "path", :limit => 1024
525
- t.string "info"
526
- t.string "description"
527
- t.integer "progress"
528
- t.text "options"
529
- t.text "error"
530
- t.datetime "created_at", :null => false
531
- t.datetime "updated_at", :null => false
532
- t.text "result"
533
- t.string "module_uuid", :limit => 8
534
- t.binary "settings"
535
- end
536
-
537
- create_table "users", :force => true do |t|
538
- t.string "username"
539
- t.string "crypted_password"
540
- t.string "password_salt"
541
- t.string "persistence_token"
542
- t.datetime "created_at", :null => false
543
- t.datetime "updated_at", :null => false
544
- t.string "fullname"
545
- t.string "email"
546
- t.string "phone"
547
- t.string "company"
548
- t.string "prefs", :limit => 524288
549
- t.boolean "admin", :default => true, :null => false
550
- end
551
-
552
- create_table "vuln_attempts", :force => true do |t|
553
- t.integer "vuln_id"
554
- t.datetime "attempted_at"
555
- t.boolean "exploited"
556
- t.string "fail_reason"
557
- t.string "username"
558
- t.text "module"
559
- t.integer "session_id"
560
- t.integer "loot_id"
561
- t.text "fail_detail"
562
- end
563
-
564
- create_table "vuln_details", :force => true do |t|
565
- t.integer "vuln_id"
566
- t.float "cvss_score"
567
- t.string "cvss_vector"
568
- t.string "title"
569
- t.text "description"
570
- t.text "solution"
571
- t.binary "proof"
572
- t.integer "nx_console_id"
573
- t.integer "nx_device_id"
574
- t.string "nx_vuln_id"
575
- t.float "nx_severity"
576
- t.float "nx_pci_severity"
577
- t.datetime "nx_published"
578
- t.datetime "nx_added"
579
- t.datetime "nx_modified"
580
- t.text "nx_tags"
581
- t.text "nx_vuln_status"
582
- t.text "nx_proof_key"
583
- t.string "src"
584
- t.integer "nx_scan_id"
585
- t.datetime "nx_vulnerable_since"
586
- t.string "nx_pci_compliance_status"
587
- end
588
-
589
- create_table "vulns", :force => true do |t|
590
- t.integer "host_id"
591
- t.integer "service_id"
592
- t.datetime "created_at"
593
- t.string "name"
594
- t.datetime "updated_at"
595
- t.string "info", :limit => 65536
596
- t.datetime "exploited_at"
597
- t.integer "vuln_detail_count", :default => 0
598
- t.integer "vuln_attempt_count", :default => 0
599
- end
600
-
601
- add_index "vulns", ["name"], :name => "index_vulns_on_name"
602
-
603
- create_table "vulns_refs", :force => true do |t|
604
- t.integer "ref_id"
605
- t.integer "vuln_id"
606
- end
607
-
608
- create_table "web_forms", :force => true do |t|
609
- t.integer "web_site_id", :null => false
610
- t.datetime "created_at", :null => false
611
- t.datetime "updated_at", :null => false
612
- t.text "path"
613
- t.string "method", :limit => 1024
614
- t.text "params"
615
- t.text "query"
616
- end
617
-
618
- add_index "web_forms", ["path"], :name => "index_web_forms_on_path"
619
-
620
- create_table "web_pages", :force => true do |t|
621
- t.integer "web_site_id", :null => false
622
- t.datetime "created_at", :null => false
623
- t.datetime "updated_at", :null => false
624
- t.text "path"
625
- t.text "query"
626
- t.integer "code", :null => false
627
- t.text "cookie"
628
- t.text "auth"
629
- t.text "ctype"
630
- t.datetime "mtime"
631
- t.text "location"
632
- t.text "headers"
633
- t.binary "body"
634
- t.binary "request"
635
- end
636
-
637
- add_index "web_pages", ["path"], :name => "index_web_pages_on_path"
638
- add_index "web_pages", ["query"], :name => "index_web_pages_on_query"
639
-
640
- create_table "web_sites", :force => true do |t|
641
- t.integer "service_id", :null => false
642
- t.datetime "created_at", :null => false
643
- t.datetime "updated_at", :null => false
644
- t.string "vhost", :limit => 2048
645
- t.text "comments"
646
- t.text "options"
647
- end
648
-
649
- add_index "web_sites", ["comments"], :name => "index_web_sites_on_comments"
650
- add_index "web_sites", ["options"], :name => "index_web_sites_on_options"
651
- add_index "web_sites", ["vhost"], :name => "index_web_sites_on_vhost"
652
-
653
- create_table "web_vulns", :force => true do |t|
654
- t.integer "web_site_id", :null => false
655
- t.datetime "created_at", :null => false
656
- t.datetime "updated_at", :null => false
657
- t.text "path", :null => false
658
- t.string "method", :limit => 1024, :null => false
659
- t.text "params", :null => false
660
- t.text "pname"
661
- t.integer "risk", :null => false
662
- t.string "name", :limit => 1024, :null => false
663
- t.text "query"
664
- t.text "category", :null => false
665
- t.integer "confidence", :null => false
666
- t.text "description"
667
- t.text "blame"
668
- t.binary "request"
669
- t.binary "proof", :null => false
670
- t.string "owner"
671
- t.text "payload"
672
- end
673
-
674
- add_index "web_vulns", ["method"], :name => "index_web_vulns_on_method"
675
- add_index "web_vulns", ["name"], :name => "index_web_vulns_on_name"
676
- add_index "web_vulns", ["path"], :name => "index_web_vulns_on_path"
677
-
678
- create_table "wmap_requests", :force => true do |t|
679
- t.string "host"
680
- t.string "address"
681
- t.integer "port"
682
- t.integer "ssl"
683
- t.string "meth", :limit => 32
684
- t.text "path"
685
- t.text "headers"
686
- t.text "query"
687
- t.text "body"
688
- t.string "respcode", :limit => 16
689
- t.text "resphead"
690
- t.text "response"
691
- t.datetime "created_at"
692
- t.datetime "updated_at"
693
- end
694
-
695
- create_table "wmap_targets", :force => true do |t|
696
- t.string "host"
697
- t.string "address"
698
- t.integer "port"
699
- t.integer "ssl"
700
- t.integer "selected"
701
- t.datetime "created_at"
702
- t.datetime "updated_at"
703
- end
704
-
705
- create_table "workspace_members", :id => false, :force => true do |t|
706
- t.integer "workspace_id", :null => false
707
- t.integer "user_id", :null => false
708
- end
709
-
710
- create_table "workspaces", :force => true do |t|
711
- t.string "name"
712
- t.datetime "created_at", :null => false
713
- t.datetime "updated_at", :null => false
714
- t.string "boundary", :limit => 4096
715
- t.string "description", :limit => 4096
716
- t.integer "owner_id"
717
- t.boolean "limit_to_network", :default => false, :null => false
718
- end
719
-
720
- end