rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

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

  def start_rexec_session(host, port, user, pass, proof, stderr_sock)
Severity: Minor
Found in modules/auxiliary/scanner/rservices/rexec_login.rb - About 45 mins to fix

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

      def start_rlogin_session(host, port, user, luser, pass, proof)
    Severity: Minor
    Found in modules/auxiliary/scanner/rservices/rlogin_login.rb - About 45 mins to fix

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

        def do_login(user=nil,pass=nil)
          begin
            ntp_send("< NTP/1.0 >\n",true) # send hello
            if @result !~ /\<\ NTP\/1\.0 \>/
              print_error("#{msg} Nessus NTP does not appear to be running: did not get response to NTP hello: #{@result}")
      Severity: Minor
      Found in modules/auxiliary/scanner/nessus/nessus_ntp_login.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 process_nokogiri_callback has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def process_nokogiri_callback(type,data)
          return unless type == :port_script
          return unless data["id"] == "oracle-brute"
          return unless data[:addresses].has_key? "ipv4"
          return unless data[:port]["state"] == ::Msf::ServiceState::Open
      Severity: Minor
      Found in modules/auxiliary/scanner/oracle/oracle_login.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)
          begin
      
          connect rescue nil
          if not self.sock
      Severity: Minor
      Found in modules/auxiliary/scanner/vmware/vmauthd_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 rsync_negotiate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def rsync_negotiate
          # rsync is promiscuous and will send the negotiation and motd
          # upon connecting.  abort if we get nothing
          return unless (greeting = sock.get_once(-1, read_timeout))
      
      
      Severity: Minor
      Found in modules/auxiliary/scanner/rsync/modules_list.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 report_creds has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def report_creds(ip, port, result)
          if !datastore['RECORD_GUEST'] && (result.access_level == Metasploit::Framework::LoginScanner::SMB::AccessLevels::GUEST)
            return
          end
      
      
      Severity: Minor
      Found in modules/auxiliary/scanner/smb/smb_login.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 do_enum has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def do_enum(cmd, usernames)
      
          users = []
          usernames.each {|user|
            next if user.downcase == 'root'
      Severity: Minor
      Found in modules/auxiliary/scanner/smtp/smtp_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 run_host has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def run_host(ip)
          # No point to continue if no filename is specified
          if datastore['FILEPATH'].nil? or datastore['FILEPATH'].empty?
            print_error("Please supply the name of the file you want to download")
            return
      Severity: Minor
      Found in modules/auxiliary/scanner/misc/zenworks_preboot_fileaccess.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 do_test_relay has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def do_test_relay(testnumber, mailfrom, mailto)
          begin
            connect
      
            res = raw_send_recv("EHLO X\r\n")
      Severity: Minor
      Found in modules/auxiliary/scanner/smtp/smtp_relay.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_hku_entry has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        def check_hku_entry(key, ip, smbshare, cmd, text, bat)
      Severity: Minor
      Found in modules/auxiliary/scanner/smb/psexec_loggedin_users.rb - About 45 mins to fix

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

          def fuzz_this_cmd(cmd)
            @fuzzcommands = datastore['FUZZCMDS'].split(",")
            fuzzme = 0
            @fuzzcommands.each do |thiscmd|
              if ((cmd.upcase == thiscmd.upcase) || (thiscmd=="*")) && (fuzzme==0)
        Severity: Minor
        Found in modules/auxiliary/fuzzers/ftp/client_ftp.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 @error_cnt >= @nr_errors
                        print_status("System does not respond - exiting now\n")
                        @stopprocess = true
                        print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
                        return
        Severity: Major
        Found in modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb - About 45 mins to fix

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

            def fuzz_this_headerfield(fieldname)
              fuzzheaderfields = datastore['HEADERFIELDS'].split(",")
              fuzzme = 0
              if fuzzheaderfields.size > 0
                fuzzheaderfields.each do |thisfield|
          Severity: Minor
          Found in modules/auxiliary/fuzzers/http/http_form_field.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 fieldname == "" and fieldid != ""
                            fieldname = fieldid
                          end
          Severity: Major
          Found in modules/auxiliary/fuzzers/http/http_form_field.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                              if thisfield.match(/^value=/)
                                # special case
                                location = fielddata[0].index(thisfield)
                                delta = fielddata[0].size - location
                                remaining = fielddata[0][location,delta]
            Severity: Major
            Found in modules/auxiliary/fuzzers/http/http_form_field.rb - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

                                if thisfield.match(/^id=/)
                                  fieldid = get_field_val(thisfield)
                                end
              Severity: Major
              Found in modules/auxiliary/fuzzers/http/http_form_field.rb - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                              if @error_cnt >= @nr_errors
                                @error_cnt = 0
                              end
                Severity: Major
                Found in modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                    if thisfield.match(/^type=/)
                                      fieldtype = get_field_val(thisfield)
                                    end
                  Severity: Major
                  Found in modules/auxiliary/fuzzers/http/http_form_field.rb - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                  if (e.class.name == 'Rex::ConnectionRefused') or (e.class.name == 'EOFError') or (e.class.name == 'Errno::ECONNRESET' and datastore['CONNRESET']) or (e.class.name == 'Errno::EPIPE')
                                    if @error_cnt >= @nr_errors
                                      print_status("System does not respond - exiting now\n")
                                      @stopprocess = true
                                      print_error("Error: #{e.class} #{e} #{e.backtrace}\n")
                    Severity: Major
                    Found in modules/auxiliary/fuzzers/ftp/ftp_pre_post.rb - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language