metasploit-credential 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fc58a5e5ed24faced9c6f4b0a3e8a7c48304c65e
4
- data.tar.gz: fc29c201eb954f08ba9413b109c480b7dfcbd441
3
+ metadata.gz: f442d7c518fb88b5d296d632a798fa8251f79159
4
+ data.tar.gz: 580f1859d9614a66dc18ac39601469ac6a98fb3f
5
5
  SHA512:
6
- metadata.gz: 6b06e8e6dfd0150b0001fac184af6c10f9aa8942c85081fcb9c0e8854907b5ce2380c9242b7b91254a9a98e62b2b9186a5c84f38c78fe9dddeeb4d267d493239
7
- data.tar.gz: aec7f1d701c695945f0f8b6c64248bb6f6c03c4cc0bb6d9d71a9b07da18cef0d594fed5540c785aec091d17b5b9f342a208cdd4e0fa2bc4bfd705d4e25194f44
6
+ metadata.gz: cb6339e14224f2f123c9ee7c05da49c991fa1b2a9ec5e4c7cc568e0252c02f5025ea5981d91c5e47651291267751d799604528cd62c12249a1bc8f1985c22370
7
+ data.tar.gz: ec32a5757ef994c302f727e7fc4c5cdc5d898da74d65b65988f5dc76bcd3bfde33437fc624f3023e0ee90a56816f471f5cb762c25c2189def5fb91c10940e7c3
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -202,10 +202,12 @@ class Metasploit::Credential::Core < ActiveRecord::Base
202
202
  # @scope Metasploit::Credential::Core
203
203
  # @param host_id [Integer] the host to look up
204
204
  # @return [ActiveRecord::Relation] that contains related Cores
205
- scope :originating_host_id, lambda { |host_id|
206
- core_table = Metasploit::Credential::Core.arel_table
207
- subquery = Metasploit::Credential::Core.cores_from_host_sql(host_id)
208
- where(core_table[:id].in(Arel::Nodes::SqlLiteral.new(subquery)))
205
+ scope :originating_host_id, ->(host_id) {
206
+ where(
207
+ Metasploit::Credential::Core[:id].in(
208
+ Metasploit::Credential::Core.cores_from_host(host_id)
209
+ )
210
+ )
209
211
  }
210
212
 
211
213
  # Finds Cores that are attached to a given workspace
@@ -269,31 +271,18 @@ class Metasploit::Credential::Core < ActiveRecord::Base
269
271
  # Class Methods
270
272
  #
271
273
 
272
- # Wrapper to provide raw SQL string UNIONing cores from a host via
274
+ # Provides UNIONing cores from a host via
273
275
  # service origins or via session origins.
274
- # TODO: Fix this in Rails 4. In Rails 3 there is a known bug that prevents
275
- # .count from being called on the returned ActiveRecord::Relation.
276
- # https://github.com/rails/rails/issues/939
277
276
  # @param host_id [Integer]
278
277
  # @return [String]
279
- def self.cores_from_host_sql(host_id)
278
+ def self.cores_from_host(host_id)
280
279
  left = origin_service_host_id(host_id).ast
281
280
  right = origin_session_host_id(host_id).ast
282
281
 
283
- # TODO: Kill with fire. ActiveRecord 4.0.x leaks order/limit/offset scopes
284
- # We strip out order/limit/offset statements from the subquery since it's invalid SQL
285
- # https://github.com/rails/rails/issues/14003
286
- left.orders = []
287
- right.orders = []
288
- left.limit = nil
289
- right.limit = nil
290
- left.offset = nil
291
- right.offset = nil
292
-
293
- Arel::Nodes::Union.new(
294
- origin_service_host_id(host_id).ast,
295
- origin_session_host_id(host_id).ast
296
- ).to_sql
282
+ Arel::Nodes::UnionAll.new(
283
+ left,
284
+ right
285
+ )
297
286
  end
298
287
 
299
288
  #
@@ -192,7 +192,7 @@ class Metasploit::Credential::Login < ActiveRecord::Base
192
192
  Metasploit::Credential::Core[:id].in(
193
193
  # We are concerned with per-username access attempts. This
194
194
  # can be across any of the cores on a host:
195
- Arel::Nodes::SqlLiteral.new(Metasploit::Credential::Core.cores_from_host_sql(host_id))
195
+ Metasploit::Credential::Core.cores_from_host(host_id)
196
196
  ).and(
197
197
  Metasploit::Credential::Login[:status].in(
198
198
  [
@@ -3,7 +3,7 @@
3
3
  module Metasploit
4
4
  module Credential
5
5
  # VERSION is managed by GemRelease
6
- VERSION = '2.0.2'
6
+ VERSION = '2.0.3'
7
7
 
8
8
  # @return [String]
9
9
  #
@@ -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
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: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Imhoff
@@ -86,7 +86,7 @@ cert_chain:
86
86
  2SpuQH+SWteq3NXkAmFEEqvLJQ4sbptZt8OP8ghL3pVAvZNFmww/YVszSkShSzcg
87
87
  QdihYCSEL2drS2cFd50jBeq71sxUtxbv82DUa2b+
88
88
  -----END CERTIFICATE-----
89
- date: 2016-05-23 00:00:00.000000000 Z
89
+ date: 2016-05-31 00:00:00.000000000 Z
90
90
  dependencies:
91
91
  - !ruby/object:Gem::Dependency
92
92
  name: metasploit-concern
metadata.gz.sig CHANGED
Binary file