rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Method do_sqli has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def do_sqli(node_id, tbl_prfx, field, table, condition = nil, limit = nil)
Severity: Minor
Found in modules/auxiliary/gather/vbulletin_getindexablecontent_sqli.rb - About 45 mins to fix

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

      def action_retrieve
        print_status("#{peer} - Retrieving Cookie")
        res = send_request_cgi!({
          'uri' => normalize_uri(target_uri.path),
          'keep_cookies' => true
    Severity: Minor
    Found in modules/auxiliary/gather/python_flask_cookie_signer.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

    Avoid deeply nested control flow statements.
    Open

                  if (getsin_observation[index][x] != getsin_observation[next_index][x]) && (getsin_observation[index][x - 1] != getsin_observation[next_index][x - 1]) && ((getsin_observation[(index - 1) % 4][x - 1] == getsin_observation[index][x - 1]) || (getsin_observation[next_index][x - 1] == getsin_observation[(next_index + 1) % 4][x - 1]))
                    target_offset_range.delete(x)
                    inference_results[x] = xor_strings(getsin_observation[index][x], '9')
                    break
                  end
    Severity: Major
    Found in modules/auxiliary/gather/darkcomet_filedownloader.rb - About 45 mins to fix

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

        def parse_map(res)
          map = {}
      
          loop do
            begin
      Severity: Minor
      Found in modules/auxiliary/gather/nis_ypserv_map.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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def run
          proto    = datastore['PROTOCOL']
          domain   = datastore['DOMAIN']
          map_name = nick_to_map(datastore['MAP'])
      
      
      Severity: Minor
      Found in modules/auxiliary/gather/nis_ypserv_map.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 check has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def check
          # Unauthenticated requests to WebInterface endpoints should receive a response containing an 'anonymous' user session cookie
          res_anonymous_check = get_anon_session
      
          return Msf::Exploit::CheckCode::Unknown('Connection failed - unable to get 404 page response (confirm target and SSL settings)') unless res_anonymous_check
      Severity: Minor
      Found in modules/auxiliary/gather/crushftp_fileread_cve_2024_4040.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 output_result has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def output_result(r, grade)
          return unless r
          output_common_info(r)
          if grade
            output_grades_only(r)
      Severity: Minor
      Found in modules/auxiliary/gather/ssllabs_scan.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

      Avoid deeply nested control flow statements.
      Open

                save_note(datastore['HOSTNAME'], ip, port, proto, false) if datastore['REPORT_LEAKS']
      Severity: Major
      Found in modules/auxiliary/gather/cloud_lookup.rb - About 45 mins to fix

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

          def get_users
            users = []
        
            uri = normalize_uri(target_uri.path, 'credential-store', 'domain', domain)
            uri << '/'
        Severity: Minor
        Found in modules/auxiliary/gather/jenkins_cred_recovery.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 on_request_uri has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def on_request_uri(cli, req)
            super
            data = ''
        
            case req.uri
        Severity: Minor
        Found in modules/auxiliary/gather/magento_xxe_cve_2024_34102.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 get_results has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def get_results(index)
            vprint_status("Downloading #{datastore['DOWNLOADROWS']} rows from index #{index}")
            body = { 'query' => { 'query_string' => { 'query' => '*' } }, 'size' => datastore['DOWNLOADROWS'], 'from' => 0, 'sort' => [] }
            request = {
              'uri' => normalize_uri(target_uri.path, index, '_search/'),
        Severity: Minor
        Found in modules/auxiliary/gather/elasticsearch_enum.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 highlight_sid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def highlight_sid(sid)
            color = ''
            color = '%grn' if sid.value == WellKnownSids::SECURITY_AUTHENTICATED_USER_SID
            if sid.value.starts_with?("#{WellKnownSids::SECURITY_NT_NON_UNIQUE}-")
              color = '%grn' if sid.rid == WellKnownSids::DOMAIN_GROUP_RID_USERS
        Severity: Minor
        Found in modules/auxiliary/gather/ldap_esc_vulnerable_cert_finder.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 on_request_uri has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def on_request_uri(cli, request)
            my_host  = (datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address(cli.peerhost) : datastore['SRVHOST']
        
            case request.method
            when 'OPTIONS'
        Severity: Minor
        Found in modules/auxiliary/gather/ie_sandbox_findfiles.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 get_node_info has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def get_node_info
            vprint_status('Querying node information...')
            request = {
              'uri' => normalize_uri(target_uri.path, '_cat', 'nodes'),
              'method' => 'GET',
        Severity: Minor
        Found in modules/auxiliary/gather/elasticsearch_enum.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 extract_data has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def extract_data(data, url)
            # extract data from response
            INFO_REGEXS.each do |regex|
              if data =~ regex[2]
                @version_info[regex[0]][regex[1]] = $1.chomp
        Severity: Minor
        Found in modules/auxiliary/gather/ibm_sametime_version.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 run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def run
            # create storage for extracted information+
            @version_info = {}
            @version_info['version'] = {}
            @version_info['conf'] = {}
        Severity: Minor
        Found in modules/auxiliary/gather/ibm_sametime_version.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 query_columns has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def query_columns(database, table)
            cols = []
            query = "(SELECT IFNULL(CAST(COUNT(*) AS CHAR),0x20) FROM #{database}.#{table})"
        
            colc = sqli(query)
        Severity: Minor
        Found in modules/auxiliary/gather/joomla_com_realestatemanager_sqli.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 convert_sids_to_human_readable_name has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def convert_sids_to_human_readable_name(sids_array)
            output = []
            for sid in sids_array
              raw_filter = "(objectSID=#{ldap_escape_filter(sid.to_s)})"
              attributes = ['sAMAccountName', 'name']
        Severity: Minor
        Found in modules/auxiliary/gather/ldap_esc_vulnerable_cert_finder.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 parse_bootparams has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def parse_bootparams(res)
            bootparams = {}
        
            loop do
              begin
        Severity: Minor
        Found in modules/auxiliary/gather/nis_bootparamd_domain.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 get_cluster_info has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          def get_cluster_info
            vprint_status('Querying cluster information...')
            request = {
              'uri' => normalize_uri(target_uri.path, '_cluster', 'health'),
              'method' => 'GET'
        Severity: Minor
        Found in modules/auxiliary/gather/elasticsearch_enum.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

        Severity
        Category
        Status
        Source
        Language