Download the PHP package bdsa/wafy without Composer
On this page you can find all versions of the php package bdsa/wafy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package wafy
Short Description A Laravel package to automatically ban IP addresses and detect malicious requests.
License MIT
Informations about the package wafy
Wafy - Laravel Firewall & Malicious Request Detector
Wafy is a robust Laravel package developed by Bdsa designed to automatically ban IP addresses and detect malicious requests, including SQL Injection, XSS, and more.
Features
- 🛡️ IP Banning: Automatically block IPs engaging in suspicious activity.
- 🕵️ Malicious Request Detection: Detects SQLi, XSS, LFI, and RCE attempts.
- ⏱️ Temporary & Permanent Bans: Configurable ban durations.
- ⚙️ Customizable Patterns: Define your own regex patterns for detection.
- 🖥️ Artisan Commands: Easily manage banned IPs via CLI.
Installation
1. Require with Composer
Add the package to your project:
2. Publish Configuration
Publish the configuration file and migrations:
3. Run Migrations
Create the banned_ips table:
Usage
Middleware
Wafy provides two key middlewares : BlockBannedIp & DetectMaliciousRequests.
Protecting Routes
Apply the middleware to your routes or groups:
Artisan Commands
Manage banned IPs directly from the terminal:
-
Ban an IP manually:
-
Unban an IP:
-
List all banned IPs:
-
Enable/Disable WAF:
- Set Action Mode (Block or Log-Only):
Configuration
The configuration file is located at config/wafy.php. You can customize the detection patterns here.
Default protection covers:
- SQL Injection (SQLi):
UNION SELECT, common SQL verbs, hex encoding. - Local File Inclusion (LFI): Directory traversal (
../), system files (/etc/passwd). - Cross-Site Scripting (XSS): Script tags, event handlers (
onload,onerror). - Remote Code Execution (RCE): Shell commands (
cat,wget), PHP execution functions.
Example config/wafy.php:
Testing
To run the package tests:
License
This project is licensed under the MIT License.