All Projects → szepeviktor → waf4wordpress

szepeviktor / waf4wordpress

Licence: other
WAF for WordPress 🔥 with 60+ security checks and weekly updates

Programming Languages

PHP
23972 projects - #3 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to waf4wordpress

Botwall4j
A botwall for Java web applications
Stars: ✭ 41 (-59.8%)
Mutual labels:  firewall, waf
Waf
🚦Web Application Firewall or API Gateway(应用防火墙/API网关)
Stars: ✭ 547 (+436.27%)
Mutual labels:  firewall, waf
Awesome Waf
🔥 Everything about web-application firewalls (WAF).
Stars: ✭ 4,047 (+3867.65%)
Mutual labels:  firewall, waf
shieldfy-php-client
The official PHP SDK for Shieldfy
Stars: ✭ 15 (-85.29%)
Mutual labels:  firewall, waf
Whatwaf
Detect and bypass web application firewalls and protection systems
Stars: ✭ 1,881 (+1744.12%)
Mutual labels:  firewall, waf
Xwaf
xWAF 3.0 - Free Web Application Firewall, Open-Source.
Stars: ✭ 48 (-52.94%)
Mutual labels:  firewall, waf
Laravel Firewall
Web Application Firewall (WAF) package for Laravel
Stars: ✭ 544 (+433.33%)
Mutual labels:  firewall, waf
Cidram
CIDRAM: Classless Inter-Domain Routing Access Manager.
Stars: ✭ 86 (-15.69%)
Mutual labels:  firewall, waf
Docker Waf
An NGINX and ModSecurity based Web Application Firewall for Docker
Stars: ✭ 181 (+77.45%)
Mutual labels:  firewall, waf
aws-firewall-factory
Deploy, update, and stage your WAFs while managing them centrally via FMS.
Stars: ✭ 72 (-29.41%)
Mutual labels:  firewall, waf
Mikrotik-Blacklist
Mikrotik friendly blacklist to filter all these damn hackers.
Stars: ✭ 70 (-31.37%)
Mutual labels:  firewall
LAF
Linux Application Firewall
Stars: ✭ 8 (-92.16%)
Mutual labels:  firewall
opensnitch
OpenSnitch is a GNU/Linux port of the Little Snitch application firewall
Stars: ✭ 7,734 (+7482.35%)
Mutual labels:  firewall
roxy-wi
Web interface for managing Haproxy, Nginx, Apache and Keepalived servers
Stars: ✭ 1,109 (+987.25%)
Mutual labels:  waf
openresty-project-v0.01
🌹 基于OpenResty编写一个MVC模式的WEB项目 V0.01
Stars: ✭ 40 (-60.78%)
Mutual labels:  waf
releases-openstar-Enterprise
releases-openstar-Enterprise
Stars: ✭ 53 (-48.04%)
Mutual labels:  waf
butterfly
Butterfly connects Virtual Machines and control their traffic flow
Stars: ✭ 48 (-52.94%)
Mutual labels:  firewall
opnsense-starterkit
Try opnsense, build opnsense images or start development
Stars: ✭ 18 (-82.35%)
Mutual labels:  firewall
ddos-mitigation
Tips to mitigate and secure your large-scale server against DDoS attacks.
Stars: ✭ 58 (-43.14%)
Mutual labels:  firewall
nxtool-ng
Because life is too short to waste your time transforming naxsi logs to rules by hand
Stars: ✭ 40 (-60.78%)
Mutual labels:  waf

WAF for WordPress

Stop real-life attacks on your WordPress website and trigger Fail2ban.

This WAF does not give proper HTTP responses to unusual requets. It blocks the attacking IP address instantly, the purpose of this are the following.

  1. Prevent website compromise in further requests
  2. Prevent D/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.

Theory

Your WordPress - really general HTTP - security consists of:

  1. Use HTTPS
  2. Have daily backups
  3. Block known hostile networks
  4. Have Fail2ban installed (controls the firewall)
  5. Maintain your website and use strict Fail2ban filters which ban on the first suspicious request instantly
  6. Deny direct access to core WordPress files, themes and plugins
  7. Install WAF for WordPress (this project)
  8. Use Leanmail for filtering Fail2ban notification emails

See the Block WordPress attack vectors note in my other repository for an overview of the topic.

Installation of Http_Analyzer class

Examines headers in the HTTP requests and triggers Fail2ban accordingly.

To install it copy http-analyzer/waf4wordpress-http-analyzer.php beside your wp-config.php and copy these lines in top of wp-config.php:

/** Security */
require_once __DIR__ . '/waf4wordpress-http-analyzer.php';
new \Waf4WordPress\Http_Analyzer();

A better solution is to load it from the auto_prepend_file PHP directive. This time you have to copy the above code in the class file.

Installation of Core_Events class

It is an MU plugin that triggers Fail2ban on various WordPress specific attack types. Login is only logged, use Http_Analyzer class for handling that.

To install copy core-events/waf4wordpress-core-events.php into your wp-content/mu-plugins/ directory. You may have to create the mu-plugins directory. It activates automatically.

About the non-wp-projects directory

Triggers Fail2ban on WordPress login probes in any project.

To install copy the fake non-wp-projects/wp-login.phpand non-wp-projects/xmlrpc.php to your non-WordPress project's document root.

Not available in WordPress.org's plugin directory

After is it published on WordPress.org you can install the plugin and skip file copying.
That way it'll be installed automatically.

How to support PayPal IPN, Braintree and custom entry points in poorly written plugins

Copy this into your in wp-config.php.

// Enable PayPal IPN in WooCommerce
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
    if ( '/wc-api/WC_Gateway_Paypal/' === parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH ) ) {
        // PayPal IPN does not send Accept: and User-Agent: headers
        $_SERVER['HTTP_ACCEPT'] = '*/*';
        $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 PayPal/IPN';
    }
}

// Enable Braintree Webhooks
new \Waf4WordPress\Braintree_Fix( '/braintree/webhook' );

// Enable email opens in Newsletter plugin
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
    $newsletter_path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
    if ( '/wp-content/plugins/newsletter/statistics/open.php' === $newsletter_path
        || '/wp-content/plugins/newsletter/statistics/link.php' === $newsletter_path
    ) {
        // UA hack for old email clients
        $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 ' . $_SERVER['HTTP_USER_AGENT'];
    }
    unset( $newsletter_path );
}

// Enable email open tracking in ALO EasyMail Newsletter plugin
if ( isset( $_SERVER['REQUEST_URI'] ) ) {
    $alo_path = parse_url( $_SERVER['REQUEST_URI'], PHP_URL_PATH );
    if ( '/wp-content/plugins/alo-easymail/tr.php' === $alo_path ) {
        // UA hack for old email clients
        $_SERVER['HTTP_USER_AGENT'] = 'Mozilla/5.0 ' . $_SERVER['HTTP_USER_AGENT'];
    }
    unset( $alo_path );
}

Support and feature requests

Open a new issue

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].