PHP code example of noobsec / antiscanscanclub-laravel
1. Go to this page and download the library: Download noobsec/antiscanscanclub-laravel 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/ */
noobsec / antiscanscanclub-laravel example snippets
namespace App\Http\Middleware;
use Closure;
use noobsec\AntiScanScanClub\AntiScanScanClub;
class AntiScanScanMiddleware
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
$ASSC = new AntiScanScanClub();
$blocker = TRUE;
$ASSC->checkIp($request->ip());
if ($request->isMethod('GET') && $request->getQueryString() === NULL) {
/**
* Prevention of access to credentials and/ important files/path
* (e.g: wp-admin.php, .git/, backups.tar.gz, www.sql)
*/
$ASSC->filterFile($request->getPathInfo(), $blocker, $request->ip());
} else {
$ASSC->filterInput($request->all(), $blocker, $request->ip());
}
return $next($request);
}
}