rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

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

  def fetch_cookie
    # Request a page and extract a F5 looking cookie
    cookie = {}
    res = send_request_raw('method' => 'GET', 'uri' => @uri)

Severity: Minor
Found in modules/auxiliary/gather/f5_bigip_cookie_disclosure.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 ldap_get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def ldap_get(filter, attributes: [])
    raw_obj = @ldap.search(base: @base_dn, filter: filter, attributes: attributes).first
    return nil unless raw_obj

    obj = {}
Severity: Minor
Found in modules/auxiliary/admin/ldap/rbcd.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 auth_v11 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

  def auth_v11
    res = send_request_cgi(
      'uri' => normalize_uri(target_uri.path, 'fm/'),
      'method' => 'GET',
      'vars_get' =>
Severity: Minor
Found in modules/auxiliary/admin/networking/cisco_dcnm_download.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
    print_status("Grabbing the SQL Server name and domain...")
    db_server_name = get_server_name
    if db_server_name.nil?
      print_error("Unable to grab the server name")
Severity: Minor
Found in modules/auxiliary/admin/mssql/mssql_enum_domain_accounts_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

Avoid deeply nested control flow statements.
Open

                if (liste_dst_ips.include? pkt.arp_saddr_ip and liste_src_ips.include? pkt.arp_daddr_ip) or
                  (args[:BIDIRECTIONAL] and liste_dst_ips.include? pkt.arp_daddr_ip and liste_src_ips.include? pkt.arp_saddr_ip)
                  vprint_status("Listener : Request from #{pkt.arp_saddr_ip} for #{pkt.arp_daddr_ip}")
                  reply = buildreply(pkt.arp_daddr_ip, @smac, pkt.arp_saddr_ip, pkt.eth_saddr)
                  3.times{listener_capture.inject(reply.to_s)}
Severity: Major
Found in modules/auxiliary/spoof/arp/arp_poisoning.rb - About 45 mins to fix

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

      def ldap_get(filter, attributes: [])
        raw_obj = @ldap.search(base: @base_dn, filter: filter, attributes: attributes).first
        return nil unless raw_obj
    
        obj = {}
    Severity: Minor
    Found in modules/auxiliary/admin/ldap/shadow_credentials.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 authenticate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def authenticate
        res = send_request_cgi({
          'uri' => normalize_uri(datastore['TARGETURI'], 'userSession.do'),
          'method' => 'POST',
          'vars_post' => {
    Severity: Minor
    Found in modules/auxiliary/admin/http/netgear_auth_download.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 read_file has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def read_file(the_cookie)
        print_status("#{rhost}:#{rport} - Accessing the file...")
        file = datastore['FILENAME']
        fileuri = "/goform/logRead?Readfile=../../../../../../..#{file}"
        final_url = (ssl ? 'https' : 'http').to_s + '://' + "#{rhost}:#{rport}" + fileuri.to_s
    Severity: Minor
    Found in modules/auxiliary/admin/http/cnpilot_r_fpt.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
        print_status('Requesting list of entities from endpoint, this may take a minute...')
        users = send_request_raw({
          'method' => 'GET',
          'uri' => normalize_uri(datastore['TARGETURI'], "/ws/dal/#{datastore['ENDPOINT']}"),
    Severity: Minor
    Found in modules/auxiliary/admin/http/openbravo_xxe.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
        begin
          @xsrf_token_value = xsrf_token_value
          @auth_token = auth_token(@xsrf_token_value)
          @reset_password = reset_password(@xsrf_token_value, @auth_token)
    Severity: Minor
    Found in modules/auxiliary/admin/http/cisco_ssm_onprem_account.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
        cookie = authenticate
        if cookie.nil?
          fail_with(Failure::Unknown, "#{peer} - Failed to log in with the provided credentials.")
        else
    Severity: Minor
    Found in modules/auxiliary/admin/http/netgear_auth_download.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
        res = send_request_cgi(
          'method' => 'GET',
          'uri' => normalize_uri(target_uri.path, '/login.action')
        )
    Severity: Minor
    Found in modules/auxiliary/admin/http/atlassian_confluence_auth_bypass.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 cmd_exec_run has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def cmd_exec_run(the_cookie)
        # Verify backdoor 'root' shell url exists
        root_shell = (ssl ? 'https' : 'http').to_s + '://' + "#{rhost}:#{rport}" + '/adm/syscmd.asp'
        print_status("#{rhost}:#{rport} - Checking backdoor 'root' shell...")
    
    
    Severity: Minor
    Found in modules/auxiliary/admin/http/cnpilot_r_cmd_exec.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_host has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      def run_host(_ip)
        @files_found = []
    
        begin
          print_status("Attempting to connect to #{rhost}:#{rport}")
    Severity: Minor
    Found in modules/auxiliary/admin/http/trendmicro_dlp_traversal.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 blind_size has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      def blind_size(field, table, condition, size, charset, patterns = {})
    Severity: Minor
    Found in modules/auxiliary/admin/http/typo3_news_module_sqli.rb - About 45 mins to fix

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

        def run
          datastore['SID_MAX'].times do |x|
            print_status("Trying session ID #{x}")
      
            res = send_request_raw({
      Severity: Minor
      Found in modules/auxiliary/admin/http/iomega_storcenterpro_sessionid.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 blind has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def blind(field, table, condition, charset, digit_charset, patterns = {})
      Severity: Minor
      Found in modules/auxiliary/admin/http/typo3_news_module_sqli.rb - About 45 mins to fix

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

          def run
            if check_filename(datastore['filepath'])
              file = nil
              if datastore['TRAVERSAL_PATH'].nil?
                traversal_size = datastore['MAX_TRAVERSAL']
        Severity: Minor
        Found in modules/auxiliary/admin/http/webnms_file_download.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 ending[i] == base[pos]
                      isthere = true
                      partnum += pos.to_s
                      if pos == 0
                        if !startnum
        Severity: Major
        Found in modules/auxiliary/admin/http/webnms_cred_disclosure.rb - About 45 mins to fix

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

            def run
              print_status("Trying to get 'admin' user password ...")
              res = send_request_cgi({
                'uri' => '/webctrl.cgi',
                'method' => 'POST',
          Severity: Minor
          Found in modules/auxiliary/admin/http/zyxel_admin_password_extractor.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