metasploit-credential 5.0.4 → 5.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e8c662ab01206eb5505e4547ea2d0d092ef9a5dcd53b3e3d7a3f0e24080bc080
4
- data.tar.gz: 412d0c389cd2157da7e1594b4ed4f71cd97cd212673b52027a07fbb5dabbe266
3
+ metadata.gz: f619d2601985401f78215f264a5ca6b35e30395e76e118f00fbb2a19ff0be1d6
4
+ data.tar.gz: b85fbfcc6cb48a360b0baff638f79573c307cb1e6efd81f82ed8d2eb505fc998
5
5
  SHA512:
6
- metadata.gz: cf857bc495a3084d6d092bcd47bcefc77774e40a681d299ab6e9f63249f1095dfb8c8c5938663bbf060720ad0fac7716bd30536581b821801e8278c3c618c7ba
7
- data.tar.gz: b1296d879cfec2c95064f0fc38f46ab513cc7de077bfaeebd1c63a4b16383ec6b26a04a384eb95f180a4b419523e19a6864345c78cbd605f2901942fd68be97c
6
+ metadata.gz: e4b97eda489cf82ea347c190bb152aa04a33760bcfb2c77c898b82d378beadb3ad5ece4306acdc9b7c305b01a7c2ef25aed233eb46621a8e2495adb2d49b67de
7
+ data.tar.gz: 93ef61cbb0e3735e39dff2e91d21c8d28f09d0d9261150f199c38288fd5c66114966194db54a14386096b1db7b1ef735fd9c225ee8a2f9392daee646993f8526
checksums.yaml.gz.sig CHANGED
Binary file
@@ -224,7 +224,7 @@ class Metasploit::Credential::Importer::Core
224
224
  end
225
225
  if all_creds_valid
226
226
  core_opts.each do |item|
227
- if Metasploit::Credential::Core.where(public: item[:public], private: item[:private]).blank?
227
+ if Metasploit::Credential::Core.where(origin: item[:origin], workspace_id: item[:workspace_id], public: item[:public], private: item[:private]).blank?
228
228
  create_credential_core(item)
229
229
  end
230
230
  end
@@ -3,7 +3,7 @@
3
3
  module Metasploit
4
4
  module Credential
5
5
  # VERSION is managed by GemRelease
6
- VERSION = '5.0.4'
6
+ VERSION = '5.0.5'
7
7
 
8
8
  # @return [String]
9
9
  #
@@ -215,6 +215,31 @@ RSpec.describe Metasploit::Credential::Importer::Core do
215
215
  expect{core_csv_importer.import!}.to change(Metasploit::Credential::Core, :count).from(1).to(2)
216
216
  end
217
217
  end
218
+
219
+ describe "when the data in the CSV contains a duplicate from another workspace" do
220
+ let(:preexisting_cred_data) do
221
+ core_csv_importer.csv_object.gets
222
+ row = core_csv_importer.csv_object.first
223
+ core_csv_importer.csv_object.rewind
224
+ {
225
+ username: row['username'],
226
+ private_data: row['private_data'],
227
+ }
228
+ end
229
+
230
+ before(:example) do
231
+ core = Metasploit::Credential::Core.new
232
+ core.public = FactoryBot.create(:metasploit_credential_username, username: preexisting_cred_data[:username])
233
+ core.private = FactoryBot.create(:metasploit_credential_password, data: preexisting_cred_data[:private_data])
234
+ core.origin = FactoryBot.create(:metasploit_credential_origin_import)
235
+ core.workspace = FactoryBot.create(:mdm_workspace)
236
+ core.save!
237
+ end
238
+
239
+ it 'should create a new Metasploit::Credential::Core for each row in the import' do
240
+ expect{core_csv_importer.import!}.to change(Metasploit::Credential::Core, :count).from(1).to(3)
241
+ end
242
+ end
218
243
  end
219
244
  end
220
245
 
data.tar.gz.sig CHANGED
Binary file
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: 5.0.4
4
+ version: 5.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Metasploit Hackers
@@ -93,7 +93,7 @@ cert_chain:
93
93
  EknWpNgVhohbot1lfVAMmIhdtOVaRVcQQixWPwprDj/ydB8ryDMDosIMcw+fkoXU
94
94
  9GJsSaSRRYQ9UUkVL27b64okU8D48m8=
95
95
  -----END CERTIFICATE-----
96
- date: 2021-09-03 00:00:00.000000000 Z
96
+ date: 2021-09-27 00:00:00.000000000 Z
97
97
  dependencies:
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: metasploit-concern
metadata.gz.sig CHANGED
Binary file