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

Random Search Terms

Title

Top Articles

powered by WassUp

Recent Posts: Fully Net Worth . com

Kairi Cosentino Height, Age, Wiki, Bio, Net Worth & More

Kairi Cosentino Height, Age, Wiki, Bio, Net Worth & More

Kairi Cosentino is a social media personality who is best known for uploading different TikTok videos alongside his friends. His videos have a mix of dance, comedy, lip-sync and other types of videos. Cosentino was born on February 8, 2003, in New Jersey, United States which makes him 16 years old now. He is a […]

Alvaro Romero Net Worth: How Rich is the Tik Tok Star Actually?

Alvaro Romero Net Worth: How Rich is the Tik Tok Star Actually?

Alvaro Romero is an American social media star who is best known for his fun videos that include lip-syncs and dance videos on the popular and trendy app among youths right now called TikTok. As of right now, Romero has been able to develop a following of over a million in his TikTok profile with […]

Chrissy Lampkin Net Worth: How Rich is the Television Star?

Chrissy Lampkin Net Worth: How Rich is the Television Star?

Chrissy Lampkin is an American reality television personality and the Executive Producer at WeTV. She is best known for being a part of the VH1 reality series Love & Hip Hop: New York, as well as the spin-off reality, show Chrissy & Mr. Jones that was conceived after her popularity in the earlier show. As […]