<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Design Gene Blog &#187; Tips &amp; Tricks</title>
	<atom:link href="http://thedesigngene.com/blog/design-blog-category/web-design-tips-tricks/feed/" rel="self" type="application/rss+xml" />
	<link>http://thedesigngene.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 12 Aug 2009 02:59:25 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Tips to secure WordPress</title>
		<link>http://thedesigngene.com/blog/design-blog-2009/04/tips-securing-wordpress3/</link>
		<comments>http://thedesigngene.com/blog/design-blog-2009/04/tips-securing-wordpress3/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 19:09:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Tips & Tricks]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[secure wordpress]]></category>
		<category><![CDATA[security plugins]]></category>

		<guid isPermaLink="false">http://thedesigngene.com/blog/?p=23</guid>
		<description><![CDATA[<p>I’ve just been through the ringer curing a client’s hacked wordpress blog.   There are dozens of ways people can maliciously attack your blog, including DB   injections, adding scripts to writable files, writing to your .htaccess files,   and more. Below are a few things you can do to prevent people or autobots from   commandeering your wordpress blog:</p>


No related posts.]]></description>
			<content:encoded><![CDATA[<p>I’ve just been through the ringer curing a client’s hacked wordpress blog (via my company, <a href="http://www.corvusart.com" target="_blank">Corvus Design Studio</a>).   There are dozens of ways people can maliciously attack your blog, including DB   injections, adding scripts to writable files, writing to your .htaccess files,   and more. Below are a few things you can do to prevent people or autobots from   commandeering your wordpress blog:</p>
<h2>Use a Strong Password</h2>
<p>You should use a strong, randomized password with uppercase, lowercase,   numbers and special characters. It may be inconvenient to memorize, but it’s an   important aspect to securing your blog. If you must have the password on file   somewhere, it should be a hardcopy (ie on paper), and not stored on your   computer somewhere. You should never use any part of your domain name in your   password, or the word “blog”, or common names like your pets, kids, or   birthdate. All of these things are quite easy to figure out.</p>
<h2>Set Security Keys in config.php </h2>
<p>In wp-config.php (or config-sample.php if this is a new install), find the   following lines:</p>
<p class="style3">define(’AUTH_KEY’, ‘put your unique phrase   here’);<br />
    define(’SECURE_AUTH_KEY’, ‘put your unique phrase   here’);<br />
    define(’LOGGED_IN_KEY’, ‘put your unique phrase   here’);<br />
    define(’NONCE_KEY’, ‘put your unique phrase here’);</p>
<p>These should all be replaced with secure information, preferably long strings   of random uppercase, lowercase, numbers, and special characters. You can go to <a href="https://api.wordpress.org/secret-key/1.1/" target="_blank">https://api.wordpress.org/secret-key/1.1/</a> to generate random   strings.</p>
<p>You can also add SECRET_KEY. Right under the code snippet above, add the   following:</p>
<p class="style3">define(’SECRET_KEY’,   ‘0000000000000000000000000′);</p>
<p>Replace the zeros with a long set of uppercase, lowercase, numbers, and   special characters. You can go to <a href="http://api.wordpress.org/secret-key/1.0/" target="_blank">http://api.wordpress.org/secret-key/1.0/</a> to have random   strings generated.</p>
<p>For more information about what Security Keys do, see <a href="http://codex.wordpress.org/Editing_wp-config.php" target="_blank">http://codex.wordpress.org/Editing_wp-config.php</a></p>
<h2>Change mySQL table prefixes </h2>
<p>By default, wordpress uses the table prefix wp_. Since it&#8217;s the default, it&#8217;s pretty easy for malicious persons to figure out. When setting up wp-config.php, you can change the table prefix to pretty much anything you want (letters, number, underscores only). In wp-config.php, around line 57 you&#8217;ll find the code:</p>
<p class="style3">$table_prefix  = &#8216;wp_&#8217;;</p>
<p>Simply change wp to something more complex. Be sure to keep the underscore at the end.</p>
<h2>Plugins</h2>
<p><strong><a href="http://wordpress.org/extend/plugins/askapache-password-protect/" target="_blank">askApache Password Protect</a> </strong>- This plugin doesn’t   control WordPress or mess with your database, instead it utilizes fast,   tried-and-true built-in Security features to add multiple layers of security to   your blog. This plugin is specifically designed and regularly updated   specifically to stop automated and unskilled attackers attempts to exploit   vulnerabilities on your blog resulting in a hacked site. This is the probably   the most effective security plugin available, however, I’ve found that it does   not work properly on a lot of servers. Hostmonster and GoDaddy, for instance, do   not support Basic or Digets Authentication and therefore do not support this   plugin. If your server allows all of the functionality required, this is your   best bet to protect your blog.</p>
<p><strong><a href="http://wordpress.org/extend/plugins/bluetrait-event-viewer/" target="_blank">BTEV</a> </strong>- Bluetrait Event Viewer (BTEV) monitors events   that occur in your wordpress install. BTEV tracks the following events,   password_reset, delete_user, wp_login, lostpassword_post, profile_update,   add_attachement, wp_logout, user_register, switch_theme.</p>
<p><strong><a href="http://wordpress.org/extend/plugins/login-lockdown/" target="_blank">Login Lockdown</a> </strong>- Login LockDown records the IP   address and timestamp of every failed login attempt. If more than a certain   number of attempts are detected within a short period of time from the same IP   range, then the login function is disabled for all requests from that range.   This helps to prevent brute force password discovery. Currently the plugin   defaults to a 1 hour lock out of an IP block after 3 failed login attempts   within 5 minutes. This can be modified via the Options panel. Admisitrators can   release locked out IP ranges manually from the panel.</p>
<p><strong><a href="http://wordpress.org/extend/plugins/replace-wp-version/" target="_blank">Replace WP-Version</a> </strong>- Security your   WordPress-Installation and eliminate or replace your wp-version and   database-version on easy way with a small plugin. If you’re running an older   version of WordPress, anyone can view source to see what attacks might work   against your blog. This plugin replaces the WP-version with a random string &lt;   WP 2.4 and eliminate WP-version &gt; WP 2.4.</p>
<p><strong><a href="http://wordpress.org/extend/plugins/wp-security-scan/" target="_blank">WP Security Scan</a> </strong>- Scans your WordPress installation   for security vulnerabilities and suggests corrective actions. It will also tell you which directories and files require a chmod for security purposes.</p>
<p><strong><a href="http://wordpress.org/extend/plugins/stealth-login" target="_blank">Stealth Login</a> (or any similar plugin) &#8211; </strong>Allows you to define a different path to your login pages so that they are hidden from viewers. I discovered the importance of this function the hardway when someone successfully and continually was able to change the admin email address by running sql commands through the login form. They would run some command that changed the email address in mySQL, and once that was done they reset the password, which was then emailed to their address.<br />
    The good thing was that the BTEV event viewer plugin logged their ip address, and their failed login attempts. It basically provided me with a timeline of the hackers events, so I could pinpoint exactly when and from what page they were able to change the email address. Since they were apparently running sql commands through the login form, I installed stealth login (and banned their ip range). If they manage to gain access to the site again somehow, they won&#8217;t be able to find the login form to run the commands again. </p>
<p>*Note* I&#8217;m not sure if the comment forms are vulnerable as well, but I don&#8217;t think so because of where they write to the sql database. Again, I&#8217;m not 100% sure of that. </p>
<p>*Note* You should note also that Stealth Login (and probably other similar plugins) write commands to your .htaccess file, so you need to also make sure that chmod of the .htaccess file is set to 644. Otherwise, a more clever hacker could write to your .htaccess file and undo the redirects that Stealth Login creates. </p>
<h2>.htaccess &#8211; restrict access to admin files</h2>
<p>It’s a good idea to protect certain directories with .htaccess, particularly   wp-admin folder. If you have a .htaccess file in your wp-admin folder already,   download it first and append it with the information below. If you do not have a   .htaccess file in wp-admin, create a new one in notepad and add the   following:</p>
<p class="style3"># allows access to images, CSS, javascript to   everyone<br />
    &lt;Files ~ “.(css|jpe?g|png|gif|js)$”&gt;<br />
    Allow from   all<br />
    &lt;/Files&gt;</p>
<p class="style3"># restrict access to your ip address   only<br />
    Order deny,allow<br />
    Allow from 00.000.00.000 #replace this with your   static ip address<br />
    Deny from all</p>
<p>This will restrict access to the admin folder to only the ip addresses   specified. If you have  multiple admins, add each of their ip addresses to a new   line. Save the file, and upload it to your wp-admin folder. Be sure to chmod   your .htaccess files to 644 so they are not writeable by the public.</p>
<h2>.htaccess &#8211; ban ip address or ip range</h2>
<p>There are many ways to find the ip address of those who try or succeed in breaking into your wordpress blog. You can view the server logs, but I like to use the <a href="http://wordpress.org/extend/plugins/bluetrait-event-viewer/" target="_blank">BTEV Event Viewer</a> plugin. It lists all activity by ip address in a user-friendly manner. You can sort the events by &quot;warnings&quot;, &quot;errors&quot;, &quot;notices&quot; &quot;debug&quot;, or &quot;display all&quot;. This makes it really easy to monitor exactly who is doing what on your blog, and when. Regardless of how you determine if a ip address should be blocked, it is an easy task with .htaccess. The following code will block a single address. If you have a .htaccess file in your root directory already,   download it first and append it with the information below.</p>
<p class="style3">order allow,deny<br />
    deny from 00.00.00.00 #replace with ip address. repeat this line if blocking more than one<br />
  allow from all </p>
<p>If you find that you&#8217;re always blocking ip addresses from the same range (they will have similar beginning digits), you can block and entire range using the CIDR number or the ip range if you know it. Use the code below to block by CIDR number or ip range.</p>
<p class="style3">&lt;Files *&gt;<br />
    order allow,deny<br />
    allow from all<br />
    deny from 00.0.0.0/0 # CIDR number or ip range<br />
  &lt;/Files&gt;</p>
<h2>Disable Annonymous FTP</h2>
<p>Unless you need this function for some reason, you should have annonymous FTP   disabled for your website. This is usually done in your hosting account admin   panel. The procedure and allowances differ greatly across the many hosting   platforms, and if you need assistance doing so you can always contact the   support team of your hosting company. Some hosting companies do not allow you to   delete the anonymous user, but you can restrict or deny its priveledges. Other   companies may not have an annonymous user setup as a default… it all depends on   the hosting company.</p>
<p>A really bad scenario would be having annonymous FTP enabled, coupled with a   writeable .htaccess…. you could very easily have your entire website   deleted.</p>
<p><strong>That’s it for now…. I will be updating this post when additional   information is available. Happy blogging!</strong></p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://thedesigngene.com/blog/design-blog-2009/04/tips-securing-wordpress3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

