rapid7/metasploit-framework

View on GitHub

Showing 16,065 of 22,177 total issues

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

  def group_vulns(vulns)
    return [] if vulns.empty?

    vulns = vulns.map do |vuln|
      [vuln, Set.new(vuln.refs.map {|r| r.name.upcase})]
Severity: Minor
Found in lib/msf/core/analyze.rb - About 1 hr to fix

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

      def self.parse_search_string(search_string)
        search_string ||= ''
        search_string += ' '
    
        # Split search terms by space, but allow quoted strings
    Severity: Minor
    Found in lib/msf/core/modules/metadata/search.rb - About 1 hr to fix

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

        def encoded_exe(opts={})
          # Ensure arch and platform are in the format that to_executable expects
          if opts[:arch] and not opts[:arch].kind_of? Array
            opts[:arch] = [ opts[:arch] ]
          end
      Severity: Minor
      Found in lib/msf/core/encoded_payload.rb - About 1 hr to fix

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

            def redis_command(*commands)
              command_string = printable_redis_response(commands.join(' '))
              unless (command_response = send_redis_command(*commands))
                vprint_error("No response to '#{command_string}'")
                return
        Severity: Minor
        Found in lib/msf/core/auxiliary/redis.rb - About 1 hr to fix

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

            def import_amap_log(args={}, &block)
              data = args[:data]
              wspace = Msf::Util::DBManager.process_opts_workspace(args, framework).name
              bl = validate_ips(args[:blacklist]) ? args[:blacklist].split : []
          
          
          Severity: Minor
          Found in lib/msf/core/db_manager/import/amap.rb - About 1 hr to fix

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

              def unserialize_object(xml_elem, allow_yaml = false)
                return nil unless xml_elem
                string = xml_elem.text.to_s.strip
                return string unless string.is_a?(String)
                return nil if (string.empty? || string.nil?)
            Severity: Minor
            Found in lib/msf/core/db_manager/import/metasploit_framework.rb - About 1 hr to fix

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

                def import_msf_web_vuln_element(element, options={}, &notifier)
                  options.assert_valid_keys(:allow_yaml, :workspace)
              
                  import_msf_web_element(element,
                                         :allow_yaml => options[:allow_yaml],
              Severity: Minor
              Found in lib/msf/core/db_manager/import/metasploit_framework/xml.rb - About 1 hr to fix

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

                  def add_javascript_interface_exploit_js(arch)
                    %Q|
                      function exec(runtime, cmdArr) {
                        var ch = 0;
                        var output = '';
                Severity: Minor
                Found in lib/msf/core/exploit/android.rb - About 1 hr to fix

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

                    def vim_get_dcs
                      soap_data = vim_soap_envelope(vim_soap_retrieve_service_content)
                      res = vim_send_soap_request(soap_data)
                      if res.class == Hash
                        @server_objects.merge!(res['RetrieveServiceContentResponse']['returnval'])
                  Severity: Minor
                  Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

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

                      def initialize(info = {})
                        super
                    
                        register_options(
                          [
                    Severity: Minor
                    Found in lib/msf/core/exploit/remote/tcp.rb - About 1 hr to fix

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

                        def vim_powerOFF_vm(vm_ref)
                          soap_data = vim_soap_envelope(vim_soap_power_off_vm(vm_ref))
                          res = vim_send_soap_request(soap_data)
                          if res.class == Hash
                            task_id = res['PowerOffVM_TaskResponse']['returnval']
                      Severity: Minor
                      Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

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

                          def vim_powerON_vm(vm_ref)
                            soap_data = vim_soap_envelope(vim_soap_power_on_vm(vm_ref))
                            res = vim_send_soap_request(soap_data)
                            if res.class == Hash
                              task_id = res['PowerOnVM_TaskResponse']['returnval']
                        Severity: Minor
                        Found in lib/msf/core/exploit/remote/vim_soap.rb - About 1 hr to fix

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

                            def sign_license_agreement(cookies, nsp)
                              if cookies.blank?
                                return [2, 'Cannot sign the license agreement. The provided cookies are empty or nil.']
                              end
                          
                          
                          Severity: Minor
                          Found in lib/msf/core/exploit/remote/http/nagios_xi/install.rb - About 1 hr to fix

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

                              def wordpress_helper_post_comment(comment, comment_post_id, login_cookie, author, email, url)
                                vars_post = {
                                  'comment' => comment,
                                  'submit' => 'Post+Comment',
                                  'comment_post_ID' => comment_post_id.to_s,
                            Severity: Minor
                            Found in lib/msf/core/exploit/remote/http/wordpress/helpers.rb - About 1 hr to fix

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

                                def ncs_send_request(opts={}, req=nil, temp: true)
                                  req = generate_req(opts) unless req
                                  return nil unless req
                              
                                  if datastore['NCSTRACE']
                              Severity: Minor
                              Found in lib/msf/core/exploit/remote/nuuo.rb - About 1 hr to fix

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

                                    def authenticate(service_name, username, password = nil)
                                      debug { 'Sending SSH_MSG_USERAUTH_REQUEST (publickey)' }
                                
                                      # Corrupt everything after auth method
                                      send_message(userauth_request(
                                Severity: Minor
                                Found in lib/msf/core/exploit/remote/ssh/auth_methods/malformed_packet.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  = rand_text_alpha(8)
                                      var_payload = rand_text_alpha(8)
                                  Severity: Minor
                                  Found in lib/msf/core/exploit/remote/mssql_sqli.rb - About 1 hr to fix

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

                                      def exe_init_options(opts)
                                        opts.merge!(
                                          {
                                            :template_path => datastore['EXE::Path'],
                                            :template => datastore['EXE::Template'],
                                    Severity: Minor
                                    Found in lib/msf/core/exploit/exe.rb - About 1 hr to fix

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

                                            def arp(target_ip=nil)
                                              return self.arp_cache[target_ip] if self.arp_cache[target_ip]
                                              return self.arp_cache[:gateway] unless should_arp? target_ip
                                              source_ip = Rex::Socket.source_address(target_ip)
                                              raise RuntimeError, "Could not access the capture process." unless self.arp_capture
                                      Severity: Minor
                                      Found in lib/msf/core/exploit/capture.rb - About 1 hr to fix

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

                                          def ascii85_encode(stream)
                                            eod = "~>"
                                            i = 0
                                            code = ""
                                            input = stream.dup
                                        Severity: Minor
                                        Found in lib/msf/core/exploit/pdf.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language