rapid7/metasploit-framework

View on GitHub

Showing 15,831 of 21,886 total issues

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

  def rfc3330_reserved(ip)
    case ip
    when PacketFu::Octets
      ip_x = ip.to_x
      ip_i = ip.to_i
Severity: Minor
Found in lib/msf/core/db_manager/ip_address.rb - About 1 hr to fix

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

      def import_report(report, args, base_dir)
        tmp = args[:ifd][:zip_tmp]
        report_info = {}
    
        report.elements.each do |e|
    Severity: Minor
    Found in lib/msf/core/db_manager/import/report.rb - About 1 hr to fix

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

            def start_service
              comm = _determine_server_comm(bindhost)
              auth_handler = Rex::Proto::LDAP::Auth.new(
                datastore['CHALLENGE'],
                datastore['Domain'],
      Severity: Minor
      Found in lib/msf/core/exploit/remote/ldap/server.rb - About 1 hr to fix

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

          def with_prepended_auto_check
            unless datastore['AutoCheck']
              print_warning('AutoCheck is disabled, proceeding with exploitation')
              return yield
            end
        Severity: Minor
        Found in lib/msf/core/exploit/remote/auto_check.rb - About 1 hr to fix

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

              def start_payload_listeners
                # Spawn nothing if the user doesn't want to pop sessions.
                return if datastore['MaxSessionCount'] == 0
          
                # Don't repeat launching payload handlers
          Severity: Minor
          Found in lib/msf/core/exploit/remote/browser_autopwn2.rb - About 1 hr to fix

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

              def splunk_login(username, password, timeout = 20)
                # gets cval cookies
                cookie = splunk_helper_extract_token(timeout)
                if cookie.nil?
                  vprint_error('Unable to extract login tokens')
            Severity: Minor
            Found in lib/msf/core/exploit/remote/http/splunk/login.rb - About 1 hr to fix

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

                def postgres_upload_binary_data(data, remote_fname=nil)
                  remote_fname ||= Rex::Text::rand_text_alpha(8) + ".dll"
              
                  # From the Postgres documentation:
                  #   SELECT lo_creat(-1);       -- returns OID of new, empty large object
              Severity: Minor
              Found in lib/msf/core/exploit/remote/postgres.rb - About 1 hr to fix

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

                            def build_pa_for_user(opts = {})
                              auth_package = 'Kerberos'.b
                
                              checksum_data = [Rex::Proto::Kerberos::Model::NameType::NT_PRINCIPAL].pack('I<')
                              checksum_data << opts[:username].b
                Severity: Minor
                Found in lib/msf/core/exploit/remote/kerberos/client/tgs_request.rb - About 1 hr to fix

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

                        def connect(global=true, versions: [], backend: nil, direct: nil)
                          if versions.nil? || versions.empty?
                            versions = datastore['SMB::ProtocolVersion'].split(',').map(&:strip).reject(&:blank?).map(&:to_i)
                            # if the user explicitly set the protocol version to 1, still use ruby_smb
                            backend ||= :ruby_smb if versions == [1]
                  Severity: Minor
                  Found in lib/msf/core/exploit/remote/smb/client.rb - About 1 hr to fix

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

                      def initialize(info={})
                        super(update_info(info,
                          'Platform'      => %w{ java linux osx solaris win },
                          'Payload'       => { 'BadChars' => '', 'DisableNops' => true },
                          'Targets'       =>
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/firefox_addon_generator.rb - About 1 hr to fix

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

                            def probe_gateway(addr)
                              dst_host = datastore['GATEWAY_PROBE_HOST']
                              dst_port = datastore['GATEWAY_PROBE_PORT'].to_i == 0 ? rand(30000) + 1024 : datastore['GATEWAY_PROBE_PORT']
                              preamble = [datastore['SECRET']].pack("N")
                              secret   = "#{preamble}#{Rex::Text.rand_text(rand(0xff)+1)}"
                      Severity: Minor
                      Found in lib/msf/core/exploit/capture.rb - About 1 hr to fix

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

                          def merge_check_key(info, name, val)
                            if (self.respond_to?("merge_info_#{name.downcase}", true))
                              self.send("merge_info_#{name.downcase}", info, val)
                            else
                              # If the info hash already has an entry for this name
                        Severity: Minor
                        Found in lib/msf/core/module/module_info.rb - About 1 hr to fix

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

                            def initialize(options={})
                              self.options = options
                              # call super to initialize MonitorMixin.  #synchronize won't work without this.
                              super()
                          
                          
                          Severity: Minor
                          Found in lib/msf/core/framework.rb - About 1 hr to fix

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

                              def make_nops(count)
                                # If we're debugging, then make_nops will return a safe sled.  We
                                # currently assume x86.
                                if debugging?
                                  return "\x90" * count
                            Severity: Minor
                            Found in lib/msf/core/exploit.rb - About 1 hr to fix

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

                                def asm_invoke_dll(opts={})
                                  asm = %Q^
                                      ; prologue
                                        dec ebp               ; 'M'
                                        pop edx               ; 'Z'
                              Severity: Minor
                              Found in lib/msf/core/payload/windows/reflective_dll_inject.rb - About 1 hr to fix

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

                                        def create_object_symlink(_root, link_name, target_name)
                                          process = session.sys.process.open
                                
                                          unicode_str = setup_unicode_str_in_memory(process, link_name)
                                          return nil unless unicode_str
                                Severity: Minor
                                Found in lib/msf/core/post/windows/file_system.rb - About 1 hr to fix

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

                                          def bind_default_ldap_server(size_limit, domain = nil)
                                            vprint_status('Initializing LDAP connection.')
                                  
                                            # If domain is still null the API may be able to handle it...
                                            init_result = wldap32.ldap_sslinitA(domain, 389, 0)
                                  Severity: Minor
                                  Found in lib/msf/core/post/windows/ldap.rb - About 1 hr to fix

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

                                      def write_data_by_id(bus, src_id, dst_id, id, data, opt = {})
                                        unless client.automotive
                                          print_error("Not an automotive hwbridge session")
                                          return {}
                                        end
                                    Severity: Minor
                                    Found in lib/msf/core/post/hardware/automotive/uds.rb - About 1 hr to fix

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

                                              def add_reg_key_value(reg_key, reg_value, reg_data, reg_type, opts = {})
                                                log_and_print('[Task Scheduler] Restoring the Security Descriptor registry key value to unhide the task')
                                      
                                                # Override by default. It has to be explicitly set to false if we don't want the key to be overridden.
                                                unless opts[:override].nil? || opts[:override]
                                      Severity: Minor
                                      Found in lib/msf/core/post/windows/task_scheduler.rb - About 1 hr to fix

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

                                                  def self.jtr_to_db(cred_type)
                                                    case cred_type
                                                    when 'descrypt' # from aix module
                                                      return ['des']
                                                    when 'oracle' # from databases module
                                        Severity: Minor
                                        Found in lib/metasploit/framework/password_crackers/jtr/formatter.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language