Download the PHP package szepeviktor/waf4wordpress without Composer
On this page you can find all versions of the php package szepeviktor/waf4wordpress. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package waf4wordpress
WAF for WordPress
Stop real-life attacks on your WordPress website and trigger Fail2Ban.
:bulb: Before using this WAF you have to clean your website, get rid of even tiny errors. See your access and error logs daily and run this WAF without Fail2ban for a week.
This WAF does not give proper HTTP responses to unusual requests. It blocks the attacking IP address instantly, the purpose of this are the following.
- Prevent website compromise in further requests
- Prevent DoS attacks
Shared hosting has no server-wide banning (because of trust issues) but you can still install this software without Fail2Ban to stop attacks by using one of the Miniban methods.
Support my work
Please consider sponsoring me monthly if you use my packages in an agency.
Theory
Your WordPress - really general HTTP - security consists of the followings.
- Use HTTPS
- Have daily backups
- Block known hostile networks
- Have Fail2Ban installed (controls the firewall)
- Maintain your website and use strict Fail2Ban filters which ban on the first suspicious request instantly
- Deny direct access to core WordPress files, themes and plugins
- Install WAF for WordPress (this project)
- Use Leanmail for filtering Fail2Ban notification emails
See the Block WordPress attack vectors note in my other repository for an overview of the topic.
Composer installation
Technically this is not a WordPress plugin nor an MU plugin. WAF for WordPress is distributed and autoloaded as a Composer package.
- Issue
composer require szepeviktor/waf4wordpress
command - Load
vendor/autoload.php
from yourwp-config
-
Instantiate
SzepeViktor\WordPress\Waf\HttpAnalyzer
class early inwp-config
- Create an MU plugin in
wp-content/mu-plugins/waf4wordpress.php
Manual installation
:bulb: Please see Composer-managed WordPress for managing WordPress with Composer.
Technically this is not a WordPress plugin nor an MU plugin.
- First download
WAF for WordPress
then extract files to a directory, e.g.
waf/
-
Instantiate
SzepeViktor\WordPress\Waf\HttpAnalyzer
class early inwp-config
- Create an MU plugin in
wp-content/mu-plugins/waf4wordpress.php
Configuration
WAF for WordPress is configured in source code
before class instantiation. in wp-config
.
Create custom filters for Fail2Ban catching these PHP messages.
- Likely malicious requests:
Malicious traffic detected:
may be banned after 6 attempts per 10 minutes - Surely break-in attempts:
Break-in attempt detected:
may be banned instantly
How to support PayPal IPN, Braintree and custom entry points in poorly written plugins
Copy this into your in wp-config.php
.
Bug reports and feature requests
Where script kiddies look for WordPress
/backup/
/blog/
/cms/
/demo/
/dev/
/home/
/main/
/new/
/old/
/portal/
/site/
/test/
/tmp/
/web/
/wordpress/
/wp/
Best not to create these directories to avoid lengthy log excerpts.