rapid7/metasploit-framework

View on GitHub
modules/auxiliary/gather/trackit_sql_domain_creds.rb

Summary

Maintainability
D
2 days
Test Coverage

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

  def run
    packet = prepare_packet(true)

    sock = connect
    if sock.nil?
Severity: Minor
Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb - About 5 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 run has 125 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def run
    packet = prepare_packet(true)

    sock = connect
    if sock.nil?
Severity: Major
Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb - About 5 hrs to fix

    File trackit_sql_domain_creds.rb has 266 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'openssl'
    
    class MetasploitModule < Msf::Auxiliary
      include Msf::Exploit::Remote::Tcp
      include Msf::Auxiliary::Report
    Severity: Minor
    Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb - About 2 hrs to fix

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

        def prepare_packet(bmc)
          #
          # ConfigurationService packet structure:
          #
          # packet_header_pre_packet_size
      Severity: Major
      Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb - About 2 hrs to fix

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

          def initialize(info = {})
            super(update_info(info,
              'Name' => 'BMC / Numara Track-It! Domain Administrator and SQL Server User Password Disclosure',
              'Description' => %q{
                This module exploits an unauthenticated configuration retrieval .NET remoting
        Severity: Minor
        Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb - About 1 hr to fix

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

            def report_credential_core(cred_opts={})
              # Set up the has for our Origin service
              origin_service_data = {
                address: rhost,
                port: rport,
          Severity: Minor
          Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb - About 1 hr to fix

            Method fill_loot_from_packet has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def fill_loot_from_packet(packet_reply, loot)
                loot.each_key { |str|
                  if loot[str] != nil
                    next
                  end
            Severity: Minor
            Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb - About 55 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 prepare_packet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

              def prepare_packet(bmc)
                #
                # ConfigurationService packet structure:
                #
                # packet_header_pre_packet_size
            Severity: Minor
            Found in modules/auxiliary/gather/trackit_sql_domain_creds.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

                if loot[domain_admin_pw]
                  cipher = OpenSSL::Cipher.new("des")
                  cipher.decrypt
                  cipher.key = 'NumaraTI'
                  cipher.iv = 'NumaraTI'
            Severity: Minor
            Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb and 1 other location - About 1 hr to fix
            modules/auxiliary/gather/trackit_sql_domain_creds.rb on lines 260..267

            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 47.

            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

                if loot[database_pw]
                  cipher = OpenSSL::Cipher.new("des")
                  cipher.decrypt
                  cipher.key = 'NumaraTI'
                  cipher.iv = 'NumaraTI'
            Severity: Minor
            Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb and 1 other location - About 1 hr to fix
            modules/auxiliary/gather/trackit_sql_domain_creds.rb on lines 274..281

            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 47.

            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

                  0x06, 0x00, 0x01, 0x01, 0x18, 0x00, 0x00, 0x00,
                  0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74,
                  0x69, 0x6f, 0x6e, 0x2f, 0x6f, 0x63, 0x74, 0x65,
                  0x74, 0x2d, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d,
                  0x00, 0x00
            Severity: Minor
            Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb and 2 other locations - About 35 mins to fix
            modules/exploits/windows/http/trackit_file_upload.rb on lines 449..453
            modules/exploits/windows/lotus/domino_icalendar_organizer.rb on lines 127..166

            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 35.

            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

                packet_body_start_pre_method_size = [
                  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                  0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                  0x00, 0x15, 0x11, 0x00, 0x00, 0x00, 0x12
                ]
            Severity: Minor
            Found in modules/auxiliary/gather/trackit_sql_domain_creds.rb and 2 other locations - About 15 mins to fix
            modules/exploits/windows/http/trackit_file_upload.rb on lines 133..137
            modules/exploits/windows/http/trackit_file_upload.rb on lines 291..295

            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 25.

            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