Another method (similar to previous) is to make your own Plugin, its very simple we have the code for you here.

Simply open a new PHP file using a simple note or text editor and paste the following code inside:

<?php /* Plugin Name: Block Bad Queries Description: Protect WordPress Against Malicious URL Requests */ global $user_ID; if($user_ID) { if(!current_user_can('level_10')) { if (strlen($_SERVER['REQUEST_URI']) > 255 ||
strpos($_SERVER['REQUEST_URI'], "eval(") ||
strpos($_SERVER['REQUEST_URI'], "CONCAT") ||
strpos($_SERVER['REQUEST_URI'], "UNION SELECT") ||
strpos($_SERVER['REQUEST_URI'], "base64")) {
@header("HTTP/1.1 414 Request-URI Too Long");
@header("Status: 414 Request-URI Too Long");
@header("Connection: Close");
@exit;
}
}
} ?>

Save this file as miltonmarketingprotect.php and upload it in your plugin directory /wp-content/plugins/ and your done.

This script will check for long strings as well as base64 code which was in the last attack and the eval ( code which could be a threat in the future.) 🙂

Once activated, this plugin will silently and effectively close any connections for these sorts of injection-type attacks.


Related Posts:

Disable Search in WordPress

Create a PayPal Donation Shortcode – WordPress

Show Post Thumbnails in RSS Feed – WordPress

Disable the Admin Bar in WordPress

Formatting Text in WordPress Posts (Tiny MCE Advanced for WordPress)

Should I Choose a Hosted or Non-hosted Blogging Platform?

How do I start a WordPress blog? (hosting wordpress)

The background-color CSS property

How do I install plugins in WordPress?

Paginate Your WordPress Site Without Plugins

FAQ Hacked WordPress Website

WordPress Posts vs Pages

Redirect New Registered Users to a Specific Page – WordPress

How do I create money online using WordPress?

What is a robot.txt file?

Automatically Link to Twitter Usernames in Content

Using the Current Year in Your Posts – WordPress