Download the PHP package ilogus/laravel-honeypotplus without Composer
On this page you can find all versions of the php package ilogus/laravel-honeypotplus. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ilogus/laravel-honeypotplus
More information about ilogus/laravel-honeypotplus
Files in ilogus/laravel-honeypotplus
Package laravel-honeypotplus
Short Description Laravel package to detect malicious IPs, ban them via Cloudflare, and report to AbuseIPDB
License MIT
Homepage https://github.com/ilogus/laravel-honeypotplus
Informations about the package laravel-honeypotplus
HoneypotPlus for Laravel
A Laravel package that detects malicious IPs attempting to access sensitive files/paths, bans them via Cloudflare, reports them to AbuseIPDB, and provides an interactive CLI management interface.
Note: This package is not a form honeypot. For form honeypot protection, consider using spatie/laravel-honeypot. HoneypotPlus focuses on detecting malicious reconnaissance attempts on sensitive paths like
.env,.git,wp-admin, etc.
Features
- Honeypot Detection: Detect malicious IP access attempts on sensitive paths (
.env,wp-admin, etc.) - Cloudflare Integration: Automatically ban IPs via Cloudflare Firewall Rules
- AbuseIPDB Reporting: Automatically report malicious IPs to AbuseIPDB
- Automatic Cleanup: Scheduled task to unban expired bans
- Interactive CLI: Manage blocked IPs with
php artisan honeypot-plus:manage - Event-Driven: Clean architecture using Laravel's Event/Listener system
- Zero Configuration: Features auto-enable when API keys are present
Requirements
- PHP 8.3 or higher
- Laravel 12.x or 13.x
Installation
Install the package:
This will:
- Publish the configuration file to
config/honeypot-plus.php - Publish the migration file to
database/migrations/
Configuration
The package works out of the box with default settings. To customize, edit the published configuration file:
Environment Variables
Add the following to your .env file:
Getting Cloudflare API Token
- Go to Cloudflare Dashboard
- Navigate to My Profile → API Tokens
- Create a token with Edit permission for Zone → Firewall Rules
- Copy the token
Getting AbuseIPDB API Key
- Sign up at AbuseIPDB
- Navigate to API section
- Copy your API key
Usage
Middleware
Add the middleware to your application to intercept malicious requests before Laravel's routing:
Important: Use
append()to ensure the honeypot middleware runs before Laravel's routing. Otherwise, Laravel will return a 404 page for non-existent routes instead of allowing the honeypot to detect and block malicious IPs.
Custom Honeypot Rules
In config/honeypot-plus.php, you can customize the honeypot patterns:
CLI Management
List and manage blocked IPs interactively:
Available actions:
- List blocked IPs
- Ban an IP manually
- Unban an IP
- Show statistics
Manual Ban/Unban via Facade
Artisan Commands
| Command | Description |
|---|---|
php artisan honeypot-plus:install |
Install the package (publish config & migration) |
php artisan honeypot-plus:manage |
Interactive IP management |
php artisan honeypot-plus:cleanup |
Clean up expired bans (runs automatically) |
Automatic Scheduling
The cleanup command is automatically registered in Laravel's scheduler. No manual configuration needed.
To verify the schedule:
Database Schema
The package creates a honeypot_plus_attacks table with the following columns:
| Column | Type | Description |
|---|---|---|
id |
bigint | Primary key |
ip |
string | Attacker IP address |
honeypot_rule |
string | Matched honeypot pattern |
user_agent |
string (nullable) | Request user agent |
http_method |
string | Request method (GET, POST, etc.) |
path_requested |
string | Requested path |
reported_at |
timestamp (nullable) | When reported to AbuseIPDB |
cf_rule_id |
string (nullable) | Cloudflare rule ID |
expiration_at |
timestamp (nullable) | Ban expiration |
is_blocked |
boolean | Currently blocked |
already_reported |
boolean | Already reported to AbuseIPDB |
last_seen_at |
timestamp (nullable) | Last activity |
Architecture
The package follows Laravel best practices with a clean, event-driven architecture:
Testing
Run the test suite:
Run with coverage:
Security
If you discover a security vulnerability, please email [email protected].
License
HoneypotPlus is open-source software licensed under the MIT license.
Credits
Support
All versions of laravel-honeypotplus with dependencies
illuminate/support Version ^11.54|^12.0|^13.0
illuminate/http Version ^11.54|^12.0|^13.0
illuminate/console Version ^11.54|^12.0|^13.0
illuminate/events Version ^11.54|^12.0|^13.0
illuminate/queue Version ^11.54|^12.0|^13.0
illuminate/database Version ^11.54|^12.0|^13.0