BBQ (Block Bad Queries) is a simple script that protects your website against malicious URL requests. BBQ checks all incoming traffic and quietly blocks bad requests containing nasty stuff like
base64_. The plugin is ultra minimal, so there are no options to configure which strings are blocked or allowed — it’s basically a “set-it-and-forget-it” type plugin. To give the plugin more flexibility, here are two plugins that enable you to whitelist or blacklist your own custom strings.
If you’re running BBQ and discover that it’s blocking some page, you can “whitelist” the offending string to restore access. Let’s look at an example.
Let’s say that BBQ is blocking a page located at the following URL:
This URL is blocked by BBQ because of the colon
:, which is a reserved character.
To resolve the issue, we can install the BBQ Whitelist plugin and remove the matching pattern from
$request_uri_array. To do so, open the BBQ Whitelist plugin and edit the “whitelist items” like so:
$bbq_whitelist_request_uri_items = array('\/http\:', '\:\/\/');
Here we have added two items to the whitelist array,
\:\/\/. Save, upload, and done. BBQ now will ignore the specified patterns and thus restore access to the page.
On the other side of the coin, let’s say that you have some string that you would like BBQ to block. For example, the infamous
fckeditor seems to be a perpetual target for malicious scanning and wannabe exploits. So let’s block once and for all by adding it to BBQ.
To do so, first install the BBQ Blacklist plugin and edit the “blacklist items” like so:
$bbq_blacklist_request_uri_items = array('fckeditor'); $bbq_blacklist_query_string_items = array('fckeditor'); $bbq_blacklist_user_agent_items = array('fckeditor');
Here we have added the offending string to each of the three blacklist arrays, so we’re covered if the string appears in the URL, query string, and/or user agent. Then save, upload, and done. BBQ now will block the pesky
fckeditor string wherever it’s found.
Note that BBQ Whitelist/Blacklist requires BBQ version 20150314 or better.
Here you may download either whitelist or blacklist plugin:
Here is a simple settings page for the BBQ Blacklist & Whitelist plugins, for those who would like a GUI. Thanks to LyntServices for sharing :)