metasploit-credential 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/app/models/metasploit/credential/core.rb +2 -2
  5. data/lib/metasploit/credential/version.rb +1 -1
  6. data/lib/tasks/databases.rake +1 -0
  7. data/spec/dummy/bin/bundle +3 -0
  8. data/spec/dummy/bin/rails +4 -0
  9. data/spec/dummy/bin/rake +4 -0
  10. data/spec/dummy/config/application.rb +1 -1
  11. data/spec/dummy/config/boot.rb +3 -9
  12. data/spec/dummy/config/database.yml +2 -2
  13. data/spec/dummy/config/environment.rb +3 -3
  14. data/spec/dummy/config/environments/development.rb +18 -8
  15. data/spec/dummy/config/environments/production.rb +40 -28
  16. data/spec/dummy/config/environments/test.rb +15 -14
  17. data/spec/dummy/config/initializers/assets.rb +8 -0
  18. data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
  19. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  20. data/spec/dummy/config/initializers/inflections.rb +6 -5
  21. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  22. data/spec/dummy/config/initializers/session_store.rb +1 -6
  23. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  24. data/spec/dummy/config/routes.rb +23 -25
  25. data/spec/dummy/db/structure.sql +87 -84
  26. data/spec/lib/metasploit/credential/creation_spec.rb +1 -1
  27. data/spec/lib/metasploit/credential/exporter/core_spec.rb +1 -1
  28. data/spec/lib/metasploit/credential/exporter/pwdump_spec.rb +1 -1
  29. data/spec/lib/metasploit/credential/importer/core_spec.rb +1 -1
  30. data/spec/lib/metasploit/credential/importer/multi_spec.rb +1 -1
  31. data/spec/lib/metasploit/credential/importer/pwdump_spec.rb +1 -1
  32. data/spec/lib/metasploit/credential/importer/zip_spec.rb +1 -1
  33. data/spec/lib/metasploit/credential/migrator_spec.rb +1 -1
  34. data/spec/models/metasploit/credential/core_spec.rb +1 -1
  35. data/spec/models/metasploit/credential/login_spec.rb +6 -6
  36. data/spec/models/metasploit/credential/origin/import_spec.rb +1 -1
  37. data/spec/models/metasploit/credential/origin/service_spec.rb +1 -1
  38. data/spec/models/metasploit/credential/origin/session_spec.rb +2 -2
  39. data/spec/models/metasploit_data_models/search/visitor/relation_spec.rb +2 -2
  40. metadata +30 -20
  41. metadata.gz.sig +0 -0
  42. data/spec/support/shared/contexts/mdm/workspace.rb +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a90760c4188d3ce6e1bd95b802e0376b71ed9ad8
4
- data.tar.gz: c97d418f43a8f720e24842789ba4b6d0ca7940f9
3
+ metadata.gz: 2e0d0613fdf7b2c8d0a4220c2ba6e43e2e9011fc
4
+ data.tar.gz: 4143656d6719c242a3432bd9605e712d1e02ddfc
5
5
  SHA512:
6
- metadata.gz: a6ee036a556e2f76bc544f0744a2e1bf20e8b90ac51b62c3828d16dc818012d7377e7a00b956e452fe5eb15f475305fdb00c57f0857bef54928e69a109b72b29
7
- data.tar.gz: 1296775fd735c71e1997bf5a115a2b97edd498214db11ba5d8a0225e8f0c4ea2f00d8765dd2b511b47fea478bd5fe8f2bfae496b35776b1c81e5d26fbd14d424
6
+ metadata.gz: c46bbe2e0239165d6a1e0c9c8e7d35fb17f3cbcd9ca507e765194829efd024c9beb7184e30301039a6c02238039655432cfb125a88a8ae865af004ef92849b62
7
+ data.tar.gz: 50fbe6d9d09e791aeb383e481e3f0f5ea078e76e7e438c7a20cdffd75e62c7cd6d153aca585411b41d20376b9f140df97316b3ede160cfcd37a93975587c0beb
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -291,8 +291,8 @@ class Metasploit::Credential::Core < ActiveRecord::Base
291
291
  right.offset = nil
292
292
 
293
293
  Arel::Nodes::Union.new(
294
- left,
295
- right
294
+ origin_service_host_id(host_id).ast,
295
+ origin_session_host_id(host_id).ast
296
296
  ).to_sql
297
297
  end
298
298
 
@@ -3,7 +3,7 @@
3
3
  module Metasploit
4
4
  module Credential
5
5
  # VERSION is managed by GemRelease
6
- VERSION = '1.1.0'
6
+ VERSION = '2.0.0'
7
7
 
8
8
  # @return [String]
9
9
  #
@@ -3,5 +3,6 @@ namespace :db do
3
3
  task :load_config do
4
4
  # It's important to call to_a or the paths will just be relative and not realpaths
5
5
  ActiveRecord::Migrator.migrations_paths += MetasploitDataModels::Engine.instance.paths['db/migrate'].to_a
6
+ ActiveRecord::Tasks::DatabaseTasks.migrations_paths += MetasploitDataModels::Engine.instance.paths['db/migrate'].to_a
6
7
  end
7
8
  end
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -56,7 +56,7 @@ module Dummy
56
56
  config.active_record.schema_format = :sql
57
57
 
58
58
  # Enable the asset pipeline
59
- config.assets.enabled = true
59
+ config.assets.enabled = false
60
60
 
61
61
  # Version of your assets, change this if you want to expire all your assets
62
62
  config.assets.version = '1.0'
@@ -1,10 +1,4 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
1
+ # Set up gems listed in the Gemfile.
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
3
 
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)
4
+ require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
@@ -1,6 +1,6 @@
1
1
  development: &pgsql
2
2
  adapter: postgresql
3
- database: metasploit-credential_development0
3
+ database: metasploit-credential_development1
4
4
  username: msf
5
5
  password: pass123
6
6
  host: localhost
@@ -10,4 +10,4 @@ development: &pgsql
10
10
  min_messages: warning
11
11
  test:
12
12
  <<: *pgsql
13
- database: metasploit-credential_test0
13
+ database: metasploit-credential_test1
@@ -1,5 +1,5 @@
1
- # Load the rails application
1
+ # Load the Rails application.
2
2
  require File.expand_path('../application', __FILE__)
3
3
 
4
- # Initialize the rails application
5
- Dummy::Application.initialize!
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -1,5 +1,5 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # In the development environment your application's code is reloaded on
5
5
  # every request. This slows down response time but is perfect for development
@@ -9,16 +9,26 @@ Dummy::Application.configure do
9
9
  # Do not eager load code on boot.
10
10
  config.eager_load = false
11
11
 
12
- # Show full error reports and disable caching
12
+ # Show full error reports and disable caching.
13
13
  config.consider_all_requests_local = true
14
14
  config.action_controller.perform_caching = false
15
15
 
16
- # # Don't care if the mailer can't send
17
- # config.action_mailer.raise_delivery_errors = false
16
+ # Print deprecation notices to the Rails logger.
17
+ config.active_support.deprecation = :log
18
18
 
19
- # Do not compress assets
20
- config.assets.compress = false
19
+ # Raise an error on page load if there are pending migrations.
20
+ config.active_record.migration_error = :page_load
21
21
 
22
- # Expands the lines which load the assets
22
+ # Debug mode disables concatenation and preprocessing of assets.
23
+ # This option may cause significant delays in view rendering with a large
24
+ # number of complex assets.
23
25
  config.assets.debug = true
26
+
27
+ # Adds additional error checking when serving assets at runtime.
28
+ # Checks for improperly declared sprockets dependencies.
29
+ # Raises helpful error messages.
30
+ config.assets.raise_runtime_errors = true
31
+
32
+ # Raises error for missing translations
33
+ # config.action_view.raise_on_missing_translations = true
24
34
  end
@@ -1,66 +1,78 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
- # Code is not reloaded between requests
4
+ # Code is not reloaded between requests.
5
5
  config.cache_classes = true
6
-
6
+
7
7
  # Eager load code on boot. This eager loads most of Rails and
8
- # your application in memory, allowing both thread web servers
8
+ # your application in memory, allowing both threaded web servers
9
9
  # and those relying on copy on write to perform better.
10
10
  # Rake tasks automatically ignore this option for performance.
11
11
  config.eager_load = true
12
12
 
13
- # Full error reports are disabled and caching is turned on
13
+ # Full error reports are disabled and caching is turned on.
14
14
  config.consider_all_requests_local = false
15
15
  config.action_controller.perform_caching = true
16
16
 
17
- # Disable Rails's static asset server (Apache or nginx will already do this)
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
20
+ # config.action_dispatch.rack_cache = true
21
+
22
+ # Disable Rails's static asset server (Apache or nginx will already do this).
18
23
  config.serve_static_assets = false
19
24
 
20
- # Compress JavaScripts and CSS
21
- config.assets.compress = true
25
+ # Compress JavaScripts and CSS.
26
+ config.assets.js_compressor = :uglifier
27
+ # config.assets.css_compressor = :sass
22
28
 
23
- # Don't fallback to assets pipeline if a precompiled asset is missed
29
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
24
30
  config.assets.compile = false
25
31
 
26
- # Generate digests for assets URLs
32
+ # Generate digests for assets URLs.
27
33
  config.assets.digest = true
28
34
 
29
- # Defaults to nil and saved in location specified by config.assets.prefix
30
- # config.assets.manifest = YOUR_PATH
35
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
31
36
 
32
- # Specifies the header that your server uses for sending files
37
+ # Specifies the header that your server uses for sending files.
33
38
  # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
34
39
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
35
40
 
36
41
  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
37
42
  # config.force_ssl = true
38
43
 
39
- # See everything in the log (default is :info)
40
- # config.log_level = :debug
44
+ # Set to :debug to see everything in the log.
45
+ config.log_level = :info
41
46
 
42
- # Prepend all log lines with the following tags
47
+ # Prepend all log lines with the following tags.
43
48
  # config.log_tags = [ :subdomain, :uuid ]
44
49
 
45
- # Use a different logger for distributed setups
50
+ # Use a different logger for distributed setups.
46
51
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
47
52
 
48
- # Use a different cache store in production
53
+ # Use a different cache store in production.
49
54
  # config.cache_store = :mem_cache_store
50
55
 
51
- # Enable serving of images, stylesheets, and JavaScripts from an asset server
56
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
52
57
  # config.action_controller.asset_host = "http://assets.example.com"
53
58
 
54
- # Precompile additional assets (application.js, application.css, and all non-JS/CSS are already added)
55
- # config.assets.precompile += %w( search.js )
56
-
57
- # Disable delivery errors, bad email addresses will be ignored
59
+ # Ignore bad email addresses and do not raise email delivery errors.
60
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
58
61
  # config.action_mailer.raise_delivery_errors = false
59
62
 
60
- # Enable threaded mode
61
- # config.threadsafe!
62
-
63
63
  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
64
- # the I18n.default_locale when a translation can not be found)
64
+ # the I18n.default_locale when a translation cannot be found).
65
65
  config.i18n.fallbacks = true
66
+
67
+ # Send deprecation notices to registered listeners.
68
+ config.active_support.deprecation = :notify
69
+
70
+ # Disable automatic flushing of the log to improve performance.
71
+ # config.autoflush_log = false
72
+
73
+ # Use default logging formatter so that PID and timestamp are not suppressed.
74
+ config.log_formatter = ::Logger::Formatter.new
75
+
76
+ # Do not dump schema after migrations.
77
+ config.active_record.dump_schema_after_migration = false
66
78
  end
@@ -1,5 +1,5 @@
1
- Dummy::Application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
3
 
4
4
  # The test environment is used exclusively to run your application's
5
5
  # test suite. You never need to work with it otherwise. Remember that
@@ -12,23 +12,24 @@ Dummy::Application.configure do
12
12
  # preloads Rails for running tests, you may have to set it to true.
13
13
  config.eager_load = false
14
14
 
15
- # Configure static asset server for tests with Cache-Control for performance
16
- config.serve_static_assets = true
17
- config.static_cache_control = "public, max-age=3600"
15
+ # Configure static asset server for tests with Cache-Control for performance.
16
+ config.serve_static_assets = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
18
 
19
-
20
- # Show full error reports and disable caching
19
+ # Show full error reports and disable caching.
21
20
  config.consider_all_requests_local = true
22
21
  config.action_controller.perform_caching = false
23
22
 
24
- # Raise exceptions instead of rendering exception templates
23
+ # Raise exceptions instead of rendering exception templates.
25
24
  config.action_dispatch.show_exceptions = false
26
25
 
27
- # Disable request forgery protection in test environment
28
- config.action_controller.allow_forgery_protection = false
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+
30
+ # Print deprecation notices to the stderr.
31
+ config.active_support.deprecation = :stderr
29
32
 
30
- # # Tell Action Mailer not to deliver emails to the real world.
31
- # # The :test delivery method accumulates sent emails in the
32
- # # ActionMailer::Base.deliveries array.
33
- # config.action_mailer.delivery_method = :test
33
+ # Raises error for missing translations
34
+ # config.action_view.raise_on_missing_translations = true
34
35
  end
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Precompile additional assets.
7
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
8
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,3 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ Rails.application.config.action_dispatch.cookies_serializer = :marshal
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Configure sensitive parameters which will be filtered from the log file.
4
+ Rails.application.config.filter_parameters += [:password]
@@ -1,15 +1,16 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- # Add new inflection rules using the following format
4
- # (all these examples are active by default):
5
- # ActiveSupport::Inflector.inflections do |inflect|
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
6
7
  # inflect.plural /^(ox)$/i, '\1en'
7
8
  # inflect.singular /^(ox)en/i, '\1'
8
9
  # inflect.irregular 'person', 'people'
9
10
  # inflect.uncountable %w( fish sheep )
10
11
  # end
11
- #
12
+
12
13
  # These inflection rules are supported but not enabled by default:
13
- # ActiveSupport::Inflector.inflections do |inflect|
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
14
15
  # inflect.acronym 'RESTful'
15
16
  # end
@@ -2,4 +2,3 @@
2
2
 
3
3
  # Add new mime types for use in respond_to blocks:
4
4
  # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,8 +1,3 @@
1
1
  # Be sure to restart your server when you modify this file.
2
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
3
+ Rails.application.config.session_store :cookie_store, key: '_dummy_session'
@@ -1,14 +1,14 @@
1
1
  # Be sure to restart your server when you modify this file.
2
- #
2
+
3
3
  # This file contains settings for ActionController::ParamsWrapper which
4
4
  # is enabled by default.
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
8
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
9
9
  end
10
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
11
+ # To enable root element in JSON for ActiveRecord objects.
12
+ # ActiveSupport.on_load(:active_record) do
13
+ # self.include_root_in_json = true
14
+ # end
@@ -1,19 +1,20 @@
1
- Dummy::Application.routes.draw do
2
- # The priority is based upon order of creation:
3
- # first created -> highest priority.
1
+ Rails.application.routes.draw do
2
+ # The priority is based upon order of creation: first created -> highest priority.
3
+ # See how all your routes lay out with "rake routes".
4
4
 
5
- # Sample of regular route:
6
- # match 'products/:id' => 'catalog#view'
7
- # Keep in mind you can assign values other than :controller and :action
5
+ # You can have the root of your site routed with "root"
6
+ # root 'welcome#index'
7
+
8
+ # Example of regular route:
9
+ # get 'products/:id' => 'catalog#view'
8
10
 
9
- # Sample of named route:
10
- # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
11
- # This route can be invoked with purchase_url(:id => product.id)
11
+ # Example of named route that can be invoked with purchase_url(id: product.id)
12
+ # get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
12
13
 
13
- # Sample resource route (maps HTTP verbs to controller actions automatically):
14
+ # Example resource route (maps HTTP verbs to controller actions automatically):
14
15
  # resources :products
15
16
 
16
- # Sample resource route with options:
17
+ # Example resource route with options:
17
18
  # resources :products do
18
19
  # member do
19
20
  # get 'short'
@@ -25,34 +26,31 @@ Dummy::Application.routes.draw do
25
26
  # end
26
27
  # end
27
28
 
28
- # Sample resource route with sub-resources:
29
+ # Example resource route with sub-resources:
29
30
  # resources :products do
30
31
  # resources :comments, :sales
31
32
  # resource :seller
32
33
  # end
33
34
 
34
- # Sample resource route with more complex sub-resources
35
+ # Example resource route with more complex sub-resources:
35
36
  # resources :products do
36
37
  # resources :comments
37
38
  # resources :sales do
38
- # get 'recent', :on => :collection
39
+ # get 'recent', on: :collection
39
40
  # end
40
41
  # end
41
42
 
42
- # Sample resource route within a namespace:
43
+ # Example resource route with concerns:
44
+ # concern :toggleable do
45
+ # post 'toggle'
46
+ # end
47
+ # resources :posts, concerns: :toggleable
48
+ # resources :photos, concerns: :toggleable
49
+
50
+ # Example resource route within a namespace:
43
51
  # namespace :admin do
44
52
  # # Directs /admin/products/* to Admin::ProductsController
45
53
  # # (app/controllers/admin/products_controller.rb)
46
54
  # resources :products
47
55
  # end
48
-
49
- # You can have the root of your site routed with "root"
50
- # just remember to delete public/index.html.
51
- # root :to => 'welcome#index'
52
-
53
- # See how all your routes lay out with "rake routes"
54
-
55
- # This is a legacy wild controller route that's not recommended for RESTful applications.
56
- # Note: This route will make all actions in every controller accessible via GET requests.
57
- # match ':controller(/:action(/:id))(.:format)'
58
56
  end