metasploit-credential 5.0.3 → 5.0.6

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: 2c30255adfe87ad5c2e2ff459e86629696de47102735fdc9ba94263d686e6d37
4
- data.tar.gz: fa2a50d36ab8cf89240765b1bf4ec7d43aa05bdd98ea3a95db49259254798727
3
+ metadata.gz: 86a500eec0075de53cd66a150f8ac92c5ff93cb7a86deba97d7232704ad61683
4
+ data.tar.gz: 73e8dae5337c8608070417445ec99fb4b5e1de340baab42a8d723a7ecb262a61
5
5
  SHA512:
6
- metadata.gz: c23dd9a56fe58ba521f4aef6e084fde11c636d8574a29eb4a2c5b36caa3dddaff4aab3427c27a9069abf4ad738918c0274fd2a4297722b649a5a7f7fab1785e6
7
- data.tar.gz: d0fcdb1ad1641688a44ba55e5b6170b534e6881677c482973587facff9460098cfeeb30b48b0262b194f9e90fa572ea673ad93a39462d00cee3442b9ba2d00da
6
+ metadata.gz: 1cca1af29a6b39d79be942d49f21377f127f881c344b9827765f1d54da2d41e16a94b8d706ff5234bf47d65cc9c8058fd2367f3c0731db19f1383b319882ec07
7
+ data.tar.gz: 6f1ee1774ce0215d50af37b9e861fdedc41bf056c9e47621cd21b3c3914fa8044515227112a12802f1e5b1c4a80ab61f714b073c7f92aa2fd0681650e9be2618
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.3'
6
+ VERSION = '5.0.6'
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_development3
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_test3
@@ -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.3
4
+ version: 5.0.6
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-06-07 00:00:00.000000000 Z
96
+ date: 2022-04-05 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