:: **Zploit** v1.0 | Current Path: **/opt/a2-optimized/wordpress/**
:: Editing File: hcaptcha_lib.php
<?php /** * Gets the challenge JS widget. * This is called from the browser, and the resulting hCAPTCHA HTML widget * is embedded within the HTML form it was called form. * * @return string - The HTML to be embedded in the user's form. */ function a2_hcaptcha_get_html($error = null){ $siteKey = 'b09c11ce-4e0b-4e86-87c2-34098ad65c11'; $theme = 'light'; if(get_option('a2_hcaptcha_theme') && get_option('a2_hcaptcha_theme') == "dark"){ $theme = 'dark'; } if(get_option('a2_hcaptcha_usecustom') && get_option('a2_hcaptcha_sitekey')){ $siteKey = get_option('a2_hcaptcha_sitekey'); } $output = <<<HTML <script src='https://www.hCaptcha.com/1/api.js' async defer></script> <div class="h-captcha" data-sitekey="{$siteKey}" data-theme="{$theme}"></div> <style> body.login .h-captcha{ position: relative; top: -6px; left: -15px; } </style> HTML; return $output; } /** * Calls an HTTP POST function to verify if the user's guess was correct * @param string $recaptcha_response * * @return bool */ function a2_hcaptcha_verify($hcaptcha_response){ $secretKey = '0x59Eb8970598d633Eece3b894069F90Ba0E608D8D'; if(get_option('a2_hcaptcha_usecustom') && get_option('a2_hcaptcha_secretkey')){ $secretKey = get_option('a2_hcaptcha_secretkey'); } $response = wp_remote_post( 'https://hcaptcha.com/siteverify', array( 'method' => 'POST', 'timeout' => 45, 'blocking' => true, 'body' => array( 'secret' => $secretKey, 'response' => $hcaptcha_response ), 'cookies' => array() ) ); if(is_wp_error( $response )){ return true; // If the request fails for some reason, treat it as a passing captcha so users are not locked out } else { $body = json_decode(wp_remote_retrieve_body($response)); if($body->success){ return true; } else { return false; } } }