<?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 Nietz &#187; Security</title>
	<atom:link href="http://www.thenietz.com/category/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thenietz.com</link>
	<description>Sniffing out tech</description>
	<lastBuildDate>Thu, 06 Oct 2011 03:16:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Getting your site unblocked, part 1</title>
		<link>http://www.thenietz.com/2010/01/28/getting-your-site-unblocked-part-1/</link>
		<comments>http://www.thenietz.com/2010/01/28/getting-your-site-unblocked-part-1/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 03:59:49 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.thenietz.com/?p=96</guid>
		<description><![CDATA[Oh Noes! Look familiar? Hopefully not. But if your site now looks like this, it&#8217;s bad, but there is hope.  I ]]></description>
			<content:encoded><![CDATA[<p>Oh Noes!</p>
<p><a href="http://www.thenietz.com/wp-content/uploads/2010/01/AttackSite.gif"><img class="size-medium wp-image-68 alignnone" title="attacked site" src="http://www.thenietz.com/wp-content/uploads/2010/01/AttackSite-300x139.gif" alt="Uh-oh" width="300" height="139" /></a></p>
<p><a href="http://www.thenietz.com/wp-content/uploads/2010/01/AttackSite.gif"></a>Look familiar? Hopefully not. But if your site now looks like this, it&#8217;s bad, but there is hope.  I had my first foray into this world last week when my brother in law&#8217;s site was hacked.  It took some digging, but here are the steps to getting your site back again. Part one will cover getting yourself unblocked.  Part two will cover getting your posts and other data back, and part three will get you up and running and take steps to prevent it from happening again.</p>
<p>So the steps:</p>
<ul>
<li>Get rid of the offending code,</li>
<li>verify you are the owner,</li>
<li>request a review,</li>
<li>make sure it doesn&#8217;t happen again.</li>
</ul>
<p><span id="more-96"></span></p>
<h1>Getting rid of the offending code</h1>
<p>What happened?  In this case it was pretty clear.  The site was using an older version of WordPress (pre 2.8.3).  <a title="WordPress Patch" href="http://wordpress.org/development/2009/08/2-8-4-security-release/">WordPress patched it way back in August</a>, so part of me is impressed it took so long to get hacked.  This was a pretty serious security hole; before it was patched it managed to take out a lot of blogs (<a href="http://scobleizer.com/2009/09/05/i-dont-feel-safe-with-wordpress-hackers-broke-in-and-took-things/">including Scoble</a>).  Needless to say, if you aren&#8217;t running the most recent version of WordPress, or not sure stop reading. <a href="http://codex.wordpress.org/Upgrading_WordPress">Upgrade now</a>.  Looking at access logs it looks like the site was hacked not once, but twice. [<em>Note to hackers: when you hack a site, try applying a patch. it's safer.</em>]</p>
<p>First up is the database.  When the the hole was initially discovered, the recommendation was to NOT export your database, and instead follow a series of other steps.  At the time I would agree with that advice.  Unfortunately, once you hit the blocked list, the intercept message stops you from even logging into your site to do the additional steps.  Instead, we&#8217;ll back up the database and the site, then set up a clean room environment to export your data.   Check with your host provider for specifics, but in myPHPadmin select the database and hit export (and download as a zip).</p>
<p>Next up are the files.  Again, we&#8217;ll be using these for our cleanroom in part two.  Grab a blank thumbdrive, create a /hacked_site/ directory, FTP to the site and download <em>everything</em> straight to the thumbdrive.  Be sure to get the .htaccess files, since they are more than likely corrupt as well.  Once copied, stop thinking about them.  We&#8217;re not opening, clicking on, viewing or even looking at <em>ANYTHING</em> there unless we can do it safely.  That&#8217;s in part two.</p>
<p>Now, take a deep breath.</p>
<p>Delete your entire site. Seriously, all of it, especially the .htaccess files.  Don&#8217;t be concerned.  Right now no-one in the world can get to your site, and unless you do something about it, no-one ever will.  Part two will try and recover as much as possible, but even if you can&#8217;t get everything, at least you&#8217;ll be able to start over.  Until your site is unblocked, you can&#8217;t even do that.  So delete it. Delete it all.</p>
<p>Now, open up your faveorite text editor and create simple html file:</p>
<pre>&lt;html&gt;</pre>
<pre>     &lt;head&gt;</pre>
<pre>        &lt;title&gt;Down for repair&lt;/title&gt;</pre>
<pre>     &lt;/head&gt;</pre>
<pre>    &lt;body&gt; Our site was recently hacked.  We've removed all offending code and are in the process of rebuilding the site.  We appreciate you patience. &lt;/body&gt;</pre>
<pre>&lt;/html&gt;</pre>
<p>Save this as index.html and upload it to your site.  Why?  well, we need to have your site reevaluated, so you need to show you&#8217;ve actually taken steps and are ready to be checked again.  If your hosting company has a control panel, you could reinstall WordPress from there, but since the site is still blocked, there is no way to go any further than the default install.</p>
<h1>Verify you are the owner</h1>
<p>Next go to <a title="Google Webmaster Tools" href="http://www.google.com/webmasters/tools/">Google Webmaster tools</a>.  Don&#8217;t have an account?  Perfect time to sign up (besides, if you want your site back, you have to).  Once logged in, you need to add your site.  That&#8217;s pretty straightforward.  Click on add a site:</p>
<p><a href="http://www.thenietz.com/wp-content/uploads/2010/01/WebmasterTools.png"><img class="alignleft size-full wp-image-98" title="WebmasterTools" src="http://www.thenietz.com/wp-content/uploads/2010/01/WebmasterTools.png" alt="Add a site" width="139" height="37" /></a>Enter the url of the site.  For best practices, start with www.yoursite.com and you can (and should) add yoursite.com later.</p>
<p>Once added, you need to verify.  There are two ways, add a meta tag to your index file, or upload a specific file.  I find it easiest to upload the file:</p>
<p><img class="alignnone size-medium wp-image-99" title="Verify" src="http://www.thenietz.com/wp-content/uploads/2010/01/Verify-300x186.png" alt="" width="300" height="186" /></p>
<p>Upload the file, double check it&#8217;s there, then click verify.  In my experience, the process is instantaneous.</p>
<h1>Request a review</h1>
<p>Almost done.  Once verified,  your Webmaster Tools home screen should have an alert about possible malware.  Click on the link for Request a review, and you&#8217;ll be taken to a short form.  In the text area, be sure to outline the steps taken (You completely removed all offending material, and will install the latest, patched version of WordPress)</p>
<p>And then wait.  In my experience it took less than a day to get unblocked.  While you are waiting check out part two (coming soon) where I&#8217;ll walk you through the process of recovering your posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thenietz.com/2010/01/28/getting-your-site-unblocked-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On blogging, security, and my intro to Google&#8217;s webmaster tools</title>
		<link>http://www.thenietz.com/2010/01/24/on-blogging-security-and-my-intro-to-googles-webmaster-tools/</link>
		<comments>http://www.thenietz.com/2010/01/24/on-blogging-security-and-my-intro-to-googles-webmaster-tools/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 23:53:54 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[SEO]]></category>

		<guid isPermaLink="false">http://www.thenietz.com/?p=67</guid>
		<description><![CDATA[A few months ago my brother-in-law wanted his own website.  Being the resident techie, I set him up with his own domain, a WordPress blog, and picked out a nice template that looked a little non-WordPress-y.

Unfortunately, like most bloggers, it sat untouched (something I'm guilty of too).  Last week, he got an email from a friend who tried to go to his site.  Instead of his site he was greeted with rather ominous looking red screen:



Not good]]></description>
			<content:encoded><![CDATA[<p>A few months ago my brother-in-law wanted his own website.  Being the resident techie, I set him up with his own domain, a WordPress blog, and picked out a nice template that looked a little non-WordPress-y.</p>
<p>Unfortunately, like most blogs, it sat untouched (something I&#8217;m guilty of too).  Last week, he got an email from a friend who tried to go to his site.  Instead of his site he was greeted with rather ominous looking red screen:</p>
<p><a href="http://www.thenietz.com/wp-content/uploads/2010/01/AttackSite.gif"><img class="alignnone size-medium wp-image-68" title="Google's attached site" src="http://www.thenietz.com/wp-content/uploads/2010/01/AttackSite-300x139.gif" alt="Uh-oh" width="300" height="139" /></a></p>
<p>Not good.<span id="more-67"></span></p>
<p>I ftp&#8217;d to his site; there was a lot of activity.  A bunch of new files had been uploaded in November, and a handful of others in January.  Either the November hacker had been active, or (as I suspect), he&#8217;d actually been hacked twice.</p>
<p>The version of WordPress installed was older, 2.7.x; latest and greatest when installed, but never upgraded.  Since 2.7, there were major holes discovered, and it&#8217;s not a stretch to assume that&#8217;s what they used (though I don&#8217;t feel too bad, <a title="Scoble" href="http://scobleizer.com/2009/09/05/i-dont-feel-safe-with-wordpress-hackers-broke-in-and-took-things/">Scoble&#8217;s</a> blog was also hacked this way).</p>
<p>I archive the site, and will post a forensic review later, but mostly redirects to a Russian pharm site, changes to .htaccess to fake out the search engines (though he didn&#8217;t have mod_rewrite installed, so ineffective), in all pretty generic, so I suspect the site was hacked 100% via script&#8211; no user intervention whatsoever.</p>
<p>Since their weren&#8217;t any real updates on the site, I was comfortable starting over from scratch.  I didn&#8217;t want to risk any backdoor and go through all of this again.  I migrated to a different host (not that a different host would matter, the new host is just one I use regularly with my other clients, which makes it more likely I&#8217;d catch it when checking on another client).  Reinstalled the latest version of WordPress, and started to rebuild his site.</p>
<p>Once completed, I went to look at the new, improved, malware-free version of the site.  Lo and behold I was still greeted with the red screen of terror.  No worries, I figured I&#8217;ll get the site fully tweaked and then deal with that issue.</p>
<p>There&#8217;s an option to ignore the warning (which, in any case except this I would not recommend,) so I clicked through to finish up my WordPress configs.  No dice.  the google intercept disabled all the css and JavaScript (which is a good thing).  I tried it in Firefox, Chrome, Opera, and Safari (pretty sure there was ONE other browser which would have worked&#8230;) .  So at this point I couldn&#8217;t actually log into the site.</p>
<p>This is where I got my introduction to Google&#8217;s Webmaster tools.   With all my SEO work, Google SEO tools have always been sitting in the back on my to-do list;  my work with clients focuses on honing filenames, leveraging social media, xml site map etc.  By sticking to the fundamentals, my clients have been wildly successful, so the webmaster tools have been on the back burner.</p>
<p>In order to unblock a site you need to (obviously) remove what&#8217;s offending and then, as the site owner, submit your site for review.  Proving you&#8217;re the owner is pretty straightforward, and similar to Google&#8217;s verification for other products&#8211;  you either add some META to your index page or (if you&#8217;re a WordPress owner who can&#8217;t log in to adjust the META&#8230;), you upload a unique page.    Once you&#8217;ve verified the site&#8217;s yours, there&#8217;s a simple form to request a re-evaluation.  After about an hour his site was back up and running, sans Russian pharm.</p>
<p>One takeaway for me is I was forced into the Google webmaster tools, and I must say I&#8217;m impressed and it&#8217;s begun me exploring it further.  For my next post I&#8217;ll dive a bit deeper into the toolkit and show how you can increase your pagerank and improve the overall quality of your site.</p>
<p>Now this is all well and good, and I have to say I&#8217;m a fan of malware intercepts and the webmaster&#8217;s tool in general, but I believe I&#8217;ve discovered a fundamental flaw in the system&#8230; Bonus point if you can figure it out, otherwise wait for my next post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thenietz.com/2010/01/24/on-blogging-security-and-my-intro-to-googles-webmaster-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

