rapid7/metasploit-framework

View on GitHub

Showing 15,730 of 21,757 total issues

Method on_passive_request has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def on_passive_request(cli, req)

    begin

    resp = Rex::Proto::Http::Response.new(200, "OK")
Severity: Minor
Found in lib/rex/post/meterpreter/packet_dispatcher.rb - About 1 hr to fix

    Method cmd_route_help has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def cmd_route_help
        print_line "Route traffic destined to a given subnet through a supplied session."
        print_line
        print_line "Usage:"
        print_line "  route [add/remove] subnet netmask [comm/sid]"
    Severity: Minor
    Found in lib/msf/ui/console/command_dispatcher/core.rb - About 1 hr to fix

      Method ticket_search has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def ticket_search(host_ranges, id_search, workspace: framework.db.workspace)
          ticket_results = []
      
          # Iterating over each id here since the remote db doesn't support bulk id searches
          if id_search
      Severity: Minor
      Found in lib/msf/ui/console/command_dispatcher/db/klist.rb - About 1 hr to fix

        Method cmd_time has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def cmd_time(*args)
            if args.empty? || args.first == '-h' || args.first == '--help'
              cmd_time_help
              return true
            end
        Severity: Minor
        Found in lib/msf/ui/console/command_dispatcher/developer.rb - About 1 hr to fix

          Method run_simple has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def self.run_simple(omod, opts = {}, &block)
          
              # Clone the module to prevent changes to the original instance
              mod = omod.replicant
              Msf::Simple::Framework.simplify_module(mod)
          Severity: Minor
          Found in lib/msf/base/simple/post.rb - About 1 hr to fix

            Method init_module_paths has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    def init_module_paths(opts = {})
                      if @module_paths_inited
                        raise 'Module paths already initialized.  To add more module paths call `modules.add_module_path`'
                      end
            
            
            Severity: Minor
            Found in lib/msf/base/simple/framework/module_paths.rb - About 1 hr to fix

              Method cmd_lls has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      def cmd_lls(*args)
                        # Set Defaults
                        path = ::Dir.pwd
                        sort = 'Name'
                        order = :forward
              Severity: Minor
              Found in lib/msf/ui/console/local_file_system.rb - About 1 hr to fix

                Method find_internet_connected_address has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def find_internet_connected_address
                
                    ifaces = self.net.config.get_interfaces().flatten rescue []
                    routes = self.net.config.get_routes().flatten rescue []
                
                
                Severity: Minor
                Found in lib/msf/base/sessions/meterpreter.rb - About 1 hr to fix

                  Method valid_rpc_response? has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      def valid_rpc_response?(response)
                        # validate response is an object
                        return false unless response.is_a?(Hash)
                  
                        JSON_RPC_RESPONSE_REQUIRED_MEMBERS.each do |member|
                  Severity: Minor
                  Found in lib/msf/core/rpc/json/request.rb - About 1 hr to fix

                    Method rpc_payloads has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      def rpc_payloads(module_info = nil, arch = nil)
                        module_info_contains_size = false
                    
                        unless module_info.nil?
                          module_info = module_info.strip.split(',').map(&:strip)
                    Severity: Minor
                    Found in lib/msf/core/rpc/v10/rpc_module.rb - About 1 hr to fix

                      Method opts_to_services has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def opts_to_services(hosts,opts)
                        ::ApplicationRecord.connection_pool.with_connection {
                          wspace = find_workspace(opts[:workspace])
                          services = []
                          if opts[:host] or opts[:address] or opts[:addresses]
                      Severity: Minor
                      Found in lib/msf/core/rpc/v10/rpc_db.rb - About 1 hr to fix

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

                          def initialize(framework, options={})
                            self.framework = framework
                            self.handlers = {}
                            self.options  = {
                              :ssl  => true,
                        Severity: Minor
                        Found in lib/msf/core/rpc/v10/service.rb - About 1 hr to fix

                          Method prove_amplification has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            def prove_amplification(response_map)
                              vulnerable = false
                              proofs = []
                              response_map.each do |request, responses|
                                responses ||= []
                          Severity: Minor
                          Found in lib/msf/core/auxiliary/drdos.rb - About 1 hr to fix

                            Method hash_job has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                def hash_job(jtr_type, cracker)
                                  # create the base data
                                  job = { 'type' => jtr_type, 'formatted_hashlist' => [], 'creds' => [], 'cred_ids_left_to_crack' => [] }
                                  job['db_formats'] = Metasploit::Framework::PasswordCracker::JtR::Formatter.jtr_to_db(jtr_type)
                                  if jtr_type == 'dynamic_1034' # postgres
                            Severity: Minor
                            Found in lib/msf/core/auxiliary/password_cracker.rb - About 1 hr to fix

                              Method log_fingerprint has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  def log_fingerprint(opts = {})
                                    mode  = name
                                    vhash = [target.to_url, opts[:fingerprint], mode, opts[:location]]
                                            .map(&:to_s).join('|').hash
                              
                              
                              Severity: Minor
                              Found in lib/msf/core/auxiliary/web.rb - About 1 hr to fix

                                Method extract_word_pair_from_memory has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  def extract_word_pair_from_memory(memloc)
                                    begin
                                      creds = []
                                      obj = get_object_from_memory_location(memloc)
                                      unless obj.all_creds.empty?
                                Severity: Minor
                                Found in lib/msf/core/auxiliary/auth_brute.rb - About 1 hr to fix

                                  Method crawler_options has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    def crawler_options(t)
                                      opts = {}
                                      opts[:user_agent]      = datastore['UserAgent']
                                      opts[:verbose]         = false
                                      opts[:threads]         = max_crawl_threads
                                  Severity: Minor
                                  Found in lib/msf/core/auxiliary/http_crawler.rb - About 1 hr to fix

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

                                        def create(name, aliased_as: nil)
                                          # First, a direct alias check
                                          return create(self.aliases[name], aliased_as: name) if self.aliases[name]
                                    
                                          # Check to see if it has a module type prefix.  If it does,
                                    Severity: Minor
                                    Found in lib/msf/core/module_manager.rb - About 1 hr to fix

                                      Method handle_ip360_v3_vuln has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        def handle_ip360_v3_vuln(wspace,hobj,port,proto,hname,vulnid,vulnname,cves,bids,task=nil)
                                          info = { :workspace => wspace, :host => hobj, :port => port, :proto => proto, :task => task }
                                          if hname != "unknown" and hname[-1,1] != "?"
                                            info[:name] = hname
                                          end
                                      Severity: Minor
                                      Found in lib/msf/core/db_manager/import/ip360/v3.rb - About 1 hr to fix

                                        Method report_session_event has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          def report_session_event(opts)
                                            return if not active
                                            raise ArgumentError.new("Missing required option :session") if opts[:session].nil?
                                            raise ArgumentError.new("Expected an :etype") unless opts[:etype]
                                            session = nil
                                        Severity: Minor
                                        Found in lib/msf/core/db_manager/session_event.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language