metasploit_data_models 4.0.1 → 4.0.2
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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/app/models/mdm/note.rb +1 -1
- data/lib/metasploit_data_models/version.rb +1 -1
- data/spec/app/models/mdm/host_spec.rb +27 -27
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7160a9465ddf37341f8823e9523185b042f1fb99db31e42a79aa25b583ddb676
|
|
4
|
+
data.tar.gz: dfff423e1f177a6bdc6bc85b84225c3a243e2528283e49185d188c76d04808c1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c60f29e7ebff8b3c2f1aa0e7a10a9c06a07f186f57c3539deb24419ba65b5d004897ecada92e313b19c38f37c634dcf2dc55765aea3e0e1ae2b126f6748e597
|
|
7
|
+
data.tar.gz: 501f97755d40903d2e25b3476538e498f650209df40c9522e98ddf7eb6ab1bd716e28454eb0ceb289991e22a400b10feb0665e776f0f4d4ee55822888247466f
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data.tar.gz.sig
CHANGED
|
Binary file
|
data/app/models/mdm/note.rb
CHANGED
|
@@ -113,7 +113,7 @@ class Mdm::Note < ApplicationRecord
|
|
|
113
113
|
#
|
|
114
114
|
# @return [void]
|
|
115
115
|
def normalize
|
|
116
|
-
if
|
|
116
|
+
if saved_change_to_data? and ntype =~ /fingerprint/ && host.workspace.present? && !host.workspace.import_fingerprint
|
|
117
117
|
host.normalize_os
|
|
118
118
|
end
|
|
119
119
|
end
|
|
@@ -471,33 +471,33 @@ RSpec.describe Mdm::Host, type: :model do
|
|
|
471
471
|
|
|
472
472
|
context 'os normalization' do
|
|
473
473
|
context '#get_arch_from_string' do
|
|
474
|
-
context "should return '
|
|
474
|
+
context "should return 'x86_64'" do
|
|
475
475
|
it "when the string contains 'x64'" do
|
|
476
|
-
expect(host.send(:get_arch_from_string, 'blahx64blah')).to eq('
|
|
476
|
+
expect(host.send(:get_arch_from_string, 'blahx64blah')).to eq('x86_64')
|
|
477
477
|
end
|
|
478
478
|
|
|
479
479
|
it "when the string contains 'X64'" do
|
|
480
|
-
expect(host.send(:get_arch_from_string, 'blahX64blah')).to eq('
|
|
480
|
+
expect(host.send(:get_arch_from_string, 'blahX64blah')).to eq('x86_64')
|
|
481
481
|
end
|
|
482
482
|
|
|
483
483
|
it "when the string contains 'x86_64'" do
|
|
484
|
-
expect(host.send(:get_arch_from_string, 'blahx86_64blah')).to eq('
|
|
484
|
+
expect(host.send(:get_arch_from_string, 'blahx86_64blah')).to eq('x86_64')
|
|
485
485
|
end
|
|
486
486
|
|
|
487
487
|
it "when the string contains 'X86_64'" do
|
|
488
|
-
expect(host.send(:get_arch_from_string, 'blahX86_64blah')).to eq('
|
|
488
|
+
expect(host.send(:get_arch_from_string, 'blahX86_64blah')).to eq('x86_64')
|
|
489
489
|
end
|
|
490
490
|
|
|
491
491
|
it "when the string contains 'amd64'" do
|
|
492
|
-
expect(host.send(:get_arch_from_string, 'blahamd64blah')).to eq('
|
|
492
|
+
expect(host.send(:get_arch_from_string, 'blahamd64blah')).to eq('x86_64')
|
|
493
493
|
end
|
|
494
494
|
|
|
495
495
|
it "when the string contains 'AMD64'" do
|
|
496
|
-
expect(host.send(:get_arch_from_string, 'blahAMD64blah')).to eq('
|
|
496
|
+
expect(host.send(:get_arch_from_string, 'blahAMD64blah')).to eq('x86_64')
|
|
497
497
|
end
|
|
498
498
|
|
|
499
499
|
it "when the string contains 'aMd64'" do
|
|
500
|
-
expect(host.send(:get_arch_from_string, 'blahamd64blah')).to eq('
|
|
500
|
+
expect(host.send(:get_arch_from_string, 'blahamd64blah')).to eq('x86_64')
|
|
501
501
|
end
|
|
502
502
|
end
|
|
503
503
|
|
|
@@ -531,21 +531,21 @@ RSpec.describe Mdm::Host, type: :model do
|
|
|
531
531
|
end
|
|
532
532
|
end
|
|
533
533
|
|
|
534
|
-
context "should return '
|
|
534
|
+
context "should return 'PowerPC'" do
|
|
535
535
|
it "when the string contains 'PowerPC'" do
|
|
536
|
-
expect(host.send(:get_arch_from_string, 'blahPowerPCblah')).to eq('
|
|
536
|
+
expect(host.send(:get_arch_from_string, 'blahPowerPCblah')).to eq('PowerPC')
|
|
537
537
|
end
|
|
538
538
|
|
|
539
539
|
it "when the string contains 'PPC'" do
|
|
540
|
-
expect(host.send(:get_arch_from_string, 'blahPPCblah')).to eq('
|
|
540
|
+
expect(host.send(:get_arch_from_string, 'blahPPCblah')).to eq('PowerPC')
|
|
541
541
|
end
|
|
542
542
|
|
|
543
543
|
it "when the string contains 'POWER'" do
|
|
544
|
-
expect(host.send(:get_arch_from_string, 'blahPOWERblah')).to eq('
|
|
544
|
+
expect(host.send(:get_arch_from_string, 'blahPOWERblah')).to eq('PowerPC')
|
|
545
545
|
end
|
|
546
546
|
|
|
547
547
|
it "when the string contains 'ppc'" do
|
|
548
|
-
expect(host.send(:get_arch_from_string, 'blahppcblah')).to eq('
|
|
548
|
+
expect(host.send(:get_arch_from_string, 'blahppcblah')).to eq('PowerPC')
|
|
549
549
|
end
|
|
550
550
|
end
|
|
551
551
|
|
|
@@ -560,22 +560,22 @@ RSpec.describe Mdm::Host, type: :model do
|
|
|
560
560
|
end
|
|
561
561
|
end
|
|
562
562
|
|
|
563
|
-
it "should return '
|
|
564
|
-
expect(host.send(:get_arch_from_string, 'blahSPARCblah')).to eq('
|
|
565
|
-
expect(host.send(:get_arch_from_string, 'blahSPaRCblah')).to eq('
|
|
566
|
-
expect(host.send(:get_arch_from_string, 'blahsparcblah')).to eq('
|
|
563
|
+
it "should return 'Sparc' if the string contains SPARC, regardless of case" do
|
|
564
|
+
expect(host.send(:get_arch_from_string, 'blahSPARCblah')).to eq('Sparc')
|
|
565
|
+
expect(host.send(:get_arch_from_string, 'blahSPaRCblah')).to eq('Sparc')
|
|
566
|
+
expect(host.send(:get_arch_from_string, 'blahsparcblah')).to eq('Sparc')
|
|
567
567
|
end
|
|
568
568
|
|
|
569
|
-
it "should return '
|
|
570
|
-
expect(host.send(:get_arch_from_string, 'blahARMblah')).to eq('
|
|
571
|
-
expect(host.send(:get_arch_from_string, 'blahArMblah')).to eq('
|
|
572
|
-
expect(host.send(:get_arch_from_string, 'blaharmblah')).to eq('
|
|
569
|
+
it "should return 'ARM' if the string contains 'ARM', regardless of case" do
|
|
570
|
+
expect(host.send(:get_arch_from_string, 'blahARMblah')).to eq('ARM')
|
|
571
|
+
expect(host.send(:get_arch_from_string, 'blahArMblah')).to eq('ARM')
|
|
572
|
+
expect(host.send(:get_arch_from_string, 'blaharmblah')).to eq('ARM')
|
|
573
573
|
end
|
|
574
574
|
|
|
575
|
-
it "should return '
|
|
576
|
-
expect(host.send(:get_arch_from_string, 'blahMIPSblah')).to eq('
|
|
577
|
-
expect(host.send(:get_arch_from_string, 'blahMiPslah')).to eq('
|
|
578
|
-
expect(host.send(:get_arch_from_string, 'blahmipsblah')).to eq('
|
|
575
|
+
it "should return 'MIPS' if the string contains 'MIPS', regardless of case" do
|
|
576
|
+
expect(host.send(:get_arch_from_string, 'blahMIPSblah')).to eq('MIPS')
|
|
577
|
+
expect(host.send(:get_arch_from_string, 'blahMiPslah')).to eq('MIPS')
|
|
578
|
+
expect(host.send(:get_arch_from_string, 'blahmipsblah')).to eq('MIPS')
|
|
579
579
|
end
|
|
580
580
|
end
|
|
581
581
|
|
|
@@ -588,7 +588,7 @@ RSpec.describe Mdm::Host, type: :model do
|
|
|
588
588
|
context 'arch' do
|
|
589
589
|
it 'should return a value for arch if there is one' do
|
|
590
590
|
result = host.send(:parse_windows_os_str, 'Windows x64')
|
|
591
|
-
expect(result['os.arch']).to eq('
|
|
591
|
+
expect(result['os.arch']).to eq('x86_64')
|
|
592
592
|
end
|
|
593
593
|
|
|
594
594
|
it "should not have an arch key if we don't know the arch" do
|
|
@@ -1093,7 +1093,7 @@ RSpec.describe Mdm::Host, type: :model do
|
|
|
1093
1093
|
fingerprint = FactoryBot.build(:mdm_retina_fingerprint, :host => host)
|
|
1094
1094
|
result = host.send(:normalize_scanner_fp, fingerprint).first
|
|
1095
1095
|
expect(result['os.product']).to eq( 'Windows Server 2003')
|
|
1096
|
-
expect(result['os.arch']).to eq('
|
|
1096
|
+
expect(result['os.arch']).to eq('x86_64')
|
|
1097
1097
|
expect(result['os.version']).to eq('SP2')
|
|
1098
1098
|
expect(result['os.certainty'].to_f).to eq(0.8)
|
|
1099
1099
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metasploit_data_models
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.
|
|
4
|
+
version: 4.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Samuel Huckins
|
|
@@ -96,7 +96,7 @@ cert_chain:
|
|
|
96
96
|
JI/W23RbIRksG2pioMhd4dCXq3FLLlkOV1YfCwWixNB+iIhQPPZVaPNfgPhCn4Dt
|
|
97
97
|
DeGjje/qA4fkLtRmOtb9PUBq3ToRDE4=
|
|
98
98
|
-----END CERTIFICATE-----
|
|
99
|
-
date: 2020-
|
|
99
|
+
date: 2020-07-07 00:00:00.000000000 Z
|
|
100
100
|
dependencies:
|
|
101
101
|
- !ruby/object:Gem::Dependency
|
|
102
102
|
name: metasploit-yard
|
metadata.gz.sig
CHANGED
|
Binary file
|