<?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>Darren Tarrant</title>
	<atom:link href="http://www.darrentarrant.co.uk/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.darrentarrant.co.uk/blog</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Sat, 24 Oct 2009 23:09:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Internet Explorer 32 styles bug</title>
		<link>http://www.darrentarrant.co.uk/blog/?p=12</link>
		<comments>http://www.darrentarrant.co.uk/blog/?p=12#comments</comments>
		<pubDate>Sat, 24 Oct 2009 23:07:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Browser Bugs]]></category>
		<category><![CDATA[31 styles ie]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[ie bug]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://www.darrentarrant.co.uk/blog/?p=12</guid>
		<description><![CDATA[I have found a curious bug in all versions of Internet Explorer. It is new to me and i found no reference to it on the internet, so here goes. If you have access to a php server, insert the following code into a php file: &#60;?php for($i=1;$i&#60;=100;$i++){ ?&#62; &#60;style type = &#8220;text/css&#8221;&#62; .style&#60;? echo [...]]]></description>
			<content:encoded><![CDATA[<p>I have found a curious bug in all versions of Internet Explorer. It is new to me and i found no reference to it on the internet, so here goes.</p>
<p>If you have access to a php server, insert the following code into a php file:</p>
<p>&lt;?php</p>
<p>for($i=1;$i&lt;=100;$i++){<br />
?&gt;<br />
&lt;style type = &#8220;text/css&#8221;&gt;<br />
.style&lt;? echo $i; ?&gt;{<br />
border: purple 1px solid;<br />
height: 100px;<br />
width: 100px;<br />
}<br />
&lt;/style&gt;<br />
&lt;div class = &#8220;style&lt;? echo $i; ?&gt;&#8221;&gt;&lt;? echo $i; ?&gt;&lt;/div&gt;<br />
&lt;?<br />
}</p>
<p>?&gt;</p>
<p>This will output 100 boxes,  each with a separate class reference. There is also 100 class definitions. Viewing this in IE 6,7 and 8 you will see only the first 31 boxes have style!</p>
<p>The workaround for bugs similar to this is to use inline styles instead of class references and this seems to work around it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.darrentarrant.co.uk/blog/?feed=rss2&amp;p=12</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Javascript form injection</title>
		<link>http://www.darrentarrant.co.uk/blog/?p=10</link>
		<comments>http://www.darrentarrant.co.uk/blog/?p=10#comments</comments>
		<pubDate>Sat, 25 Oct 2008 20:53:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP security]]></category>
		<category><![CDATA[blacklist]]></category>
		<category><![CDATA[form injection]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[web forms]]></category>
		<category><![CDATA[whitelist]]></category>

		<guid isPermaLink="false">http://www.darrentarrant.co.uk/blog/?p=10</guid>
		<description><![CDATA[Imagine a very insecure form, which emailed a password or other sensitive information to a given email address. Imagine again, if you will, that this email address was hard coded into a hidden form field called, say, &#8216;to&#8217;. This is incredibly insecure and here&#8217;s why; With javascript turned on in your browser one can inject [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine a very insecure form, which emailed a password or other sensitive information to a given email address. Imagine again, if you will, that this email address was hard coded into a hidden form field called, say, &#8216;to&#8217;. This is incredibly insecure and here&#8217;s why;</p>
<p>With javascript turned on in your browser one can inject their own email address in the place of this one to get the form. All one needs to do is to look at the source code to see how many forms there are on the page. Count from zero upwards to the form you need and reference it like this:</p>
<p>Navigate to a page with said for  in it. Let&#8217;s say it is the first form in the source code, therefore we reference it with a &#8217;0&#8242; (second one will be a &#8217;1&#8242; and so on). The form, we know from the source code, has a field called &#8216;to&#8217;, so we want to set it to a new value. Now type this into the browser address bar:</p>
<p>javascript:void(document.forms[0].to.value=&#8221;me@example.com&#8221;)</p>
<p>To check the value has changed type this:</p>
<p>javascript:alert(document.forms[0].to.value)</p>
<p>Now when you submit the form, it will be submitted with the &#8216;to&#8217; value of me@example.com. Simple. It is easy to imagine all sorts of variations on this theme, so awareness is an important tool in protecting against it.</p>
<p>To protect your forms against this, you must have some sort of server side checking in the target url to check for correct email addresses. There is two ways to do this; white listing and blacklisting. Whitelisting is a list, perhaps an array or database resource, of all allowed email addresses that can be accepted into the form processing script. All other values are logically rejected by the script. This is a more secure option. A blacklist, less useful but worth mentioning, is where you allow all values, except specified ones. Blacklisting is only really useful if you know that there are only specific examples of values you wish to disalllow (for example removing rude words from a message).</p>
<p>I hope this article has been insightful and helpful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.darrentarrant.co.uk/blog/?feed=rss2&amp;p=10</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mod rewrite for 301 redirects</title>
		<link>http://www.darrentarrant.co.uk/blog/?p=8</link>
		<comments>http://www.darrentarrant.co.uk/blog/?p=8#comments</comments>
		<pubDate>Sat, 25 Oct 2008 20:23:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Search Engine Optimisation]]></category>
		<category><![CDATA[301 redirect]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[mod rewrite]]></category>

		<guid isPermaLink="false">http://www.darrentarrant.co.uk/blog/?p=8</guid>
		<description><![CDATA[301 redirects are essential if you port a site that ranks well to a new page address or domain. It is common on a LAMP platform to use the htaccess file and mod rewrite to acheive this. Here are some useful examples of mod rewrite rules to help you along the way. With RewriteEngine On [...]]]></description>
			<content:encoded><![CDATA[<p>301 redirects are essential if you port a site that ranks well to a new page address or domain. It is common on a LAMP platform to use the htaccess file and mod rewrite to acheive this. Here are some useful examples of mod rewrite rules to help you along the way.</p>
<p>With RewriteEngine On<br />
and in RewriteRule<br />
^home\.php$ # Just file itself<br />
^home\.php(.*)$ # File plus zero or more chars<br />
^home\.php(.{0,})$ # File plus zero or more chars<br />
^home\.php(.{0,28})$ # File plus zero to 28 (or whatever) chars<br />
^home\.php(.+)$ # File plus one or more chars<br />
^home\.php(.{1,})$ # File plus one or more chars<br />
^home\.php(.{1,28})$ # File plus one to 28 (or whatever) chars<br />
^home\.php\?var=val$ # File with specific query string<br />
^home\.php([\?]([a-zA-Z0-9]+)=([a-zA-Z0-9]+))$ # File with regex for  basic query<br />
^home\.php#overHere$ # File with Hash part</p>
<p>So for example use the following script with the above expressions:</p>
<p>ReWrite Engine On</p>
<p>Rewrite Rule ^home\.php([\?]([a-zA-Z0-9]+)=([a-zA-Z0-9]+))$ http://www.new-domain.com/$i</p>
<p>This will rewrite any url on the old domain of the form http://www.old-domain.com/home.php?something=value to the new url: http://www.new-domain.com/home.php?something=value</p>
<p>With variations on the expressions above you can acheive most of what you are after to pass on that vital link juice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.darrentarrant.co.uk/blog/?feed=rss2&amp;p=8</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Hacking upload scripts</title>
		<link>http://www.darrentarrant.co.uk/blog/?p=3</link>
		<comments>http://www.darrentarrant.co.uk/blog/?p=3#comments</comments>
		<pubDate>Thu, 18 Sep 2008 19:37:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP security]]></category>
		<category><![CDATA[1x1 jpeg hack]]></category>
		<category><![CDATA[file upload hack]]></category>
		<category><![CDATA[form upload]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.darrentarrant.co.uk/blog/?p=3</guid>
		<description><![CDATA[The 1&#215;1 JPEG hack, goes something like this&#8230;.. Many file upload forms use server side processing that checks for MIME type and filename/extension to see if a file is bonafide. These attributes of a file are always sent by the referrer, so they can be faked. You can set up a 1&#215;1 jpeg with fake [...]]]></description>
			<content:encoded><![CDATA[<p>The 1&#215;1 JPEG hack, goes something like this&#8230;..</p>
<p>Many file upload forms use server side processing that checks for MIME type and filename/extension to see if a file is bonafide. These attributes of a file are always sent by the referrer, so they can be faked. You can set up a 1&#215;1 jpeg with fake mime information and a fake extension, such as hack.jpg.php. This will both pass the MIME and file extension check of the file upload script. If a vulnerable script allows .php or any other executable file then all sorts of mayhem can occur.</p>
<p>To protect against this use a regular expression of the form:</p>
<p>$source = $_FILES['file1']['tmp_name'];<br />
$source_name = $_FILES['file1']['name'];<br />
$source_type = $_FILES['file1']['type'];</p>
<p>if(($source &lt;&gt; &#8220;none&#8221;) &amp;&amp; ($source &lt;&gt; &#8220;&#8221;) &amp;&amp; ((eregi(&#8220;.png$&#8221;,$source_name) &amp;&amp; eregi(&#8220;^image/png$|^image/x-png$&#8221;,$source_type))) { //allow the file}else{ //this is an invalid file}</p>
<p>This example protects against both MIME type and file extension fakes and uses PHP as it&#8217;s scripting language</p>
]]></content:encoded>
			<wfw:commentRss>http://www.darrentarrant.co.uk/blog/?feed=rss2&amp;p=3</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
