rapid7/metasploit-framework

View on GitHub

Showing 15,730 of 21,757 total issues

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

  def initialize(info = {})
    super(
      update_info(
        info,
        'Name' => 'Cisco RV110W/RV130(W)/RV215W Routers Management Interface Remote Command Execution',
Severity: Major
Found in modules/exploits/linux/http/cve_2019_1663_cisco_rmi_rce.rb - About 1 day to fix

    File client_core.rb has 562 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'rex/post/meterpreter/packet'
    require 'rex/post/meterpreter/core_ids'
    require 'rex/post/meterpreter/extension'
    require 'rex/post/meterpreter/extension_mapper'
    require 'rex/post/meterpreter/client'
    Severity: Major
    Found in lib/rex/post/meterpreter/client_core.rb - About 1 day to fix

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

        def run
          if ! @telephony_loaded
            print_error("The Telephony module is not available: #{@telephony_error}")
            raise RuntimeError, "Telephony not available"
          end
      Severity: Major
      Found in modules/auxiliary/scanner/telephony/wardial.rb - About 1 day to fix

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

          def run
            ldap_connect do |ldap|
              validate_bind_success!(ldap)
        
              if (base_dn = datastore['BASE_DN'])
        Severity: Minor
        Found in modules/auxiliary/gather/ldap_query.rb - About 1 day 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 60 (exceeds 5 allowed). Consider refactoring.
        Open

          def run_host(ip)
            # Force http verb to be upper-case, because otherwise some web servers such as
            # Apache might throw you a 501
            http_method = datastore['METHOD'].upcase
        
        
        Severity: Minor
        Found in modules/auxiliary/scanner/http/blind_sql_query.rb - About 1 day 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 60 (exceeds 5 allowed). Consider refactoring.
        Open

          def run_host(ip)
            conn = false
            usecode = datastore['ForceCode']
        
            tpath = normalize_uri(datastore['PATH'])
        Severity: Minor
        Found in modules/auxiliary/scanner/http/web_vulndb.rb - About 1 day 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_ref_identifiers has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
        Open

          def check_ref_identifiers
            in_super     = false
            in_refs      = false
            in_notes     = false
            cve_assigned = false
        Severity: Minor
        Found in tools/dev/msftidy.rb - About 1 day 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 apply_prepends has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
        Open

          def apply_prepends(buf)
            pre = ''
            app = ''
        
            test_arch = [ *(self.arch) ]
        Severity: Minor
        Found in lib/msf/core/payload/linux.rb - About 1 day 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

        File Program.cs has 559 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        using System;
        using System.IO;
        using System.Runtime.InteropServices;
        using System.Text;
        

          File weblogic_deserialize_unicastref.rb has 558 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          class MetasploitModule < Msf::Exploit::Remote
            Rank = ExcellentRanking
          
            include Msf::Exploit::Remote::Tcp
            include Msf::Exploit::Remote::TcpServer
          Severity: Major
          Found in modules/exploits/multi/misc/weblogic_deserialize_unicastref.rb - About 1 day to fix

            Method exploit has 234 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def exploit
                main = %q^
            /*
            * Exploit Title: pkexec Race condition (CVE-2011-1485) exploit
            * Author: xi4oyu
            Severity: Major
            Found in modules/exploits/linux/local/pkexec.rb - About 1 day to fix

              Class Core has 64 methods (exceeds 20 allowed). Consider refactoring.
              Open

              class Console::CommandDispatcher::Core
              
                include Console::CommandDispatcher
              
                #
              Severity: Major
              Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/core.rb - About 1 day to fix

                File nexpose.rb has 553 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                require 'English'
                require 'nexpose'
                
                module Msf
                  Nexpose_yaml = "#{Msf::Config.config_directory}/nexpose.yaml".freeze # location of the nexpose.yml containing saved nexpose creds
                Severity: Major
                Found in plugins/nexpose.rb - About 1 day to fix

                  File nexpose_raw_document.rb has 553 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require "rex/parser/nokogiri_doc_mixin"
                  require "date"
                  
                  module Rex
                    module Parser
                  Severity: Major
                  Found in lib/rex/parser/nexpose_raw_document.rb - About 1 day to fix

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

                      def run
                        open_pcap({'SNAPLEN' => 68, 'FILTER' => "arp[6:2] == 0x0002"})
                        @netifaces = true
                        if not netifaces_implemented?
                          print_error("WARNING : Pcaprub is not up-to-date, some functionality will not be available")
                    Severity: Minor
                    Found in modules/auxiliary/spoof/arp/arp_poisoning.rb - About 1 day 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 59 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def run_host(ip)
                    
                        http_method = datastore['METHOD'].upcase
                    
                        qvars = nil
                    Severity: Minor
                    Found in modules/auxiliary/scanner/http/error_sql_injection.rb - About 1 day 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 exploit has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def exploit
                        if target.name =~ /prestashop/
                          uri = normalize_uri(target_uri.path)
                          res = send_request_cgi({'uri' => uri})
                          if res && res.code != 301
                    Severity: Minor
                    Found in modules/exploits/linux/http/php_imap_open_rce.rb - About 1 day 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_response has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def read_response(t = -1, opts = {})
                        # Return a nil response if timeout is nil or 0
                        return if t.nil? || t == 0
                    
                        resp = Response.new
                    Severity: Minor
                    Found in lib/rex/proto/http/client.rb - About 1 day 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 send_tcp has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                    Open

                        def send_tcp(packet, packet_data, nameservers, prox = @config[:proxies])
                          ans = nil
                          length = [packet_data.size].pack("n")
                          nameservers.each do |ns, socket_options|
                            socket = nil
                    Severity: Minor
                    Found in lib/rex/proto/dns/resolver.rb - About 1 day 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_download has a Cognitive Complexity of 59 (exceeds 5 allowed). Consider refactoring.
                    Open

                      def cmd_download(*args)
                        if (args.empty? or args.include? "-h")
                          cmd_download_help
                          return true
                        end
                    Severity: Minor
                    Found in lib/rex/post/meterpreter/ui/console/command_dispatcher/stdapi/fs.rb - About 1 day 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