403Webshell
Server IP : 10.200.247.200  /  Your IP : 216.73.217.19
Web Server : Apache
System : Linux synergy-usa-sites 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64
User : jeremy ( 1001)
PHP Version : 8.4.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/usa_sites/americasgotgrants.com/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/usa_sites/americasgotgrants.com/convert_heic_files.php
<?php
	die();
	include_once($_SERVER['DOCUMENT_ROOT']."/vx/lib/dinc.php");
	function PostFields($url,$fields)
	{
		$fields = http_build_query($fields);
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
		curl_setopt($ch, CURLOPT_REFERER, $_SERVER["HTTP_HOST"] . $_SERVER['REQUEST_URI']);
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch, CURLOPT_POST, 1);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
		curl_setopt($ch, CURLOPT_USERAGENT, "LCAPI cUrl Agent");
		curl_setopt($ch, CURLOPT_VERBOSE, true);
		ob_start();   
		$data = curl_exec ($ch);  
		ob_end_clean(); 
		curl_close ($ch);

		return $data;
	}
	
	$res = $db->get_results("SELECT id,photo_path
							FROM lc2admin.usa_testimonials
							WHERE photo_path LIKE '%.heic'");
	$db->debug();
	if(!empty($res)) {
		foreach($res as $r) {
			$new_location = str_ireplace('.heic','.jpg',$r->photo_path);
			$file = file_get_contents('https://surfcrm.com/bin/ajax/load_file_from_amazon_open.php?file='.urlencode($r->photo_path));
			file_put_contents('/tmp/testimonial_'.$r->id.'.heic',$file);
			$heic_filepath = '/tmp/testimonial_'.$r->id.'.heic';
			$jpg_filepath = '/tmp/testimonial_'.$r->id.'.jpg';
			$escapedInput = escapeshellarg($heic_filepath);
			$escapedOutput = escapeshellarg($jpg_filepath);
			$command = "convert $escapedInput $escapedOutput";
			exec($command, $output, $returnVar);
			if ($returnVar !== 0) {
				//imagick conversion failed
				echo 'imagick failed';
				var_dump($output);
				die();
			} else {
				//echo $escapedOutput;
				//echo file_get_contents($jpg_filepath);
				//die();
				include_once($_SERVER['DOCUMENT_ROOT'].'/vx/lib/amazon_uploader.php');
				if(upload_to_amazon('media.learningcentersupport.com',$new_location,'',$jpg_filepath)) {
					$db->query("UPDATE lc2admin.usa_testimonials
								SET photo_path = '".$db->clean($new_location)."'
								WHERE id='".$db->clean($r->id)."'");
					
				}				
			}
			//die();
		}
	}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit