rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

Method start has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        def start
          if serve_udp
            @udp_sock = Rex::Socket::Udp.create(sock_options)
            self.listener_thread = Rex::ThreadFactory.spawn('UDPLDAPServerListener', false) do
              monitor_listener
Severity: Minor
Found in lib/rex/proto/ldap/server.rb - About 1 hr to fix

    Method from_data has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def self.from_data(data)
          message = Message.from_data(data)
          # abort if this isn't a valid response
          return unless message
          return unless message.type == BOOTSTRAP_RESPONSE
    Severity: Minor
    Found in lib/rex/proto/kademlia/bootstrap_response.rb - About 1 hr to fix

      Method dial has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def dial(number)
          self.client.send_new(self, number)
          res = wait_for(Constants::IAX_SUBTYPE_AUTHREQ, Constants::IAX_SUBTYPE_ACCEPT)
          return if not res
      
      
      Severity: Minor
      Found in lib/rex/proto/iax2/call.rb - About 1 hr to fix

        Method mssql_upload_exec has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def mssql_upload_exec(exe, debug=false)
                  hex = exe.unpack("H*")[0]
        
                  var_bypass  = Rex::Text.rand_text_alpha(8)
                  var_payload = Rex::Text.rand_text_alpha(8)
        Severity: Minor
        Found in lib/rex/proto/mssql/client.rb - About 1 hr to fix

          Method dn_expand has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def dn_expand(packet,offset)
                  name = ""
                  packetlen = packet.size
                  while true
                    raise ExpandError, "offset is greater than packet length!" if packetlen < (offset+1)
          Severity: Minor
          Found in lib/net/dns/names/names.rb - About 1 hr to fix

            Method monitor_server_sock has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              def monitor_server_sock
                yield "Listening for incoming ACKs" if block_given?
                res = self.server_sock.recvfrom(65535)
                if res and res[0]
                  code, type, data = parse_tftp_response(res[0])
            Severity: Minor
            Found in lib/rex/proto/tftp/client.rb - About 1 hr to fix

              Method on_data_read has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    def on_data_read(data, _data_type)
                      return data if data.blank?
              
                      ssm_frame = SsmFrame.read(data)
                      case ssm_frame.header.message_type.strip
              Severity: Minor
              Found in lib/rex/proto/http/web_socket/amazon_ssm.rb - About 1 hr to fix

                Method make_alter_context has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def self.make_alter_context(uuid, vers)
                    u = Rex::Proto::DCERPC::UUID
                
                    # Process the version strings ("1.0", 1.0, "1", 1)
                    bind_vers_maj, bind_vers_min = UUID.vers_to_nums(vers)
                Severity: Minor
                Found in lib/rex/proto/dcerpc/packet.rb - About 1 hr to fix

                  Method make_request_chunk has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def self.make_request_chunk(flags=3, opnum=0, data="", ctx=0, object_id = '')
                  
                      flags = flags.to_i
                      opnum = opnum.to_i
                      ctx   = ctx.to_i
                  Severity: Minor
                  Found in lib/rex/proto/dcerpc/packet.rb - About 1 hr to fix

                    Method start has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def start
                        self.listener = Rex::Socket::TcpServer.create(
                          'LocalHost'      => self.listen_host,
                          'LocalPort'      => self.listen_port,
                          'Context'        => self.context,
                    Severity: Minor
                    Found in lib/rex/proto/smb/server.rb - About 1 hr to fix

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

                          def initialize(config = {})
                            raise ResolverArgumentError, "Argument has to be Hash" unless config.kind_of? Hash
                            # config.key_downcase!
                            @config = Defaults.merge config
                            @config[:config_file] ||= self.class.default_config_file
                      Severity: Minor
                      Found in lib/rex/proto/dns/resolver.rb - About 1 hr to fix

                        Method create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          def create(filename, disposition = 1, impersonation = 2, do_recv = true)
                        
                            pkt = CONST::SMB_CREATE_PKT.make_struct
                            self.smb_defaults(pkt['Payload']['SMB'])
                        
                        
                        Severity: Minor
                        Found in lib/rex/proto/smb/client.rb - About 1 hr to fix

                          Method read_ruby_smb has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                def read_ruby_smb(length, offset, depth = 0)
                                  file_size = client.open_files[client.last_file_id].size
                                  file_size_remaining = file_size - offset
                                  if length.nil?
                                    max_size = file_size_remaining
                          Severity: Minor
                          Found in lib/rex/proto/smb/simple_client/open_file.rb - About 1 hr to fix

                            Method sud_syscall_hook has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              def self.sud_syscall_hook(opts = {})
                                r0_recovery = opts['RecoveryStub'] || Recovery.default
                                r3_payload  = opts['UserModeStub'] || ''
                                r3_prefix   = _run_only_in_win32proc_stub("\xff\x25\x08\x03\xfe\x7f", opts)
                                r3_size     = ((r3_prefix.length + r3_payload.length + 3) & ~0x3) / 4
                            Severity: Minor
                            Found in lib/rex/payloads/win32/kernel/stager.rb - About 1 hr to fix

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

                                  def initialize(wildcard: '*', resolvers: [], comm: nil)
                                    ::ArgumentError.new("Invalid wildcard text: #{wildcard}") unless self.class.valid_wildcard?(wildcard)
                                    @wildcard = wildcard
                                    socket_options = {}
                                    socket_options['Comm'] = comm unless comm.nil?
                              Severity: Minor
                              Found in lib/rex/proto/dns/upstream_rule.rb - About 1 hr to fix

                                Method send has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    def send(argument, type = Dnsruby::Types::A, cls = Dnsruby::Classes::IN)
                                      case argument
                                      when Dnsruby::Message
                                        req = argument
                                      when Net::DNS::Packet, Resolv::DNS::Message
                                Severity: Minor
                                Found in lib/rex/proto/dns/cached_resolver.rb - About 1 hr to fix

                                  Method report_web_page has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      def report_web_page(&block)
                                        return unless(in_issue && has_text)
                                        return unless @state[:web_site].present?
                                        return unless @state[:response_headers].present?
                                        return unless @state[:uri].present?
                                  Severity: Minor
                                  Found in lib/rex/parser/appscan_document.rb - About 1 hr to fix

                                    Method tag_start has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      def tag_start(name, attributes)
                                        case name
                                        when "host"
                                          @host['hid'] = attributes['persistent_id']
                                        when "ip"
                                    Severity: Minor
                                    Found in lib/rex/parser/ip360_xml.rb - About 1 hr to fix

                                      Method generate_ssl_context has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        def generate_ssl_context
                                      
                                          ctx = nil
                                          ssl_cert_info = nil
                                      
                                      
                                      Severity: Minor
                                      Found in lib/rex/post/meterpreter/client.rb - About 1 hr to fix

                                        Method sizeof_type has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def sizeof_type(type)
                                            if is_pointer_type?(type)
                                              return pointer_size
                                            end
                                        
                                        
                                        Severity: Minor
                                        Found in lib/rex/post/meterpreter/extensions/stdapi/railgun/util.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language