metasploit_data_models 1.2.5 → 1.2.6
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:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 3a2851ff0a874979d51536d4c91b346339923d0d
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 2f917872a6e4cbf0589aca13bb50ef5c3b8e453d
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 991277f433519b3f5c5378ef266d2425cc8a3470f8d824b432071cf63e82e91cc6073fad54c7b313b3ee60f50f558d052379b8dde564142e417358add1c854fd
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: d2c14f9973c35435367ad37f0080a97b167880163045551f0042e644c1ba73ad502fa547353b400561416021c79e19d0329558b59a10af66d1907705086e57b0
         
     | 
| 
         @@ -204,8 +204,7 @@ module Mdm::Host::OperatingSystemNormalization 
     | 
|
| 
       204 
204 
     | 
    
         
             
                # Mdm currently serves that role.
         
     | 
| 
       205 
205 
     | 
    
         
             
                #
         
     | 
| 
       206 
206 
     | 
    
         | 
| 
       207 
     | 
    
         
            -
                service_match_keys =  
     | 
| 
       208 
     | 
    
         
            -
                service_match_keys.merge({
         
     | 
| 
      
 207 
     | 
    
         
            +
                service_match_keys = {
         
     | 
| 
       209 
208 
     | 
    
         
             
                  # TODO: Implement smb.generic fingerprint database
         
     | 
| 
       210 
209 
     | 
    
         
             
                  # 'smb'     => [ 'smb.generic' ], # Distinct from smb.fingerprint, use os.certainty to choose best match
         
     | 
| 
       211 
210 
     | 
    
         
             
                  # 'netbios' => [ 'smb.generic' ], # Distinct from smb.fingerprint, use os.certainty to choose best match
         
     | 
| 
         @@ -221,10 +220,12 @@ module Mdm::Host::OperatingSystemNormalization 
     | 
|
| 
       221 
220 
     | 
    
         
             
                  'nntp'    => [ 'nntp.banner' ],
         
     | 
| 
       222 
221 
     | 
    
         
             
                  'ftp'     => [ 'ftp.banner' ],
         
     | 
| 
       223 
222 
     | 
    
         
             
                  'ssdp'    => [ 'ssdp_header.server' ]
         
     | 
| 
       224 
     | 
    
         
            -
                } 
     | 
| 
      
 223 
     | 
    
         
            +
                }
         
     | 
| 
       225 
224 
     | 
    
         | 
| 
       226 
225 
     | 
    
         
             
                matches = []
         
     | 
| 
       227 
226 
     | 
    
         | 
| 
      
 227 
     | 
    
         
            +
                return matches unless service_match_keys.has_key?(s.name)
         
     | 
| 
      
 228 
     | 
    
         
            +
             
     | 
| 
       228 
229 
     | 
    
         
             
                service_match_keys[s.name].each do |rdb|
         
     | 
| 
       229 
230 
     | 
    
         
             
                  banner = s.info
         
     | 
| 
       230 
231 
     | 
    
         
             
                  if self.respond_to?("service_banner_recog_filter_#{s.name}")
         
     | 
| 
         @@ -1,4 +1,6 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            RSpec.describe Mdm::Host, type: :model do
         
     | 
| 
      
 2 
     | 
    
         
            +
              include_context 'Rex::Text'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
       2 
4 
     | 
    
         
             
              subject(:host) do
         
     | 
| 
       3 
5 
     | 
    
         
             
                FactoryGirl.build(:mdm_host)
         
     | 
| 
       4 
6 
     | 
    
         
             
              end
         
     | 
| 
         @@ -724,19 +726,6 @@ RSpec.describe Mdm::Host, type: :model do 
     | 
|
| 
       724 
726 
     | 
    
         | 
| 
       725 
727 
     | 
    
         | 
| 
       726 
728 
     | 
    
         
             
                context '#apply_match_to_host' do
         
     | 
| 
       727 
     | 
    
         
            -
             
     | 
| 
       728 
     | 
    
         
            -
                  before(:each) do
         
     | 
| 
       729 
     | 
    
         
            -
                    stub_const(
         
     | 
| 
       730 
     | 
    
         
            -
                        'Rex::Text',
         
     | 
| 
       731 
     | 
    
         
            -
                        Module.new do
         
     | 
| 
       732 
     | 
    
         
            -
                          def self.ascii_safe_hex(unsanitized)
         
     | 
| 
       733 
     | 
    
         
            -
                            # Pass back the sanitized value for the stub
         
     | 
| 
       734 
     | 
    
         
            -
                            unsanitized.unpack("C*").pack("C*").gsub(/([\x00-\x08\x0b\x0c\x0e-\x1f\x80-\xFF])/n){ |x| "\\x%.2x" % x.unpack("C*")[0]}
         
     | 
| 
       735 
     | 
    
         
            -
                          end
         
     | 
| 
       736 
     | 
    
         
            -
                        end
         
     | 
| 
       737 
     | 
    
         
            -
                    )
         
     | 
| 
       738 
     | 
    
         
            -
                  end
         
     | 
| 
       739 
     | 
    
         
            -
             
     | 
| 
       740 
729 
     | 
    
         
             
                  it 'should set host.mac when host.mac is present' do
         
     | 
| 
       741 
730 
     | 
    
         
             
                    match = { 'host.mac' => '00:11:22:33:44:55' }
         
     | 
| 
       742 
731 
     | 
    
         
             
                    host.send(:apply_match_to_host, match)
         
     | 
| 
         @@ -66,11 +66,36 @@ RSpec.describe Mdm::Service, type: :model do 
     | 
|
| 
       66 
66 
     | 
    
         | 
| 
       67 
67 
     | 
    
         
             
              context 'callbacks' do
         
     | 
| 
       68 
68 
     | 
    
         
             
                context 'after_save' do
         
     | 
| 
      
 69 
     | 
    
         
            +
                  include_context 'Rex::Text'
         
     | 
| 
      
 70 
     | 
    
         
            +
             
     | 
| 
       69 
71 
     | 
    
         
             
                  it 'should call #normalize_host_os' do
         
     | 
| 
       70 
72 
     | 
    
         
             
                    svc = FactoryGirl.create(:mdm_service)
         
     | 
| 
       71 
73 
     | 
    
         
             
                    expect(svc).to receive(:normalize_host_os)
         
     | 
| 
       72 
74 
     | 
    
         
             
                    svc.run_callbacks(:save)
         
     | 
| 
       73 
75 
     | 
    
         
             
                  end
         
     | 
| 
      
 76 
     | 
    
         
            +
             
     | 
| 
      
 77 
     | 
    
         
            +
                  it 'should include recog data when there is a match' do
         
     | 
| 
      
 78 
     | 
    
         
            +
                    host = FactoryGirl.create(:mdm_host)
         
     | 
| 
      
 79 
     | 
    
         
            +
                    FactoryGirl.create(
         
     | 
| 
      
 80 
     | 
    
         
            +
                      :mdm_service,
         
     | 
| 
      
 81 
     | 
    
         
            +
                      :host => host,
         
     | 
| 
      
 82 
     | 
    
         
            +
                      :name => 'ftp',
         
     | 
| 
      
 83 
     | 
    
         
            +
                      :info => 'example.com Microsoft FTP Service (Version 3.0).'
         
     | 
| 
      
 84 
     | 
    
         
            +
                    )
         
     | 
| 
      
 85 
     | 
    
         
            +
                    expect(host.name).to eq('example.com')
         
     | 
| 
      
 86 
     | 
    
         
            +
                    expect(host.os_name).to eq('Windows NT')
         
     | 
| 
      
 87 
     | 
    
         
            +
                  end
         
     | 
| 
      
 88 
     | 
    
         
            +
             
     | 
| 
      
 89 
     | 
    
         
            +
                  it 'should not include recog data when there is not a match' do
         
     | 
| 
      
 90 
     | 
    
         
            +
                    host = FactoryGirl.create(:mdm_host)
         
     | 
| 
      
 91 
     | 
    
         
            +
                    FactoryGirl.create(
         
     | 
| 
      
 92 
     | 
    
         
            +
                      :mdm_service,
         
     | 
| 
      
 93 
     | 
    
         
            +
                      :host => host,
         
     | 
| 
      
 94 
     | 
    
         
            +
                      :name => 'ftp',
         
     | 
| 
      
 95 
     | 
    
         
            +
                      :info => 'THISSHOULDNEVERMATCH'
         
     | 
| 
      
 96 
     | 
    
         
            +
                    )
         
     | 
| 
      
 97 
     | 
    
         
            +
                    expect(host.os_name).to eq('Unknown')
         
     | 
| 
      
 98 
     | 
    
         
            +
                  end
         
     | 
| 
       74 
99 
     | 
    
         
             
                end
         
     | 
| 
       75 
100 
     | 
    
         
             
              end
         
     | 
| 
       76 
101 
     | 
    
         | 
    
        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: 1.2. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 1.2.6
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Samuel Huckins
         
     | 
| 
         @@ -11,7 +11,7 @@ authors: 
     | 
|
| 
       11 
11 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       12 
12 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       13 
13 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       14 
     | 
    
         
            -
            date: 2015- 
     | 
| 
      
 14 
     | 
    
         
            +
            date: 2015-07-02 00:00:00.000000000 Z
         
     | 
| 
       15 
15 
     | 
    
         
             
            dependencies:
         
     | 
| 
       16 
16 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       17 
17 
     | 
    
         
             
              name: metasploit-version
         
     | 
| 
         @@ -731,7 +731,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement 
     | 
|
| 
       731 
731 
     | 
    
         
             
                  version: '0'
         
     | 
| 
       732 
732 
     | 
    
         
             
            requirements: []
         
     | 
| 
       733 
733 
     | 
    
         
             
            rubyforge_project: 
         
     | 
| 
       734 
     | 
    
         
            -
            rubygems_version: 2.4. 
     | 
| 
      
 734 
     | 
    
         
            +
            rubygems_version: 2.4.3
         
     | 
| 
       735 
735 
     | 
    
         
             
            signing_key: 
         
     | 
| 
       736 
736 
     | 
    
         
             
            specification_version: 4
         
     | 
| 
       737 
737 
     | 
    
         
             
            summary: Database code for MSF and Metasploit Pro
         
     |