Advertisements
Connect with us

Tips & Tricks

WordPress Security Hacks

Hi guys this is my first post on wpcult the great site Austin built.  Hope you guys find it usefull.

If you run a blog using the wordpress software then your blog is a target to hackers.  Below I will list some hacks and just how they can help you keep your business/site safe.

The following is  code to Block Bad Queries and protect your blog from malicious URL Requests.

Place the following code into a text file and name it what ever you like for example blockbadqueries.php upload it to your plugin folder and activate it in your wordpress admin just as you would any other Plugin

<?php
/*
Plugin Name: Block Bad Queries
Plugin URI:
http://perishablepress.com/press/2009/12/22/protect-wordpress-against-malicious-url-requests/
Description: Protect WordPress Against Malicious URL Requests
Author URI:
http://perishablepress.com/
Author: Perishable Press
Version: 1.0
*/
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;
    }
  }
}
?>

 This Great plugin was made by Jeff Starr of Digging into WordPress

 

 

Protecting your blog with .htaccess 

.htaccess files have lots of possibilities. below is some code that will help protect your wordpress from modification of _REQUEST and/or GLOBALS and scripts injection.

 This is real simple just paste the following code into your .htaccess file. Always make a backup of your .htaccess before editing, better to be safe.

Options +FollowSymLinks
RewriteEngine On
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule ^(.*)$ index.php [F,L]

 

Thanks to Oussama for this great hack

Advertisements

Random Search Terms

Title

Top Articles

powered by WassUp

Recent Posts: Fully Net Worth . com

Harold Lederman Net Worth: How Rich Was Boxing Legend Actually?

Harold Lederman Net Worth: How Rich Was Boxing Legend Actually?

Harold Lederman was a boxing judge and analyst. He was in boxing for around 5 decades. Harold Lederman net worth before his death is estimated to be $3 million. Lederman was born on January 26, 1940, in The Bronx, New York. He went to Columbia University and after graduation earned a license from New York’s […]

Pua Magasiva Net Worth: How Rich was Pua Magasiva Actually?

Pua Magasiva Net Worth: How Rich was Pua Magasiva Actually?

Pua Magasiva was a New Zealand actor best known for his role as Shane Clarke, the Red Ranger from Power Rangers Ninja Storm. Pua Magasiva net worth before his death is estimated to be $600,000. Magasiva was born on August 10, 1980, in Apia, Samoa but was raised in Wellington, New Zealand since he was […]

MindofRez Net Worth: 5 Interesting Facts You Should Know

MindofRez Net Worth: 5 Interesting Facts You Should Know

Bryan Carti is a Youtuber who is well known for his channel called “MindofRez” which he started on June 8, 2016. Here are some interesting facts about MindofRez: 1. MindofRez has an estimated net worth of $2 million As of 2019, MindofRez net worth is estimated to be around $2 million. MindofRez has been able […]