rapid7/metasploit-framework

View on GitHub
modules/post/linux/gather/vcenter_secrets_dump.rb

Summary

Maintainability
F
1 wk
Test Coverage

File vcenter_secrets_dump.rb has 798 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'metasploit/framework/credential_collection'

class MetasploitModule < Msf::Post
  include Msf::Post::Common
  include Msf::Post::File
Severity: Major
Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 day to fix

    Method enum_vm_cust_spec has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

      def enum_vm_cust_spec
        vpx_customization_specs = get_vpx_customization_spec(shell_vcdb_pass, vcdb_user, vcdb_name)
    
        if vpx_customization_specs.nil?
          print_warning('No vpx_customization_spec entries evident')
    Severity: Minor
    Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 6 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method enum_vm_cust_spec has 106 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def enum_vm_cust_spec
        vpx_customization_specs = get_vpx_customization_spec(shell_vcdb_pass, vcdb_user, vcdb_name)
    
        if vpx_customization_specs.nil?
          print_warning('No vpx_customization_spec entries evident')
    Severity: Major
    Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 4 hrs to fix

      Method run has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

        def run
          get_vcsa_version
      
          if check_cve_2022_22948
            print_good('Vulnerable to CVE-2022-22948')
      Severity: Minor
      Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Class MetasploitModule has 25 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class MetasploitModule < Msf::Post
        include Msf::Post::Common
        include Msf::Post::File
        include Msf::Auxiliary::Report
        include Msf::Post::Linux::Priv
      Severity: Minor
      Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 2 hrs to fix

        Method run has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def run
            get_vcsa_version
        
            if check_cve_2022_22948
              print_good('Vulnerable to CVE-2022-22948')
        Severity: Major
        Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 2 hrs to fix

          Method get_db_creds has 58 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def get_db_creds
              db_properties = process_vcdb_properties_file
          
              self.vcdb_name = db_properties['name']
              self.vcdb_user = db_properties['username']
          Severity: Major
          Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 2 hrs to fix

            Method initialize has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def initialize(info = {})
                super(
                  update_info(
                    info,
                    'Name' => 'VMware vCenter Secrets Dump',
            Severity: Major
            Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 2 hrs to fix

              Method get_aes_keys_from_host has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def get_aes_keys_from_host
                  print_status('Extracting tenant and vpx AES encryption key...')
              
                  tenant_key = get_aes_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
                  fail_with(Msf::Exploit::Failure::Unknown, 'Error extracting tenant and vpx AES encryption key') if tenant_key.nil?
              Severity: Minor
              Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                Method process_hashes has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                  def process_hashes(entries)
                    if entries.empty?
                      print_warning('No password hashes found')
                      return
                    end
                Severity: Minor
                Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

                Method vmdir_init has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def vmdir_init
                    self.keystore = {}
                
                    vsphere_machine_id = get_machine_id
                    if is_uuid?(vsphere_machine_id)
                Severity: Minor
                Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                  Method get_idp_creds has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def get_idp_creds
                      vprint_status('Fetching objectclass=vmwSTSTenantCredential via vmdir LDAP')
                      idp_keys = get_idp_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
                      if idp_keys.nil?
                        print_error('Error processing IdP trusted certificate private key')
                  Severity: Minor
                  Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method process_hashes has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def process_hashes(entries)
                      if entries.empty?
                        print_warning('No password hashes found')
                        return
                      end
                  Severity: Minor
                  Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                    Method get_idp_creds has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def get_idp_creds
                        vprint_status('Fetching objectclass=vmwSTSTenantCredential via vmdir LDAP')
                        idp_keys = get_idp_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
                        if idp_keys.nil?
                          print_error('Error processing IdP trusted certificate private key')
                    Severity: Minor
                    Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                      Method validate_target has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def validate_target
                          if vcenter_management
                            vc_db_type = get_database_type
                            unless vc_db_type == 'embedded'
                              fail_with(Msf::Exploit::Failure::NoTarget, "This module only supports embedded PostgreSQL, appliance reports DB type '#{vc_db_type}'")
                      Severity: Minor
                      Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                        Method validate_sts_cert has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def validate_sts_cert(test_cert)
                            cert = validate_x509_cert(test_cert)
                            return false if cert.nil?
                        
                            vprint_status('Downloading advertised IDM tenant certificate chain from http://localhost:7080/idm/tenant/ on local vCenter')
                        Severity: Minor
                        Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method validate_target has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def validate_target
                            if vcenter_management
                              vc_db_type = get_database_type
                              unless vc_db_type == 'embedded'
                                fail_with(Msf::Exploit::Failure::NoTarget, "This module only supports embedded PostgreSQL, appliance reports DB type '#{vc_db_type}'")
                        Severity: Minor
                        Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method process_sso_providers has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def process_sso_providers(entries)
                            if entries.empty?
                              print_warning('No SSO ID provider information found')
                              return
                            end
                        Severity: Minor
                        Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                          Method get_vmca_cert has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def get_vmca_cert
                              vprint_status('Extract VMCA_ROOT key')
                          
                              unless file_exist?('/var/lib/vmware/vmca/privatekey.pem') && file_exist?('/var/lib/vmware/vmca/root.cer')
                                print_error('Could not locate VMCA_ROOT keypair')
                          Severity: Minor
                          Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                            Method get_vc_licenses has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def get_vc_licenses(entries)
                                if entries.empty?
                                  print_warning('No vSphere Licenses Found')
                                  return
                                end
                            Severity: Minor
                            Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 1 hr to fix

                              Method vmafd_dump has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def vmafd_dump
                                  if vcenter_infrastructure
                                    get_vmca_cert
                                    get_idp_creds
                                  end
                              Severity: Minor
                              Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 45 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Method vmdir_init has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def vmdir_init
                                  self.keystore = {}
                              
                                  vsphere_machine_id = get_machine_id
                                  if is_uuid?(vsphere_machine_id)
                              Severity: Minor
                              Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 45 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Method update_keystore has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def update_keystore(public_key, private_key)
                                  if public_key.is_a? String
                                    cert = validate_x509_cert(public_key)
                                  else
                                    cert = public_key
                              Severity: Minor
                              Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 35 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Method get_vmca_cert has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                              Open

                                def get_vmca_cert
                                  vprint_status('Extract VMCA_ROOT key')
                              
                                  unless file_exist?('/var/lib/vmware/vmca/privatekey.pem') && file_exist?('/var/lib/vmware/vmca/root.cer')
                                    print_error('Could not locate VMCA_ROOT keypair')
                              Severity: Minor
                              Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 35 mins to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Avoid too many return statements within this method.
                              Open

                                    return false
                              Severity: Major
                              Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 30 mins to fix

                                Method get_aes_keys_from_host has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  def get_aes_keys_from_host
                                    print_status('Extracting tenant and vpx AES encryption key...')
                                
                                    tenant_key = get_aes_keys(base_fqdn, vc_psc_fqdn, base_dn, bind_dn, shell_bind_pw)
                                    fail_with(Msf::Exploit::Failure::Unknown, 'Error extracting tenant and vpx AES encryption key') if tenant_key.nil?
                                Severity: Minor
                                Found in modules/post/linux/gather/vcenter_secrets_dump.rb - About 25 mins to fix

                                Cognitive Complexity

                                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                A method's cognitive complexity is based on a few simple rules:

                                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                • Code is considered more complex for each "break in the linear flow of the code"
                                • Code is considered more complex when "flow breaking structures are nested"

                                Further reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    entries.each do |entry|
                                      # This is the "username"
                                      dn = entry.dn
                                
                                      # https://github.com/vmware/lightwave/blob/3bc154f823928fa0cf3605cc04d95a859a15c2a2/vmdir/server/middle-layer/password.c#L32-L76
                                Severity: Major
                                Found in modules/post/linux/gather/vcenter_secrets_dump.rb and 1 other location - About 2 hrs to fix
                                modules/auxiliary/gather/vmware_vcenter_vmdir_ldap.rb on lines 156..189

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 96.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                      case secret_is_plaintext.downcase
                                      when 'true'
                                        secret_plaintext = sysprep_element_unattend.xpath('//identification/domainAdminPassword/value').text
                                      when 'false'
                                        secret_ciphertext = sysprep_element_unattend.xpath('//identification/domainAdminPassword/value').text
                                Severity: Minor
                                Found in modules/post/linux/gather/vcenter_secrets_dump.rb and 1 other location - About 45 mins to fix
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 695..705

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 41.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        case secret_is_plaintext.downcase
                                        when 'true'
                                          secret_plaintext = sysprep_element_unattend.xpath('//guiUnattended/password/value').text
                                        when 'false'
                                          secret_ciphertext = sysprep_element_unattend.xpath('//guiUnattended/password/value').text
                                Severity: Minor
                                Found in modules/post/linux/gather/vcenter_secrets_dump.rb and 1 other location - About 45 mins to fix
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 732..742

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 41.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        print_good("VPX Host creds found: #{cred['user']}, #{cred['decrypted_password']} for #{cred['ip_address']}")
                                        credential_data = {
                                          username: cred['user'],
                                          private_data: cred['decrypted_password'],
                                          private_type: :password
                                Severity: Minor
                                Found in modules/post/linux/gather/vcenter_secrets_dump.rb and 1 other location - About 25 mins to fix
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 849..856

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 31.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        print_good("VPX Host creds found: #{cred['user']}, #{cred['password_hash']} for #{cred['ip_address']}")
                                        credential_data = {
                                          username: cred['user'],
                                          private_data: cred['password_hash'],
                                          private_type: :nonreplayable_hash
                                Severity: Minor
                                Found in modules/post/linux/gather/vcenter_secrets_dump.rb and 1 other location - About 25 mins to fix
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 842..847

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 31.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                      extra_service_data = {
                                        address: Rex::Socket.getaddress(rhost),
                                        port: 443,
                                        service_name: 'https',
                                        protocol: 'tcp',
                                Severity: Minor
                                Found in modules/post/linux/gather/vcenter_secrets_dump.rb and 2 other locations - About 20 mins to fix
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 225..235
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 811..821

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 27.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                    extra_service_data = {
                                      address: Rex::Socket.getaddress(rhost),
                                      port: 389,
                                      service_name: 'ldap',
                                      protocol: 'tcp',
                                Severity: Minor
                                Found in modules/post/linux/gather/vcenter_secrets_dump.rb and 2 other locations - About 20 mins to fix
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 619..629
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 811..821

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 27.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 3 locations. Consider refactoring.
                                Open

                                    extra_service_data = {
                                      address: Rex::Socket.getaddress(rhost),
                                      port: 5432,
                                      service_name: 'psql',
                                      protocol: 'tcp',
                                Severity: Minor
                                Found in modules/post/linux/gather/vcenter_secrets_dump.rb and 2 other locations - About 20 mins to fix
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 225..235
                                modules/post/linux/gather/vcenter_secrets_dump.rb on lines 619..629

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 27.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                There are no issues that match your filters.

                                Category
                                Status