Recommend this page to a friend! |
Download .zip |
Info | Documentation | View files (18) | Download .zip | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 210 This week: 1 | All time: 8,367 This week: 560 |
Version | License | PHP version | Categories | |||
brutalforce 1.0.1 | The PHP License | 5 | PHP 5, Security |
Description | Author | ||||||||
This package can protect pages access against brute force attacks. |
|
Version: 1.0.7.1
composer require rmanara/brutalforce
Brute-Force method is used from many hackers but the <b>brutalforce</b> will help you void this problem by check the client IP and will count how many request in less than a 2 seconds how many request was done. Automaticly a file will be create and saved that ip and will save for futures request.
It is very simple setup and can be used in any frameworks.
<?php
$firewall = new BrutalForce\Firewall\Firewall(__DIR__, "sitekey", "secret");
<?php
$firewall->initializer(BrutalForce\Firewall\Firewall::TYPE_FILE);
<?php
if ($firewall->isLocked()) {
// here you check the recaptcha is already able to display
if ($firewall->verify()->recaptcha['valid'] == false) {
echo "<form method='post' action=''>";
// diplay message
echo $firewall->verify()->recaptcha['form_message'];
// show input
echo $firewall->verify()->recaptcha['form'];
echo "<button>send</button></form>";
} else {
echo $firewall->verify()->recaptcha['form_message']; PHP_EOL;
}
} else {
echo "free to go" . PHP_EOL;
}
by doing this the cound down will start from zero and the recaptcha will be called again from the last 3 counts
$firewall->resetLock(true);
Bugs:
enhancement:
Files |
File | Role | Description | ||
---|---|---|---|---|
src (1 directory) | ||||
tests (1 file, 1 directory) | ||||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
Files | / | src | / | BrutalForce |
File | Role | Description | ||
---|---|---|---|---|
Component (2 files) | ||||
FileManager (1 file) | ||||
Firewall (3 files) | ||||
Handler (4 files) |
Files | / | src | / | BrutalForce | / | Component |
File | Role | Description |
---|---|---|
CheckTime.php | Class | Class source |
RequestWrapper.php | Class | Class source |
Files | / | src | / | BrutalForce | / | Firewall |
File | Role | Description |
---|---|---|
Firewall.php | Class | Class source |
Holder.php | Class | Class source |
interfaceFirewall.php | Class | Class source |
Files | / | src | / | BrutalForce | / | Handler |
File | Role | Description |
---|---|---|
ByAbstract.php | Class | Class source |
byFile.php | Class | Class source |
ByInterface.php | Class | Class source |
HandlerInterface.php | Class | Class source |
Files | / | tests | / | BrutalForce |
File | Role | Description |
---|---|---|
ByFileTest.php | Class | Class source |
FirewallTest.php | Class | Class source |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
100% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.