<?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>Skidoosh &#187; Security</title> <atom:link href="http://www.skidoosh.co.uk/category/security/feed/" rel="self" type="application/rss+xml" /><link>http://www.skidoosh.co.uk</link> <description>Skidoosh - PHP, Python, Django, Ruby on Rails Web Developer in North Wales</description> <lastBuildDate>Fri, 27 May 2011 11:33:40 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>SQL Injection in Action</title><link>http://www.skidoosh.co.uk/security/sql-injection-in-action/</link> <comments>http://www.skidoosh.co.uk/security/sql-injection-in-action/#comments</comments> <pubDate>Wed, 11 Nov 2009 23:40:48 +0000</pubDate> <dc:creator>Glyn Mooney</dc:creator> <category><![CDATA[Security]]></category> <category><![CDATA[attack]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[sql injection]]></category><guid isPermaLink="false">http://www.skidoosh.co.uk/?p=30</guid> <description><![CDATA[Have you ever heard of an SQL injection attack? Ever wondered how it's actually done? Well take a look at the video in this post to see one in action!]]></description> <content:encoded><![CDATA[<p>Have you ever heard of an SQL injection attack? Ever wondered how it&#8217;s actually done? Well here&#8217;s a great video showing you how:</p><p><a title="Blind SQL Injection Attack" href="http://www.milw0rm.com/video/watch.php?id=100">Blind SQL Injection Attack Video</a></p><p>You don&#8217;t often get to see a demonstration of how an attacker will actually use techniques such as this the infiltrate a site. My belief is that if you need to defend yourself or your application against it you need to see it in action. <a title="Application Exploit Database" href="http://www.milw0rm.com/">milw0rm</a> is a great place to see what applications are vulnerable to attack, how, why and has it been fixed.</p><h2>What could have been done to prevent this attack?</h2><p>Lots of things could have been done to prevent this from happening, but often is the case in large applications or small one&#8217;s built by an inexperienced developer holes are left in the security of an application. One thing to remember when developing an application that <strong>any </strong>user submitted data should be treated as hostile. It should be checked via Regex, cleaned, Type Casted and validated to ensure what your getting from the user is what you expected.</p><p>In the video a function as simple as mysql_real_escape_string could have prevented this but here are some other things you should know about:</p><h3>Hash your passwords</h3><p>I don&#8217;t know if you noticed in the video but the attacker acquired a plain text password. This was the application developers first mistake. If the password had been hashed, even if the attacked had got the entire hash it would have been useless. If you put another hash in it will just be converted to guess what, another hash. This would have rendered this attack fruitless. MD5 is a great Hashing function that comes pre-packed with most programming languages and would turn this &#8220;password&#8221; into this &#8220;5f4dcc3b5aa765d61d8327deb882cf99&#8243;. Even if one character changes the hash would be completely different.</p><h3>Use a Database abstraction layer</h3><p>In PHP a great example of this would be the MDB2 class. This class comes with a whole list of security features including some great sanitisation functions. Using a single gateway to your database will greatly reduce the margin for error. You could even develop your own with automatic data cleaning.</p><h3>Use an odd admin section name</h3><p>One issue with applications with an integrated CMS is the admin section is simply called &#8220;admin&#8221;. In this case if the attacker armed with a username and password couldn&#8217;t find your admin section he would have had to employ some more sophisticated tools to monitor where you where going to update your site. At this point they may get bored or more often than not, it&#8217;s an automated attack. In this case the application may try to guess where it is, fail and move on. So try to name your admin sections more carefully!</p><p>Well I hope someone finds this of use and I look forward to your responses!</p> ]]></content:encoded> <wfw:commentRss>http://www.skidoosh.co.uk/security/sql-injection-in-action/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced (User agent is rejected)
Database Caching 4/11 queries in 0.195 seconds using disk: basic
Object Caching 242/263 objects using disk: basic
Content Delivery Network via N/A

Served from: www.skidoosh.co.uk @ 2012-02-06 22:02:18 -->
