rapid7/metasploit-framework

View on GitHub

Showing 15,730 of 21,757 total issues

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

    def fingerprint_service(target_uri)
      res = send_request_raw(
        'uri'    => normalize_uri(target_uri, 'version'),
        'method' => 'GET'
      )
Severity: Minor
Found in lib/msf/core/auxiliary/etcd.rb - About 1 hr to fix

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

        def parse_rocketmq_data(res)
          # remove a response header so we have json-ish data
          res = res[8..]
    
          # we have 2 json objects appended to each other, so we now need to split that out and make it usable
    Severity: Minor
    Found in lib/msf/core/auxiliary/rocketmq.rb - About 1 hr to fix

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

        def srandom_r (seed)
          state = @randtbl
          if seed == 0
            seed = 1
          end
      Severity: Minor
      Found in lib/msf/core/auxiliary/crand.rb - About 1 hr to fix

        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 validate has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def validate
                  # First, validate that a target has been selected
                  if (target_idx == nil)
                    raise MissingTargetError,
                      "A payload cannot be selected until a target is specified.",
              Severity: Minor
              Found in lib/msf/core/exploit_driver.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 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_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 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_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 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 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 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 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 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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language