<?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>Tiago Moreira &#187; WordPress</title>
	<atom:link href="http://tiago.kamots.net/t/wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://tiago.kamots.net</link>
	<description></description>
	<lastBuildDate>Wed, 30 Jun 2010 03:10:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Installing WordPress Securely on DreamHost</title>
		<link>http://tiago.kamots.net/2010/01/26/secure-wp-on-dreamhost/</link>
		<comments>http://tiago.kamots.net/2010/01/26/secure-wp-on-dreamhost/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 04:12:21 +0000</pubDate>
		<dc:creator>Tiago Moreira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DreamHost]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tiago.kamots.net/?p=104</guid>
		<description><![CDATA[DRAFT After my WordPress website was hacked into, I began to look into all the options and advice for setting it up securely. http://codex.wordpress.org/Installing_WordPress Step 1: Getting the Latest WordPress Version I like to use the shell for this since it saves on downloading it on one of my computers and then transferring it onto [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><strong><span style="color: #c0c0c0;">DRAFT</span></strong></p>
<p>After my WordPress website was hacked into, I began to look into all the options and advice for setting it up securely.<br />
<a href="http://codex.wordpress.org/Installing_WordPress">http://codex.wordpress.org/Installing_WordPress</a></p>
<h2>Step 1: Getting the Latest WordPress Version</h2>
<p>I like to use the shell for this since it saves on downloading it on one of my computers and then transferring it onto a remote server. Login to your file hosting server with the shell account you assigned to your domain. Navigate to a directory where you want to work from, keeping in mind that it doesn’t have to be the directory that is set to be public on the Internet (i.e. where the files placed here can be reached via a browser). At the prompt, run: wget <a href="http://wordpress.org/latest.tar.gz">http://wordpress.org/latest.tar.gz</a></p>
<p>The above link will always download the latest release. Now you need to decompress this archive, run: tar -xzvf latest.tar.gz</p>
<p>In your current directory, you should now have a directory called wordpress that you can rename to anything. You will be pointing your URL address to this folder as your root.</p>
<p>Delete readme.html from the wordpress root directory as this will tip off the exact version you have installed to possible attackers.</p>
<h2>Step 2: Changing the wp-config.php File</h2>
<p>Fill in the information related to the database you’ll be using in the following defines: DB_NAME, DB_USER, DB_PASSWORD, DB_HOST</p>
<p>You should always change the default database table prefix from wp_ to something a bit harder to guess. In most installations, people will have one database devoted strictly to WordPress, so you don’t even have to prefix the tables with wp_; just create a random alphanumeric string (about 4-6 characters long) and use that as your prefix.</p>
<pre>$table_prefix  = 'wp_';
$table_prefix  = 'rRe342_';</pre>
<p>Pay attention to the Authentication Unique Keys section and be sure to get a new generated set from the WP secret-key service <a href="https://api.wordpress.org/secret-key/1.1/">https://api.wordpress.org/secret-key/1.1/</a> as it says in the comments area.</p>
<p>A good discussion of other wp-config.php options is found here: <a href="http://codex.wordpress.org/Editing_wp-config.php">http://codex.wordpress.org/Editing_wp-config.php</a></p>
<h2>Step 3: Creating Directory-Level Password Checks</h2>
<p>htpasswd -cm /home/&lt;username&gt;/&lt;website&gt;/.htpasswd &lt;new username you want to create a password for&gt;</p>
<p>use the -m for MD5</p>
<h2>Step 4: Changing the DreamHost Server Settings to Point to Your New WordPress Installation</h2>
<p>To run the WordPress install script, you will need to change the settings of the server to point to your WP root directory (the one created during the decompressing of the archive in Step 1). For DreamHost Web Panel users, head to Manage Domains found either through the Toolbox shortcut or under the Main Menu Domains heading. Find the domain (or sub-domain) name you want WordPress to be shown from and click on its Edit button. Now fill out the Web Directory textbox to map onto the WP root directory.</p>
<p>It may be handy to have phpMyAdmin open and ready for the database you’ll be using as you’re going to want to modify a few things.</p>
]]></content:encoded>
			<wfw:commentRss>http://tiago.kamots.net/2010/01/26/secure-wp-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My WordPress Installation Hacked on Netfirms</title>
		<link>http://tiago.kamots.net/2010/01/24/my-netfirms-wp-hacked/</link>
		<comments>http://tiago.kamots.net/2010/01/24/my-netfirms-wp-hacked/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 03:06:17 +0000</pubDate>
		<dc:creator>Tiago Moreira</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://tiago.kamots.net/?p=102</guid>
		<description><![CDATA[DRAFT I was looking over some settings on my website earlier and I just happened to check on my Google Webmaster Tools account where I discovered that something was not quite right. Google’s site crawler was reporting that there were 24(?) unlinked pages on one of my WordPress pages. I clicked through to find that [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><strong><span style="color: #c0c0c0;">DRAFT</span></strong></p>
<p>I was looking over some settings on my website earlier and I just happened to check on my Google Webmaster Tools account where I discovered that something was not quite right. Google’s site crawler was reporting that there were 24(?) unlinked pages on one of my WordPress pages. I clicked through to find that there was an entirely new directory (/pdd) on my website that linked to a radio podcasting site from the Netherlands. But that directory didn’t exist! Here’s the worrisome part: whoever managed to hack into my account was able to change my root .htaccess file. So they created a new rewrite rule to route the tiago.kamots.net/pdd requests through another vector.</p>
<pre>The Altered .htaccess File:
RewriteEngine On
RewriteRule pdd/(.*)/(.*)/(.*)/$ /wp-admin/includes/?post=$3|$1|$2 [L]
RewriteRule pdd/$ /wp-admin/includes/ [L]
RewriteBase /</pre>
<p>Whatever changed the .htaccess file was smart enough to create the new rewrite rules near the top of the file for full effect. Had it simply been appended, it would not have worked.</p>
<p>I transferred a part of the Kamots Network from Netfirms to DreamHost on January 15, 2010, and I originally thought that it was during this small window that the attack was made. But I was wrong. I checked back on the Netfirms servers and there were several files with a last modified timestamp of interest (November 15, 2009). They are (using relative pathnames):</p>
<pre>WordPress root directory represented as ~
~/.htaccess [Last Modified: 2009-October-23]
~/wp-includes/class-read.php [8 KB]
~/wp-includes/common.php [0 bytes]
~/wp-includes/wp-common.php [69 KB]
~/wp-includes/wp-vars.php [0 bytes]
~/wp-includes/wp-version.php [105 bytes]</pre>
<p>When transferring these files to my desktop computer, my Norton Antivirus detected a High severity PHP.Backdoor.Trojan in wp-common.php. It turns out that this file was written by a “security group” in China, which is also where 90% of my spam messages on WordPress originate from. You can download this toolkit off of this group’s website so there is a strong chance it was used as part of an automated/scripted attack by another entity entirely.</p>
<p>Running a Hidden Website Within a WordPress Installation</p>
<p>What interests me is how this attack was able to implant 46 hidden pages within my WordPress installation. For example, this URL:</p>
<p>http://tiago.kamots.net/pdd/41/hoor/hoorspelcast-raquo-gezocht/</p>
<p>actually gets redirected through the .htaccess rule into:<br />
tiago.kamots.net/wp-admin/includes/?post= hoorspelcast-raquo-gezocht |41|hoor</p>
<p>But none of those 46 pages are anywhere in my database or file structure! What an ingenious exploit, and it’s been known since at least 2008 which is the date that this wp-common.php Trojan file was written.</p>
<p>This was quite a learning experience.</p>
<p>Netfirms<br />
You may need to look into your file system security. And shouldn’t you have an antivirus scan of some sort running on your servers? Also, your FTP users are limited with passwords of only 6 characters. That’s way too small! Since you randomly generate them for your customers, you may as well go all the way and have longer (and more complicated) passwords created.<br />
Good References<br />
<a href="http://ocaoimh.ie/did-your-wordpress-site-get-hacked/">http://ocaoimh.ie/did-your-wordpress-site-get-hacked/</a><br />
<a href="http://enthusiasm.cozy.org/archives/2010/01/argh-blog-hacked">http://enthusiasm.cozy.org/archives/2010/01/argh-blog-hacked</a><br />
<a href="http://www.askapache.com/htaccess/htaccess.html">http://www.askapache.com/htaccess/htaccess.html</a></p>
]]></content:encoded>
			<wfw:commentRss>http://tiago.kamots.net/2010/01/24/my-netfirms-wp-hacked/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
