1. Go to this page and download the library: Download rmanara/brutalforce library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
rmanara / brutalforce example snippets
rutalForce\Initiate;
if (session_status() !== PHP_SESSION_ACTIVE) {
session_start();
}
$guard = new Initiate();
// Text label based on current cadence profile
$rate = $guard->Rate();
// Numeric score (rounded to 3 decimals)
$score = $guard->predict();
if ($score <= 0.5) {
http_response_code(429);
exit('Too many requests');
}
$decision = $guard->decision();
if ($decision['blocked']) {
header('Retry-After: ' . $decision['retry_after']);
http_response_code(429);
exit('Too many requests');
}