rapid7/metasploit-framework

View on GitHub

Showing 15,831 of 21,886 total issues

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

  def build_request(v)
    xml = ''

    elo = Rex::Text.rand_text_alpha(rand(12)+4)

Severity: Minor
Found in modules/exploits/multi/http/rails_xml_yaml_code_exec.rb - About 1 hr to fix

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

      def send_crafted_request(path:, qsl: datastore['MinQSL'], customh_length: 1, cmd: '', allow_retry: true)
        uri = Rex::Text.uri_encode(normalize_uri(target_uri.path, path)).gsub(/([?&])/, { '?' => '%3F', '&' => '%26' })
        qsl_delta = uri.length - path.length - Rex::Text.uri_encode(target_uri.path).length
        if qsl_delta.odd?
          fail_with Failure::Unknown, "Got odd qslDelta, that means the URL encoding gone wrong: path=#{path}, qsl_delta=#{qsl_delta}"
    Severity: Minor
    Found in modules/exploits/multi/http/php_fpm_rce.rb - About 1 hr to fix

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

        def exploit
          # if we are using the exec CMD stager
          # important to check which php functions are disabled
          if datastore['CMD']
            p = "passthru(\"%s\");" % datastore['CMD']
      Severity: Minor
      Found in modules/exploits/multi/http/phpldapadmin_query_engine.rb - About 1 hr to fix

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

          def pick_target
            return target if target.name != 'Automatic'
        
            print_status("Determining target")
        
        
        Severity: Minor
        Found in modules/exploits/multi/http/eventlog_file_upload.rb - About 1 hr to fix

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

            def exploit
              @username = datastore['USERNAME']
              @password = datastore['PASSWORD']
              @auth_cookies = ''
              p = payload.encoded
          Severity: Minor
          Found in modules/exploits/multi/http/splunk_mappy_exec.rb - About 1 hr to fix

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

              def exploit
                @use_public_repo = true
                datastore['GIT_USERNAME'] = datastore['USERNAME']
                datastore['GIT_PASSWORD'] = datastore['PASSWORD']
            
            
            Severity: Minor
            Found in modules/exploits/multi/http/bitbucket_env_var_rce.rb - About 1 hr to fix

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

                def save_page(nodeid, userid, pt_id, payload_url, wi_id, session_info)
                  print_status("Sending request to '#{target_uri.path}/admin/savepage' to save new page at '#{payload_url}'.")
                  res = send_request_cgi({
                    'method' => 'POST',
                    'uri' => normalize_uri(target_uri.path, 'admin', 'savepage'),
              Severity: Minor
              Found in modules/exploits/multi/http/vbulletin_getindexablecontent.rb - About 1 hr to fix

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

                  def upload_payload(backdoor_fname, payload_fname)
                    p = generate_payload_exe(
                      code: payload.encoded,
                      platform: @my_target.platform,
                      arch: @my_target.arch

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

                    def log_in(username, password)
                      res = send_request_cgi(
                        'method' => 'GET',
                        'uri' => normalize_uri(target_uri.path, 'login'),
                        'keep_cookies' => true
                  Severity: Minor
                  Found in modules/exploits/multi/http/bitbucket_env_var_rce.rb - About 1 hr to fix

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

                      def change_username(curr_uname, new_uname)
                        @user_id ||= get_user_id(curr_uname)
                    
                        headers = {
                          'X-Requested-With' => 'XMLHttpRequest',
                    Severity: Minor
                    Found in modules/exploits/multi/http/bitbucket_env_var_rce.rb - About 1 hr to fix

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

                        def exploit
                          @proto = (ssl ? 'https' : 'http')
                      
                          if (!check.eql? Exploit::CheckCode::Vulnerable) && !datastore['ForceExploit']
                            fail_with(Failure::NotVulnerable, 'The target is not exploitable.')
                      Severity: Minor
                      Found in modules/exploits/multi/http/apache_normalize_path_rce.rb - About 1 hr to fix

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

                          def exploit
                            uri = normalize_uri(target_uri.path)
                            payload_name = "#{rand_text_alpha(5)}.php"
                        
                            print_status("Trying to upload #{payload_name} to mma.php Backdoor")
                        Severity: Minor
                        Found in modules/exploits/multi/http/mma_backdoor_upload.rb - About 1 hr to fix

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

                            def exploit
                          
                              print_status("Checking injection...")
                          
                              if check == Exploit::CheckCode::Vulnerable
                          Severity: Minor
                          Found in modules/exploits/multi/http/apache_roller_ognl_injection.rb - About 1 hr to fix

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

                              def ognl_append_file(payload_file, payload_chunk)
                                data_header = datastore['HEADER'] + 'd'
                                file_header = datastore['HEADER'] + 'f'
                                headers = {
                                  "#{data_header}": payload_chunk,
                            Severity: Minor
                            Found in modules/exploits/multi/http/struts2_namespace_ognl.rb - About 1 hr to fix

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

                                def upload_php?(login_token, shell_filename)
                                  vprint_status("Uploading PHP file #{shell_filename}")
                                  vars_form_data =
                                    [
                                      {
                              Severity: Minor
                              Found in modules/exploits/multi/http/cve_2023_38836_boidcms.rb - About 1 hr to fix

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

                                  def exploit
                                    session_id = login_bypass
                                    fail_with(Failure::NoAccess, 'Login bypass failed') unless session_id
                                
                                    print_good('Login bypass successful')
                                Severity: Minor
                                Found in modules/exploits/multi/http/navigate_cms_rce.rb - About 1 hr to fix

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

                                    def exploit
                                      print_status("Checking if the wp-config.php file already exists...")
                                      tpath_wp_config = normalize_uri(datastore['TARGETURI'] + '/../wp-config.php')
                                      response = send_request_cgi({ 'uri' => tpath_wp_config }, timeout = datastore['TIMEOUT'])
                                  
                                  
                                  Severity: Minor
                                  Found in modules/exploits/multi/php/wp_duplicator_code_inject.rb - About 1 hr to fix

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

                                      def on_request_uri(cli, request)
                                        print_status("handling request for #{request.uri}")
                                    
                                        case request.uri
                                        when /\.jar$/i

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

                                        def create_function?(language, func_name)
                                          load_func = ''
                                      
                                          case language
                                          when 'perl'
                                      Severity: Minor
                                      Found in modules/exploits/multi/postgres/postgres_createlang.rb - About 1 hr to fix

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

                                          def on_request_uri(cli, request)
                                            print_status("handling request for #{request.uri}")
                                        
                                            case request.uri
                                            when /\.jar$/i
                                        Severity: Minor
                                        Found in modules/exploits/multi/browser/java_jre17_method_handle.rb - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language