<?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>Website Design Ireland, Website Development &#187; .htaccess</title>
	<atom:link href="http://www.eire-webdesign.ie/blog/category/htaccess/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.eire-webdesign.ie/blog</link>
	<description>Web Design and Development</description>
	<lastBuildDate>Sat, 02 Jan 2010 14:53:06 +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>Monitor changes made to the .htaccess file</title>
		<link>http://www.eire-webdesign.ie/blog/2009/03/19/monitor-changes-made-to-the-htaccess-file/</link>
		<comments>http://www.eire-webdesign.ie/blog/2009/03/19/monitor-changes-made-to-the-htaccess-file/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 09:59:46 +0000</pubDate>
		<dc:creator>Louie @ Eire Web Design</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.eire-webdesign.ie/blog/?p=108</guid>
		<description><![CDATA[After what happened to &#8220;Grandad&#8221;  @ Head Rambles recently, got me thinking in finding a way to monitor any changes made to the .htaccess file. Grandad&#8217;s .htaccess file, was injected with some malicious code, checking for the USER_AGENT, in turn redirecting &#8220;Googlebot, Slurp, msnbot&#8221; to another website. This can be easily achieved as the server itself  updates [...]]]></description>
			<content:encoded><![CDATA[<p>After what happened to &#8220;Grandad&#8221;  @ <a href="http://www.headrambles.com/" target="_blank">Head Rambles</a> recently, got me thinking in finding a way to monitor any changes made to the .htaccess file.</p>
<p>Grandad&#8217;s .htaccess file, was injected with some malicious code, checking for the USER_AGENT, in turn redirecting &#8220;Googlebot, Slurp, msnbot&#8221; to another website.</p>
<p>This can be easily achieved as the server itself  updates the date &amp; time of the file/s changed by adding a timestamp to it.<br />
Keeping track is not that hard, once we have this value stored for later comparison.</p>
<p>The solution I came up with, is to create a directory where a new text file is created, which in turn will store the existing file timestamp.</p>
<p>With a bit of PHP coding, we can read the contents of the text file created and compare it with the existing timestamp of the file itself.<br />
If the current timestamp is not equal to what we have stored, an ALERT email will be sent to the website administrator, who can verify the content of the file itself, making sure no malicious changes were made as per example given above.</p>
<p>The code can be downloaded from <a title="donwload file" href="http://www.eire-webdesign.ie/_monitor_htaccess.txt" target="_blank"><strong>here &gt;&gt;</strong></a></p>
<p>and please let me know if you encounter any problems&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.eire-webdesign.ie/blog/2009/03/19/monitor-changes-made-to-the-htaccess-file/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

