An implimentation of Project Honeypot's http:BL for YOURLS
http:BL is a block list service from Project Honeypot with an API that is trivial to hook into. While other spam management services & plugins, such as Phishtank, can check outgoing links, content submissions, and re-check old redirects, Project Honeypot's http:BL acts as a gatekeeper, stopping malicious users at the door before they can do any damage.
This plugin can help filter out spam submissions on a YOURLS public interface and on the API. It will redirect any bad IP to an informative and customization friendly block/intercept page written with Bootstrap. If greylisted, any human users will be able to easily set a cookie and access the YOURLS installation. For the API users, it will simply send back an Error 403.
Here are a few of HTTP:BL's features
- Add Honeypot links to YOURLS to catch new spambots in action
- Configure threshold levels for blocking and greylisting per threat type (or use defaults for ease of use).
- Use either native YOURLS style or a custom intercept page for flagged IP's. Edit the template, or redirect to your own URL.
- Granular log keeping: log only event types that you want, or none at all.
- Flush the log table and start fresh whenever you want.
- Self-managing: this plugin will (optionally) drop its tables when deactivated, and will create its own tables on activation.
- Whitelist IP addressess to skip checks; autodetection and 1-click addition of the current IP.
- An API for White-List maintanence.
- Integration with SMTP-contact and Compliance
- A working YOURLS installation
- YOURLS mysql user should have CREATE TABLE grants on YOURLS database. See NOTE.
- A Project Honeypot API Key. (Look here)
- A Project Honeypot url or Quicklink url (optional)
- Place the httpBL folder in YOURLS/user/plugins/
- Activate http:BL for Yourls in the Admin interface - sql tables should be made automatically
- Set options in the HTTP:BL options page. API key is required.
- If using a custom URL for blocking, please note the following requests that will be sent to your URL
action
grey or blacklistip
the offending IP addresstype
the threat type (eg: content spammer)level
the threat level (0-255)
- For information regarding the API, see the http:BL page in the Admin area.
- In order for this to work on your public page, place the following before anything else:
// Start YOURLS engine
require_once( dirname(__FILE__).'/includes/load-yourls.php' );
- When using the Sleaky interface, edit
index.php
to put the above line before
include 'header.php';
and place the following at the bottom of frontpage/footer.php
<?php if( ( yourls_is_active_plugin( 'httpBL/plugin.php' ) && yourls_get_option('httpBL_honeypot' ) ) ) print httpbl_link() . "\n"; ?>
- The sql table may need to be added manually using
httpBL/assets/httpBL.sql
. If so, make sure to alter that file to reflect theYOURLS_DB_PREFIX
setting inconfig.php
. - set
define( 'HTTPBL_DB_UPDATE', true );
inconfig.php
for one page load to update DB from v2.3.x
Use a script that manages callbacks and stores IP addresses in a flat file to update and delete IP's in the white-list automagically via cron.
Scripts used for inspiration and/or copypasta:
Dogecoin: DARhgg9q3HAWYZuN95DKnFonADrSWUimy3
===========================
Copyright (C) 2016 Josh Panter
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.