Spring Sale! Save 30% on all books w/ code: PLANET24
Web Dev + WordPress + Security

BBQ Firewall (Free WordPress Plugin)

BBQ Firewall BBQ Firewall is a lightweight, super-fast plugin that protects your site against a wide range of threats. BBQ checks all incoming traffic and quietly blocks bad requests containing nasty stuff like eval(, base64_, and excessively long request-strings. This is a simple yet solid solution for sites that are unable to use a strong Apache/.htaccess firewall.

BBQ Firewall is available as a free or pro WordPress plugin. This post describes the free version of BBQ Firewall. Visit Plugin Planet to learn more about BBQ Pro.

BBQ is the lightest, fastest firewall plugin for WordPress.

Welcome to BBQ

BBQ adds a powerful firewall to your WordPress site. That’s it. No bells. No whistles. No bloat. Just a lean, mean bad-request blocking machine.

To use BBQ on any WordPress-powered site, install and activate the plugin via the WP Admin Area. Then sit back and enjoy the automatic, behind-the-scenes protection and a more secure website. No configuration required, just activate and done. BBQ is 100% plug-&-play, lightweight super fast, super strong WAF firewall.

BBQ adds powerful firewall protection with a few clicks.

Verify BBQ is working

Once BBQ is installed and active, you can verify that it’s working by requesting any of the following URLs (replace example.com with your own domain name).

  • http://example.com/proc/self/environ
  • http://example.com/path/?q=%2e%2e
  • http://example.com/path/base64_

These are just examples of the type of garbage that’s blocked by BBQ. If your server returns a 403 “Forbidden” response for these examples, BBQ is working properly. Silently protecting your site behind the scenes.

Note that additional tests are possible using the patterns contained in the firewall rules, located in the main plugin file, block-bad-queries.php.

Tip: Learn how to customize BBQ’s default firewall rules with free addons.

How BBQ works

BBQ basically is an adaptation of my Apache/.htaccess G-series firewalls ported to PHP/WordPress. The plugin works by defining a set of regular expressions to match and block malicious URL requests. The BBQ firewall rules have been refined and battle tested for years, with false positive rates near zero. It’s a simple, effective, lightweight solution that’s easy on server resources.

BBQ scans the following parts of each request:

  • The Request URI
  • The Query String
  • The User Agent
  • Referrer

Also for each request, BBQ checks all available request methods, GET, POST, PUT, DELETE, etc. Checking these variables against a strategically crafted set of known attack patterns is an effective way to protect your site against a wide range of threats.

If BBQ detects foul play in any part of the request, it is blocked immediately via 403 “Forbidden” response.

Tip: Check out the BBQ Customize plugin to enable pattern-match logging, customize response headers, and disable blocking of long URI requests.

More information

Check the following articles for more information on the underlying functionality:

More infos on this and related topics in the security and .htaccess archives.

Got BBQ? Get advanced firewall protection with BBQ Pro. BBQ Pro features a settings page with options for customizing firewall rules and much more.

Download BBQ Firewall

Download BBQ from the WordPress Plugin Directory:

Need help? Contact anytime via my contact form.

About the Author
Jeff Starr = Web Developer. Book Author. Secretly Important.
.htaccess made easy: Improve site performance and security.

118 responses to “BBQ Firewall (Free WordPress Plugin)”

  1. I was checking one of my websites recently in googles search results and I noticed someone has injected there product into my domain name i.e

    product.competitor.mysite.com

    using htaccess how can I overcome this a point this link to error access denied message

    • I think rather than redirecting, I would find and remove the hack, and then secure your site however possible to prevent further incidents. Unless I’ve misunderstood..?

  2. BBQ Update! New Version 20130103 should fix all reported issues. Thanks to all who provide feedback. Cheers!

    http://wordpress.org/extend/plugins/block-bad-queries/

  3. Robert Wilkins 2013/01/04 6:39 am

    Richard, I use both together on some of my sites with no problem. Sadly, Akismet is no longer free for business websites so I’m not able to use it as frequently.

  4. Hi Jeff – do you have any opinions or insights regarding using BBQ alongside Akismet and / or Bad Behavior (or not?) – …or any combination of the 3 – with considerations toward compatibility(s) or possible needless duplication of features? Many thanks as always.

    • I haven’t used Bad Behavior in years, but it should work fine with 5G/6G. BB and 5G/6G should work well together, but the blacklist should block most of the stuff that BB is supposed to catch, and in a more performance-friendly way. I do recommend Akismet for protecting against comment spam, and there is little (if any) overlap with 5G/6G in terms of functionality.

      • Hi Jeff – thanks for the quick and knowledgeable reply :)

        I actually dont allow comments on my site and in fact disallow browser access to the comments file and disallow no-referrer comments / emails from my contact form so I probly dont need Akismet.

        I’ll probly be removing Bad Behavior.

        I installed the latest BBQ last night – smooth sailing so far :) I have been testing my site from a proxied browser as well as my own ip and I have not encountered any 500 errors (and no warnings from Google Webmasters) that I was getting before.

        One more question: I have a bunch of directives in my htaccess for things like protecting the wp-config, the htaccess itself, wp-admin, wp-login, htaccess, htpasswd, ini, phps, fla, psd, log, sh, error, log – stuff you can find elsewhere on your site and others to secure wordpress – are there any of these you can think of off the top of your head that might be being duplicated in BBQ? Any chance to tidy up the htaccess is always very welcome:) thx again

      • Glad to hear the latest version of BBQ is working well. Please continue to report any issues so I can fix them for the next version.

        Concerning redundancy in code snippets, nothing off the top of my head, but I would be glad to take a closer look if you want to send a plain-text copy of the file to “jeff” at this domain :)

  5. Keith Davis 2013/01/04 10:34 am

    Appreciate the time you’ve put in to this one Jeff – I’ll give you a tweet in the #genesiswp.

    Many thanks

  6. Hi Jeff, just wanted to point out the code snippet you have here wont work on non wp sites.

    You say :

    ‘To use BBQ on non-WP sites, include the following code for each page request:’

    ‘Note that this is the exact same script that’s contained in the WP plugin ‘

    Non wordpress sites probably won’t have the apply filters function.

    'Fatal error: Call to undefined function apply_filters()'

    Keep up the great work though.

    • Good catch. The first few versions of the new BBQ were compatible with WP and non-WP sites, but after version 20121027 the plugin was revamped to work better with WordPress. I’ve corrected the error in the article with a brief note. Thank you for the heads up.

  7. Hi Jeff,

    I want to install the PHP script on my server.

    Do I simply upload it to the server at the main directory as is and grant it permission of 755? (Or is the default 644 permission enough?)

    Also, I’m not sure what you mean by “for each page request”. I think you are referring to the page requests that are in the script and nothing has to be configured or customized, right?’

    Much thanks for helping to make the web a safer place for all of us.

    • Jeff Starr 2013/01/21 1:26 pm

      Hi Sunny, you shouldn’t need to change any permissions for BBQ to work. Instead, include the file at the top of your web page(s), like so:

      <?php include_once("bbq.php"); ?>

      Note: you may need to change the path depending on your directory structure. Also, no configuration required, just include, test, and done.

      • Will this work for old cgi scripts?

        I guess the include_once link will not work on a regular html page and needs to be converted to a php page, right?

      • Jeff Starr 2013/01/24 4:18 pm

        That is correct when using this technique, the page needs to be served as PHP. See this reply regarding the CGI scripts.

  8. A version 20130103 of this plugin prevents proper operation of the plugin Post Highlights, there is something that can be done to fix this problem?

    • Let me know the URL(s) of the pages that aren’t working and I’ll explain a way to fix and/or resolve the issue for the next update.

  9. Hi Jeff,

    This will protect old CGI scripts as well as PHP scripts, right? I just want to confirm since I have a couple of old CGI scripts that are no longer supported and need protection.

    Also, at the risk of sounding like an idiot, can I put the ‘include_once’ line at the top of a regular html index page or do I need to convert it to a php page for it to work? Right now I have it at the top of an html page and think it’s working.

    Thanks again.

    • Jeff Starr 2013/01/24 4:08 pm

      For the script to protect a file, it needs to be called from that file. So for example, if I include BBQ in all PHP pages, it will be executed each time one of those pages is requested, thereby implementing the defense. To also protect CGI files, the script would somehow need to be called/included there as well. Unfortunately I’m unfamiliar with CGI stuffs, but can recommend as an alternative the 5G Blacklist, which will protect all files and directories from the site’s root directory.

  10. Hello Jeff

    thank you for your hard work, I appreciate this jobs it’s perfect for secure the website.
    I’m use BBQ & 5G-2013 in my site, I haven’t any problem or error but I have little question, I tested BBQ & 5G for sure it’s work fine .. by use the following example link:

    www.example.com/wp-admin/?etc/passwd

    after change to my domain and go .. I didn’t see forbidden 403 , I saw white page only so is this error? do plugin work fine ?

    thanks
    Rawaf

    • Jeff Starr 2013/02/08 4:14 pm

      Hi Rawaf, it sounds like an error, but I would check your server error logs while testing again and see which error code is being generated (plus any other useful info). That should help provide some clues :)

    • Hello Jeff

      Thank you for your response, I testing again and checked the log error and saw the following
      —————–
      [10-Feb-2013 01:09:23 UTC] PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so’ – /usr/local/lib/php/extensions/no-debug-non-zts-20060613/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
      [10-Feb-2013 01:09:23 UTC] PHP Deprecated: Directive ‘magic_quotes_gpc’ is deprecated in PHP 5.3 and greater in Unknown on line 0
      ————-
      maybe it will help you for understand the error

      thank you
      Rawaf

      • Rawaf, this is part of your php-configuration (php.ini).

        ask your server manager to handle those errors or use google.

        seems that yours PHP 5.2 has missing extensions and missing ~E_DEPRECATED from .ini-file

      • Thank you Elvin for your response
        I will check my php.ini

        regards

  11. Hi Jeff, I’m having an odd conflict with BBQ and the JetPack plugin by WordPress. Something in BBQ is blocking it from creating a contact form – a window comes up much like the Media window, allowing you to create and insert a form on any page or post – when BBQ is activated, that window is blank. If I deactivate it, the form creator tool comes right up. Any idea what’s causing the conflict?

    Thanks for such a great plugin!

    • Jeff Starr 2013/02/08 4:11 pm

      Hi Danielle, here’s something to try: disable JavaScript in your browser and click on whatever button/link that usually brings up the form-creation page.. with JS disabled, that inner page should load as a regular page and the URL displayed in the browser. That URL is the one we need to get to see what is being blocked by BBQ. Hopefully it’s not another unsafe character ;)

      • Here’s the URL:
        http://silver-rockets.com/wp-admin/admin-ajax.php?post_id=4261&action=grunion_form_builder&TB_iframe=true&width=768&id=add_form

      • Jeff Starr 2013/02/08 4:32 pm

        It looks like BBQ is matching the string, “union” (in “grunion”), which is unfortunate because a lot of malicious requests utilize that term for XSS attacks targeting the database. Temporarily disabling the plugin while using grunion is probably the easiest workaround until I can get this resolved in the next update.

      • Fair enough, at least that explains the breakage! I’ll just disable it, make the form, and enable it again afterwards. No big deal. Thanks for the quick response!

  12. Conciertos en Costa Rica 2013/02/13 10:04 am

    Hi Jeff, I have been suffering from hack attacks like from everywhere. Installing it now to check if it helps me in my fight against these guys. Thanks for the plugin, will let you know down the road.

Comments are closed for this post. Something to add? Let me know.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
Wizard’s SQL for WordPress: Over 300+ recipes! Check the Demo »
Thoughts
I live right next door to the absolute loudest car in town. And the owner loves to drive it.
8G Firewall now out of beta testing, ready for use on production sites.
It's all about that ad revenue baby.
Note to self: encrypting 500 GB of data on my iMac takes around 8 hours.
Getting back into things after a bit of a break. Currently 7° F outside. Chillz.
2024 is going to make 2020 look like a vacation. Prepare accordingly.
First snow of the year :)
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.