Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.5.0
- * @ Author : DeZender
- * @ Release on : 09.06.2012
- * @ Official site : http://DeZender.Net
- *
- */
- class ReCaptchaResponse {
- var $is_valid = null;
- var $error = null;
- }
- echo '';
- if ($_SERVER['HTTP_HOST'] != 'megapvp.ru') {
- print 'Лицензия DSBP зарегистрирована не на этот сайт!<br>';
- return 1;
- }
- error_reporting( 0 );
- @session_start( );
- $interval = 0.5;
- $conection_limit = 12;
- $block_proxies = '';
- $_SESSION['JS_ON'] = ( !empty( $_SESSION['JS_ON'] ) || !empty( $_GET['js'] ) );
- if (( !$_SESSION['JS_ON'] && empty( $_SESSION['JS_CHECKED'] ) )) {
- if ($_COOKIE['testcookies'] == 'test') {
- $refresh_timeout = $timerCookiesJS;
- } else {
- $refresh_timeout = $timerJS;
- }
- $_SESSION['JS_CHECKED'] = 1;
- } else {
- if ($_COOKIE['testcookies'] == 'test') {
- $refresh_timeout = $timerCookies;
- } else {
- $refresh_timeout = $timerNone;
- }
- }
- $redirection = '';
- $mail_info = '';
- $debug_info = '';
- $behind_reverse_proxy = '';
- $incremental_blocking = 'y';
- $implicit_deny_timeout = 11;
- if (( $behind_reverse_proxy == 'y' && $block_proxies == 'y' )) {
- exit( 'DSBP Module' );
- }
- $banlisttemp = 'admin_antiddos/banlisttemp';
- $whitelist = 'admin_antiddos/whitelist';
- $excluded = 'admin_antiddos/excluded';
- $ips = 'admin_antiddos/ips';
- $banlist = 'admin_antiddos/banlist';
- define( 'RECAPTCHA_API_SERVER', 'http://www.google.com/recaptcha/api' );
- define( 'RECAPTCHA_API_SECURE_SERVER', 'https://www.google.com/recaptcha/api' );
- define( 'RECAPTCHA_VERIFY_SERVER', 'www.google.com' );
- function _recaptcha_qsencode($data) {
- $req = '';
- foreach ($data as $key => $value) {
- $req .= $key . '=' . urlencode( stripslashes( $value ) ) . '&';
- }
- $req = substr( $req, 0, strlen( $req ) - 1 );
- return $req;
- }
- function _recaptcha_http_post($host, $path, $data, $port = 80) {
- $req = _recaptcha_qsencode( $data );
- $http_request = '' . 'POST ' . $path . ' HTTP/1.0
- ';
- $http_request .= ( ( '' . 'Host: ' . $host . '
- ' ) . '
- ' );
- $http_request .= 'Content-Type: application/x-www-form-urlencoded;
- ';
- $http_request .= 'Content-Length: ' . strlen( $req ) . '
- ';
- $http_request .= 'User-Agent: reCAPTCHA/PHP
- ';
- $http_request .= '
- ';
- $http_request .= $req;
- $response = '';
- if (false == $fs = @fsockopen( $host, $port, $errno, $errstr, 10 )) {
- exit( 'Could not open socket' );
- }
- fwrite( $fs, $http_request );
- while (!feof( $fs )) {
- $response .= fgets( $fs, 1160 );
- }
- fclose( $fs );
- $response = explode( '
- ', $response, 2 );
- return $response;
- }
- function recaptcha_get_html($pubkey, $error = null, $use_ssl = false) {
- if (( $pubkey == null || $pubkey == '' )) {
- 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>' );
- }
- if ($use_ssl) {
- $server = RECAPTCHA_API_SECURE_SERVER;
- } else {
- $server = RECAPTCHA_API_SERVER;
- }
- $errorpart = '';
- if ($error) {
- $errorpart = '&error=' . $error;
- }
- return '<script type="text/javascript" src="' . $server . '/challenge?k=' . $pubkey . $errorpart . '"></script>
- <noscript>
- <iframe src="' . $server . '/noscript?k=' . $pubkey . $errorpart . '" height="300" width="500" frameborder="0"></iframe><br/>
- <textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
- <input type="hidden" name="recaptcha_response_field" value="manual_challenge"/>
- </noscript>';
- }
- function recaptcha_check_answer($privkey, $remoteip, $challenge, $response, $extra_params = array( )) {
- if (( $privkey == null || $privkey == '' )) {
- exit( '<a href=\'https://www.google.com/recaptcha/admin/create\'>https://www.google.com/recaptcha/admin/create</a>' );
- }
- if (( $remoteip == null || $remoteip == '' )) {
- exit( '' );
- }
- if (( ( ( $challenge == null || strlen( $challenge ) == 0 ) || $response == null ) || strlen( $response ) == 0 )) {
- $recaptcha_response = new ReCaptchaResponse( );
- $recaptcha_response->is_valid = false;
- $recaptcha_response->error = 'incorrect-captcha-sol';
- return $recaptcha_response;
- }
- $response = _recaptcha_http_post( RECAPTCHA_VERIFY_SERVER, '/recaptcha/api/verify', array( 'privatekey' => $privkey, 'remoteip' => $remoteip, 'challenge' => $challenge, 'response' => $response ) + $extra_params );
- $answers = explode( '
- ', $response[1] );
- $recaptcha_response = new ReCaptchaResponse( );
- if (trim( $answers[0] ) == 'true') {
- $recaptcha_response->is_valid = true;
- } else {
- $recaptcha_response->is_valid = false;
- $recaptcha_response->error = $answers[1];
- }
- return $recaptcha_response;
- }
- function recaptcha_get_signup_url($domain = null, $appname = null) {
- return 'https://www.google.com/recaptcha/admin/create?' . _recaptcha_qsencode( array( 'domains' => $domain, 'app' => $appname ) );
- }
- function _recaptcha_aes_pad($val) {
- $block_size = 23;
- $numpad = $block_size - strlen( $val ) % $block_size;
- return str_pad( $val, strlen( $val ) + $numpad, chr( $numpad ) );
- }
- $resp = null;
- $error = null;
- if (( $behind_reverse_proxy == 'y' && $block_proxies != 'y' )) {
- $REMOTE_ADDR = $_SERVER['HTTP_X_FORWARDED_FOR'];
- } else {
- $REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
- }
- function isValidIP($ip) {
- $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}$/';
- return (0 < preg_match( $pattern, $ip ) ? true : false);
- }
- if (isValidIP( $_SERVER['HTTP_VIA'] )) {
- $HTTP_VIA = $_SERVER['HTTP_VIA'];
- } else {
- $HTTP_VIA = '';
- }
- if (isValidIP( $_SERVER['HTTP_X_FORWARDED_FOR'] )) {
- $HTTP_X_FORWARDED_FOR = $_SERVER['HTTP_X_FORWARDED_FOR'];
- } else {
- $HTTP_X_FORWARDED_FOR = '';
- }
- $let_it_go = 11;
- if (!fopen( $whitelist, 'r' )) {
- fopen( $whitelist, 'a' );
- fclose( $whitelist );
- }
- if (!fopen( $excluded, 'r' )) {
- fopen( $excluded, 'a' );
- fclose( $excluded );
- }
- $read_whitelist = implode( '\n', file( $whitelist ) );
- $read_excluded = implode( '\n', file( $excluded ) );
- if (eregi( $_SERVER['PHP_SELF'], $read_excluded )) {
- $let_it_go = 12;
- }
- ...................................................................
- .............................
- ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement