I am trying to use Recaptcha v2 to defend against brute force. I have got the recaptcha all set up and working so that the user needs to verify every time they login. HOWEVER, when attempting an automated brute force, the attack is still successful. I know this is because they can use the original recaptcha response from their first login and use it every time. So what I am asking is how can I make it so it needs to match the new verification each time? Maybe getting a response when the captcha expires?? here is my html code:
<div class="g-recaptcha" data-sitekey="6LdRT5QUAAAAAD_BucIv7sDUhLE7iVtHRUR9LyhM"></div>
<br/>
PHP:
$secret = 'my secret';
$verifyResponse = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret='.$secret.'&response='.$_POST['g-recaptcha-response']);
$responseData = json_decode($verifyResponse);
echo $responseData;
if($responseData->success)
{
if ($state->num_rows == 1)
{
$row[]=array($firstName, $lastName);
echo json_encode($state);
$_SESSION['uName'] = $uName;
}
else {
echo ("false");
}
}
else {
echo ("false");
}
}
Thanks in advance.