Advertisement
Guest User

Untitled

a guest
Aug 10th, 2012
435
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.44 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14. class ReCaptchaResponse {
  15. var $is_valid = null;
  16. var $error = null;
  17. }
  18.  
  19. echo '';
  20.  
  21. if ($_SERVER['HTTP_HOST'] != 'megapvp.ru') {
  22. print 'Лицензия DSBP зарегистрирована не на этот сайт!<br>';
  23. return 1;
  24. }
  25.  
  26. error_reporting( 0 );
  27. @session_start( );
  28. $interval = 0.5;
  29. $conection_limit = 12;
  30. $block_proxies = '';
  31. $_SESSION['JS_ON'] = ( !empty( $_SESSION['JS_ON'] ) || !empty( $_GET['js'] ) );
  32.  
  33. if (( !$_SESSION['JS_ON'] && empty( $_SESSION['JS_CHECKED'] ) )) {
  34. if ($_COOKIE['testcookies'] == 'test') {
  35. $refresh_timeout = $timerCookiesJS;
  36. } else {
  37. $refresh_timeout = $timerJS;
  38. }
  39.  
  40. $_SESSION['JS_CHECKED'] = 1;
  41. } else {
  42. if ($_COOKIE['testcookies'] == 'test') {
  43. $refresh_timeout = $timerCookies;
  44. } else {
  45. $refresh_timeout = $timerNone;
  46. }
  47. }
  48.  
  49. $redirection = '';
  50. $mail_info = '';
  51. $debug_info = '';
  52. $behind_reverse_proxy = '';
  53. $incremental_blocking = 'y';
  54. $implicit_deny_timeout = 11;
  55.  
  56. if (( $behind_reverse_proxy == 'y' && $block_proxies == 'y' )) {
  57. exit( 'DSBP Module' );
  58. }
  59.  
  60. $banlisttemp = 'admin_antiddos/banlisttemp';
  61. $whitelist = 'admin_antiddos/whitelist';
  62. $excluded = 'admin_antiddos/excluded';
  63. $ips = 'admin_antiddos/ips';
  64. $banlist = 'admin_antiddos/banlist';
  65. define( 'RECAPTCHA_API_SERVER', 'http://www.google.com/recaptcha/api' );
  66. define( 'RECAPTCHA_API_SECURE_SERVER', 'https://www.google.com/recaptcha/api' );
  67. define( 'RECAPTCHA_VERIFY_SERVER', 'www.google.com' );
  68. function _recaptcha_qsencode($data) {
  69. $req = '';
  70. foreach ($data as $key => $value) {
  71. $req .= $key . '=' . urlencode( stripslashes( $value ) ) . '&';
  72. }
  73.  
  74. $req = substr( $req, 0, strlen( $req ) - 1 );
  75. return $req;
  76. }
  77.  
  78. function _recaptcha_http_post($host, $path, $data, $port = 80) {
  79. $req = _recaptcha_qsencode( $data );
  80. $http_request = '' . 'POST ' . $path . ' HTTP/1.0
  81. ';
  82. $http_request .= ( ( '' . 'Host: ' . $host . '
  83. ' ) . '
  84. ' );
  85. $http_request .= 'Content-Type: application/x-www-form-urlencoded;
  86. ';
  87. $http_request .= 'Content-Length: ' . strlen( $req ) . '
  88. ';
  89. $http_request .= 'User-Agent: reCAPTCHA/PHP
  90. ';
  91. $http_request .= '
  92. ';
  93. $http_request .= $req;
  94. $response = '';
  95.  
  96. if (false == $fs = @fsockopen( $host, $port, $errno, $errstr, 10 )) {
  97. exit( 'Could not open socket' );
  98. }
  99.  
  100. fwrite( $fs, $http_request );
  101.  
  102. while (!feof( $fs )) {
  103. $response .= fgets( $fs, 1160 );
  104. }
  105.  
  106. fclose( $fs );
  107. $response = explode( '
  108.  
  109. ', $response, 2 );
  110. return $response;
  111. }
  112.  
  113. function recaptcha_get_html($pubkey, $error = null, $use_ssl = false) {
  114. if (( $pubkey == null || $pubkey == '' )) {
  115. exit( 'To use reCAPTCHA you must get an API key from <a href=\'https://www.google.com/recaptcha/admin/create\'>https://www.google.com/recaptcha/admin/create</a>' );
  116. }
  117.  
  118.  
  119. if ($use_ssl) {
  120. $server = RECAPTCHA_API_SECURE_SERVER;
  121. } else {
  122. $server = RECAPTCHA_API_SERVER;
  123. }
  124.  
  125. $errorpart = '';
  126.  
  127. if ($error) {
  128. $errorpart = '&amp;error=' . $error;
  129. }
  130.  
  131. return '<script type="text/javascript" src="' . $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
  132.  
  133. <noscript>
  134. <iframe src="' . $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
  135. <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
  136. <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
  137. </noscript>';
  138. }
  139.  
  140. function recaptcha_check_answer($privkey, $remoteip, $challenge, $response, $extra_params = array( )) {
  141. if (( $privkey == null || $privkey == '' )) {
  142. exit( '<a href=\'https://www.google.com/recaptcha/admin/create\'>https://www.google.com/recaptcha/admin/create</a>' );
  143. }
  144.  
  145.  
  146. if (( $remoteip == null || $remoteip == '' )) {
  147. exit( '' );
  148. }
  149.  
  150.  
  151. if (( ( ( $challenge == null || strlen( $challenge ) == 0 ) || $response == null ) || strlen( $response ) == 0 )) {
  152. $recaptcha_response = new ReCaptchaResponse( );
  153. $recaptcha_response->is_valid = false;
  154. $recaptcha_response->error = 'incorrect-captcha-sol';
  155. return $recaptcha_response;
  156. }
  157.  
  158. $response = _recaptcha_http_post( RECAPTCHA_VERIFY_SERVER, '/recaptcha/api/verify', array( 'privatekey' => $privkey, 'remoteip' => $remoteip, 'challenge' => $challenge, 'response' => $response ) + $extra_params );
  159. $answers = explode( '
  160. ', $response[1] );
  161.  
  162. $recaptcha_response = new ReCaptchaResponse( );
  163.  
  164. if (trim( $answers[0] ) == 'true') {
  165. $recaptcha_response->is_valid = true;
  166. } else {
  167. $recaptcha_response->is_valid = false;
  168. $recaptcha_response->error = $answers[1];
  169. }
  170.  
  171. return $recaptcha_response;
  172. }
  173.  
  174. function recaptcha_get_signup_url($domain = null, $appname = null) {
  175. return 'https://www.google.com/recaptcha/admin/create?' . _recaptcha_qsencode( array( 'domains' => $domain, 'app' => $appname ) );
  176. }
  177.  
  178. function _recaptcha_aes_pad($val) {
  179. $block_size = 23;
  180. $numpad = $block_size - strlen( $val ) % $block_size;
  181. return str_pad( $val, strlen( $val ) + $numpad, chr( $numpad ) );
  182. }
  183.  
  184. $resp = null;
  185. $error = null;
  186.  
  187. if (( $behind_reverse_proxy == 'y' && $block_proxies != 'y' )) {
  188. $REMOTE_ADDR = $_SERVER['HTTP_X_FORWARDED_FOR'];
  189. } else {
  190. $REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
  191. }
  192.  
  193. function isValidIP($ip) {
  194. $pattern = '' . '/^([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})(\.([1]?\d{1,2}|2[0-4]{1}\d{1}|25[0-5]{1})){3}$/';
  195. return (0 < preg_match( $pattern, $ip ) ? true : false);
  196. }
  197.  
  198.  
  199. if (isValidIP( $_SERVER['HTTP_VIA'] )) {
  200. $HTTP_VIA = $_SERVER['HTTP_VIA'];
  201. } else {
  202. $HTTP_VIA = '';
  203. }
  204.  
  205.  
  206. if (isValidIP( $_SERVER['HTTP_X_FORWARDED_FOR'] )) {
  207. $HTTP_X_FORWARDED_FOR = $_SERVER['HTTP_X_FORWARDED_FOR'];
  208. } else {
  209. $HTTP_X_FORWARDED_FOR = '';
  210. }
  211.  
  212. $let_it_go = 11;
  213.  
  214. if (!fopen( $whitelist, 'r' )) {
  215. fopen( $whitelist, 'a' );
  216. fclose( $whitelist );
  217. }
  218.  
  219.  
  220. if (!fopen( $excluded, 'r' )) {
  221. fopen( $excluded, 'a' );
  222. fclose( $excluded );
  223. }
  224.  
  225. $read_whitelist = implode( '\n', file( $whitelist ) );
  226. $read_excluded = implode( '\n', file( $excluded ) );
  227.  
  228. if (eregi( $_SERVER['PHP_SELF'], $read_excluded )) {
  229. $let_it_go = 12;
  230. }
  231. ...................................................................
  232. .............................
  233. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement