<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title></title>
	<atom:link href="http://arufi.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://arufi.wordpress.com</link>
	<description></description>
	<lastBuildDate>Tue, 11 Nov 2008 05:17:42 +0000</lastBuildDate>
	<language>id</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='arufi.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title></title>
		<link>http://arufi.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://arufi.wordpress.com/osd.xml" title="" />
	<atom:link rel='hub' href='http://arufi.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Animation VS Animator I</title>
		<link>http://arufi.wordpress.com/2008/08/27/animator-vs-animation-2/</link>
		<comments>http://arufi.wordpress.com/2008/08/27/animator-vs-animation-2/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 08:02:40 +0000</pubDate>
		<dc:creator>arufi</dc:creator>
				<category><![CDATA[My Video]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://arufi.wordpress.com/?p=23</guid>
		<description><![CDATA[Ceritanya seorang animator membuat sebuah animasi dengan menggunakan Macromedia Flash dan memberi nama Victim, akan tetapi Victim lepas kendali dan akhirnya&#8230;.. ( saksikan sendiri ) Victim Ngamuk-ngamuk obrak-abrik Macromedia Flash &#38; Windows<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=23&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ceritanya seorang animator membuat sebuah animasi dengan menggunakan Macromedia Flash dan memberi nama <strong>Victim</strong>, akan tetapi Victim lepas kendali dan akhirnya&#8230;.. ( saksikan sendiri )</p>
<p><strong>Victim Ngamuk-ngamuk obrak-abrik Macromedia Flash &amp; Windows</strong></p>
<span style="text-align:center; display: block;"><a href="http://arufi.wordpress.com/2008/08/27/animator-vs-animation-2/"><img src="http://img.youtube.com/vi/MUaSxZf35O8/2.jpg" alt="" /></a></span>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arufi.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arufi.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arufi.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arufi.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arufi.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arufi.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/arufi.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/arufi.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/arufi.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/arufi.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arufi.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arufi.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arufi.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arufi.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arufi.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arufi.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=23&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://arufi.wordpress.com/2008/08/27/animator-vs-animation-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/274178fe6c00aa0eb28f7e183e05021b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arufi</media:title>
		</media:content>
	</item>
		<item>
		<title>Animator VS Animation II</title>
		<link>http://arufi.wordpress.com/2008/08/27/animator-vs-animation/</link>
		<comments>http://arufi.wordpress.com/2008/08/27/animator-vs-animation/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 08:00:59 +0000</pubDate>
		<dc:creator>arufi</dc:creator>
				<category><![CDATA[My Video]]></category>

		<guid isPermaLink="false">http://arufi.wordpress.com/?p=20</guid>
		<description><![CDATA[Setelah tragedi Victim ngamuk-ngamuk obrak-abrik windows muncul lagi sekarang The Chosen One -saudara Victim- yang gak jauh beda dengan Victim tapi ini lebih parah lagi ( saksikanlah&#8230;. ) The Chosen One Beraksi&#8230;..<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=20&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Setelah tragedi Victim ngamuk-ngamuk obrak-abrik windows muncul lagi sekarang The Chosen One -saudara Victim- yang gak jauh beda dengan Victim tapi ini lebih parah lagi ( saksikanlah&#8230;. )</p>
<p><strong>The Chosen One Beraksi</strong>&#8230;..</p>
<span style="text-align:center; display: block;"><a href="http://arufi.wordpress.com/2008/08/27/animator-vs-animation/"><img src="http://img.youtube.com/vi/0_fPV13lKm4/2.jpg" alt="" /></a></span>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arufi.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arufi.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arufi.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arufi.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arufi.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arufi.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/arufi.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/arufi.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/arufi.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/arufi.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arufi.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arufi.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arufi.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arufi.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arufi.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arufi.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=20&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://arufi.wordpress.com/2008/08/27/animator-vs-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/274178fe6c00aa0eb28f7e183e05021b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arufi</media:title>
		</media:content>
	</item>
		<item>
		<title>Download YouTube Videos</title>
		<link>http://arufi.wordpress.com/2008/08/27/download-youtube-videos/</link>
		<comments>http://arufi.wordpress.com/2008/08/27/download-youtube-videos/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 07:57:40 +0000</pubDate>
		<dc:creator>arufi</dc:creator>
				<category><![CDATA[english language]]></category>

		<guid isPermaLink="false">http://arufi.wordpress.com/?p=18</guid>
		<description><![CDATA[Google has a solid amount of cash in its pockets, but with all the recent lawsuits against YouTube YouTube one has to wonder if it’s time to salvage whatever videos you like from the service and save them somewhere where evil attorneys won’t look – your hard drive Iomega eGo Portable Hard Drive . Luckily, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=18&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Google has a solid amount of cash in its pockets, but with all the recent lawsuits against <a id="snap_com_shot_engage_span_0" href="http://shots.snap.com/explore/6636/?key=6ff70e3830c3622fea69b92d992ef6a1&amp;svc=Snap_Shot_Wikipedia&amp;tag=YouTube&amp;src=pub-2174634-www.mashable.com&amp;cp=&amp;asp=YouTube&amp;dfs=210&amp;tol=engage">YouTube</a><span class="Snap_Shot_Wikipedia" style="display:none;"> YouTube </span><img class="snap_preview_icon" style="border:0 none;max-height:2000px;max-width:2000px;min-width:0;min-height:0;font-style:normal;font-weight:normal;" src="http://i.ixnp.com/images/v3.44/t.gif" alt="" /> one has to wonder if it’s time to salvage whatever videos you like from the service and save them somewhere where evil attorneys won’t look – your <a id="snap_com_shot_engage_span_1" href="http://shots.snap.com/explore/18283/?key=6ff70e3830c3622fea69b92d992ef6a1&amp;svc=Snap_Shot_Custom%257CTechnology%257CCNET_Videos_%28CustomJS%29&amp;tag=Iomega%20eGo%20Portable%20Hard%20Drive&amp;src=pub-2174634-www.mashable.com&amp;cp=&amp;asp=hard%20drive&amp;dfs=10&amp;tol=engage">hard drive</a><span class="Snap_Shot_Custom|Technology|CNET_Videos_(CustomJS)" style="display:none;"> Iomega eGo Portable Hard Drive </span><img class="snap_preview_icon" style="border:0 none;max-height:2000px;max-width:2000px;min-width:0;min-height:0;font-style:normal;font-weight:normal;" src="http://i.ixnp.com/images/v3.44/t.gif" alt="" />.</p>
<p>Luckily, there are literally dozens of tools for downloading videos from YouTube and/or converting those YouTube videos to some format other than .flv. It’s hard to pick the best one, as they all have pluses and minuses. Thus, we’ve chosen 23 YouTube downloader tools we’ve found to be actually working. Here they are, categorized according to the platform they work on:</p>
<h2><strong>Web based</strong></h2>
<p>1. <strong>videodownloadx.com</strong> doesn’t have a lot of options, but it’s simple, and it works. It also enables you to share the YouTube video with your friends via e-mail. Unfortunately, all the files are called get_video, and you have to add the .flv extension manually.</p>
<p><a href="http://www.videodownloadx.com/">videodownloadx.com<img class="snap_preview_icon" style="border:0 none;max-height:2000px;max-width:2000px;min-width:0;min-height:0;font-style:normal;font-weight:normal;" src="http://i.ixnp.com/images/v3.44/t.gif" alt="" /></a></p>
<p>2. <strong>KeepVid</strong> is another simple site. No hassle, works not only for YouTube movies but for a number of other sites, including <a href="http://mashable.com/2006/06/30/google-video-copies-youtube-serves-up-myspace-codes/">Google Video</a>, <a href="http://mashable.com/2006/07/03/myspace-video-hits-back/">MySpace Video</a>, <a href="http://mashable.com/2007/01/22/dailymotion/">DailyMotion</a> and others. Again, you have to add the .flv extension by hand.</p>
<p><a href="http://keepvid.com/">keepvid.com<img class="snap_preview_icon" style="border:0 none;max-height:2000px;max-width:2000px;min-width:0;min-height:0;font-style:normal;font-weight:normal;" src="http://i.ixnp.com/images/v3.44/t.gif" alt="" /></a></p>
<p>3. <strong>VideoDownloader </strong>is very similar to KeepVid, but supports even more video sharing sites, and it’s also available as a <a id="snap_com_shot_engage_span_2" href="http://shots.snap.com/explore/72760/?key=6ff70e3830c3622fea69b92d992ef6a1&amp;svc=Snap_Shot_Custom%257CTechnology%257CCNET_Videos_%28CustomJS%29&amp;tag=Firefox%203&amp;src=pub-2174634-www.mashable.com&amp;cp=&amp;asp=Firefox&amp;dfs=10&amp;tol=engage">Firefox</a><span class="Snap_Shot_Custom|Technology|CNET_Videos_(CustomJS)" style="display:none;"> Firefox 3 </span><img class="snap_preview_icon" style="border:0 none;max-height:2000px;max-width:2000px;min-width:0;min-height:0;font-style:normal;font-weight:normal;" src="http://i.ixnp.com/images/v3.44/t.gif" alt="" /> extension. Just like with KeepVid, all downloads are in .flv format. We recommend <a href="http://www.freewarefiles.com/program_6_81_18085.html">MediaCoder<img class="snap_preview_icon" style="border:0 none;max-height:2000px;max-width:2000px;min-width:0;min-height:0;font-style:normal;font-weight:normal;" src="http://i.ixnp.com/images/v3.44/t.gif" alt="" /></a> for free conversion.</p>
<p><a href="http://javimoya.com/blog/youtube_en.php">javimoya.com/blog/youtube_en.php<img class="snap_preview_icon" style="border:0 none;max-height:2000px;max-width:2000px;min-width:0;min-height:0;font-style:normal;font-weight:normal;" src="http://i.ixnp.com/images/v3.44/t.gif" alt="" /></a></p>
<p>4. <strong>YouTube Downloads</strong> takes the cake in the longest domain name contest. It also separates itself by using a proxy for downloading videos, which means that you might be able to get videos even if YouTube access is blocked at your workplace or in the country you live. Just search Google for YouTube videos, and copy/paste the URL into YouTube Downloads.</p>
<p><a href="http://www.downloadandsaveyoutubevideos.info/">www.downloadandsaveyoutubevideos.info<img class="snap_preview_icon" style="border:0 none;max-height:2000px;max-width:2000px;min-width:0;min-height:0;font-style:normal;font-weight:normal;" src="http://i.ixnp.com/images/v3.44/t.gif" alt="" /></a></p>
<p>5. <strong>Zamzar</strong> is an online file format conversion site which can do a lot more than just converting YouTube videos to another format and downloading them to your hard drive, but it’s doing a great job so we had to include it here. Thoroughly tested by us and highly recommended. See the <a href="http://blog.zamzar.com/2007/02/16/support-launched-for-youtube-video-conversion/">video of it in action here<img class="snap_preview_icon" style="border:0 none;max-height:2000px;max-width:2000px;min-width:0;min-height:0;font-style:normal;font-weight:normal;" src="http://i.ixnp.com/images/v3.44/t.gif" alt="" /></a>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arufi.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arufi.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arufi.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arufi.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arufi.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arufi.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/arufi.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/arufi.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/arufi.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/arufi.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arufi.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arufi.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arufi.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arufi.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arufi.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arufi.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=18&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://arufi.wordpress.com/2008/08/27/download-youtube-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/274178fe6c00aa0eb28f7e183e05021b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arufi</media:title>
		</media:content>

		<media:content url="http://i.ixnp.com/images/v3.44/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.44/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.44/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.44/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.44/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.44/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.44/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.44/t.gif" medium="image" />

		<media:content url="http://i.ixnp.com/images/v3.44/t.gif" medium="image" />
	</item>
		<item>
		<title>Kehebatan Inframerah pada optik DVD/CD RW</title>
		<link>http://arufi.wordpress.com/2008/08/27/use-linfrared-cd-room/</link>
		<comments>http://arufi.wordpress.com/2008/08/27/use-linfrared-cd-room/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 07:19:33 +0000</pubDate>
		<dc:creator>arufi</dc:creator>
				<category><![CDATA[My Video]]></category>

		<guid isPermaLink="false">http://arufi.wordpress.com/?p=16</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=16&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<span style="text-align:center; display: block;"><a href="http://arufi.wordpress.com/2008/08/27/use-linfrared-cd-room/"><img src="http://img.youtube.com/vi/CgJ0EpxjZBU/2.jpg" alt="" /></a></span>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arufi.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arufi.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arufi.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arufi.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arufi.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arufi.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/arufi.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/arufi.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/arufi.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/arufi.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arufi.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arufi.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arufi.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arufi.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arufi.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arufi.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=16&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://arufi.wordpress.com/2008/08/27/use-linfrared-cd-room/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/274178fe6c00aa0eb28f7e183e05021b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arufi</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Injection</title>
		<link>http://arufi.wordpress.com/2008/08/26/sql-injection/</link>
		<comments>http://arufi.wordpress.com/2008/08/26/sql-injection/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 08:32:45 +0000</pubDate>
		<dc:creator>arufi</dc:creator>
				<category><![CDATA[english language]]></category>

		<guid isPermaLink="false">http://arufi.wordpress.com/?p=14</guid>
		<description><![CDATA[SQL injection is a technique that exploits a security vulnerability occurring in the database layer of an application. The vulnerability is present when user input is either incorrectly filtered for string literal escape characters embedded in SQL statements or user input is not strongly typed and thereby unexpectedly executed. It is in fact an instance [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=14&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span lang="EN">SQL injection</span></strong><span lang="EN"> is a technique that exploits a <a title="Security vulnerability" href="http://en.wikipedia.org/wiki/Security_vulnerability">security vulnerability</a> occurring in the <a title="Database" href="http://en.wikipedia.org/wiki/Database">database</a> layer of an <a title="Application software" href="http://en.wikipedia.org/wiki/Application_software">application</a>. The vulnerability is present when user input is either incorrectly filtered for <a title="String literal" href="http://en.wikipedia.org/wiki/String_literal">string literal</a> <a title="Escape sequences" href="http://en.wikipedia.org/wiki/Escape_sequences">escape characters</a> embedded in <a title="SQL" href="http://en.wikipedia.org/wiki/SQL">SQL</a> statements or user input is not <a title="Strongly-typed programming language" href="http://en.wikipedia.org/wiki/Strongly-typed_programming_language">strongly typed</a> and thereby unexpectedly executed. It is in fact an instance of a more general class of vulnerabilities that can occur whenever one programming or scripting language is embedded inside another.</span></p>
<h2><span class="mw-headline"><span lang="EN">Forms of SQL injection vulnerabilities</span></span></h2>
<h3><a id="Incorrectly_filtered_escape_characters" name="Incorrectly_filtered_escape_characters"></a><span class="mw-headline"><span lang="EN">Incorrectly filtered escape characters</span></span></h3>
<p style="text-align:justify;"><span lang="EN">This form of SQL injection occurs when user input is not filtered for <a title="Escape sequences" href="http://en.wikipedia.org/wiki/Escape_sequences">escape characters</a> and is then passed into a <a title="SQL" href="http://en.wikipedia.org/wiki/SQL">SQL</a> statement. This results in the potential manipulation of the statements performed on the database by the end user of the application.</span></p>
<p><span lang="EN">The following line of code illustrates this vulnerability:</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span lang="EN">statement := <span style="color:red;">"SELECT * FROM users WHERE name = '"</span> + userName + <span style="color:red;">"';"</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p style="text-align:justify;"><span lang="EN">This SQL code is designed to pull up the records of a specified username from its table of users. However, if the &#8220;userName&#8221; variable is crafted in a specific way by a malicious user, the SQL statement may do more than the code author intended. For example, setting the &#8220;<strong>userName</strong>&#8221; variable as</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span lang="EN">a<span style="color:red;">' or '</span>t<span style="color:red;">'='</span>t</span></pre>
</td>
</tr>
</tbody>
</table>
<p><span lang="EN">renders this SQL statement by the parent language:</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><strong><span style="color:#993333;">SELECT</span></strong><span lang="EN"> * <strong><span style="color:#993333;">FROM</span></strong> users <strong><span style="color:#993333;">WHERE</span></strong> name = <span style="color:red;">'a'</span> <strong><span style="color:#993333;">OR</span></strong> <span style="color:red;">'t'</span>=<span style="color:red;">'t'</span>;<strong></strong></span></pre>
</td>
</tr>
</tbody>
</table>
<p style="text-align:justify;"><span lang="EN">If this code were to be used in an authentication procedure then this example could be used to force the selection of a valid username because the evaluation of &#8216;t&#8217;='t&#8217; is always true.</span></p>
<p style="text-align:justify;"><span lang="EN">While most SQL Server implementations allow multiple statements to be executed with one call, some SQL APIs such as php&#8217;s mysql_query do not allow this for security reasons. This prevents hackers from injecting entirely separate queries, but doesn&#8217;t stop them from modifying queries. The following value of &#8220;userName&#8221; in the statement below would cause the deletion of the &#8220;users&#8221; table as well as the selection of all data from the &#8220;data&#8221; table (in essence revealing the information of every user):</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span lang="EN">a<span style="color:red;">';DROP TABLE users; SELECT * FROM data WHERE name LIKE '</span>%</span></pre>
</td>
</tr>
</tbody>
</table>
<p><span lang="EN">This input renders the final SQL statement as follows:</span></p>
<table class="MsoTableGrid" style="border:medium none;background:#f5f1d7 none repeat scroll 0;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><strong><span style="color:#993333;">SELECT</span></strong><span lang="EN"> * <strong><span style="color:#993333;">FROM</span></strong> users <strong><span style="color:#993333;">WHERE</span></strong> name = <span style="color:red;">'a'</span>;DROP <strong><span style="color:#993333;">TABLE</span></strong> users; <strong><span style="color:#993333;">SELECT</span></strong> * <strong><span style="color:#993333;">FROM</span></strong> <strong><span style="color:#993333;">DATA</span></strong> <strong><span style="color:#993333;">WHERE</span></strong> name <strong><span style="color:#993333;">LIKE</span></strong> <span style="color:red;">'%'</span>;</span></pre>
</td>
</tr>
</tbody>
</table>
<h3><span class="mw-headline"><span lang="EN">Incorrect type handling</span></span></h3>
<p style="text-align:justify;"><span lang="EN">This form of SQL injection occurs when a user supplied field is not <a title="Strongly typed" href="http://en.wikipedia.org/wiki/Strongly_typed">strongly typed</a> or is not checked for <a title="Data type" href="http://en.wikipedia.org/wiki/Data_type">type</a> constraints. This could take place when a numeric field is to be used in a SQL statement, but the programmer makes no checks to validate that the user supplied input is numeric. For example:</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span lang="EN">statement := <span style="color:red;">"SELECT * FROM data WHERE id = "</span> + a_variable + <span style="color:red;">";"</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p style="text-align:justify;"><span lang="EN">It is clear from this statement that the author intended a_variable to be a number correlating to the &#8220;id&#8221; field. However, if it is in fact a <a title="String (computer science)" href="http://en.wikipedia.org/wiki/String_%28computer_science%29">string</a> then the end user may manipulate the statement as they choose, thereby bypassing the need for escape characters. For example, setting a_variable to</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:#cc66cc;">1</span><span lang="EN">;DROP <strong><span style="color:#993333;">TABLE</span></strong> users</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="text-align:justify;"><span lang="EN">will delete the &#8220;users&#8221; table from the database, since the SQL would be rendered as follows:</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><strong><span style="color:#993333;">SELECT</span></strong><span lang="EN"> * <strong><span style="color:#993333;">FROM</span></strong> <strong><span style="color:#993333;">DATA</span></strong> <strong><span style="color:#993333;">WHERE</span></strong> id=<span style="color:#cc66cc;">1</span>;DROP <strong><span style="color:#993333;">TABLE</span></strong> users;</span></pre>
</td>
</tr>
</tbody>
</table>
<h3><span class="mw-headline"><span lang="EN">Vulnerabilities inside the database server</span></span></h3>
<p style="text-align:justify;"><span lang="EN">Sometimes vulnerabilities can exist within the database server software itself, as was the case with the <a title="MySQL" href="http://en.wikipedia.org/wiki/MySQL">MySQL</a> server&#8217;s </span><code><span style="font-size:10pt;" lang="EN">mysql_real_escape_string()</span></code><span lang="EN"> function. This would allow an attacker to perform a successful SQL injection attack based on bad Unicode characters even if the user&#8217;s input is being escaped.</span></p>
<h3><span class="mw-headline"><span lang="EN">Blind SQL Injection</span></span></h3>
<p style="text-align:justify;"><span lang="EN">Blind SQL Injection is used when a web application is vulnerable to SQL injection but the results of the injection are not visible to the attacker. The page with the vulnerability may not be one that displays data but will display differently depending on the results of a logical statement injected into the legitimate SQL statement called for that page. This type of attack can become time-intensive because a new statement must be crafted for each byte recovered. A tool called <a title="Absinthe(Software) (page does not exist)" href="http://en.wikipedia.org/w/index.php?title=Absinthe%28Software%29&amp;action=edit&amp;redlink=1"><span style="color:#cc2200;">Absinthe</span></a> can automate these attacks once the location of the vulnerability and the target information has been established.</span></p>
<h4><span class="mw-headline"><span lang="EN">Conditional Responses</span></span></h4>
<p style="text-align:justify;"><span lang="EN">One type of blind sql injection forces the database to evaluate a logical statement on an ordinary application screen.</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><strong><span style="color:#993333;">SELECT</span></strong><span lang="EN"> booktitle <strong><span style="color:#993333;">FROM</span></strong> booklist <strong><span style="color:#993333;">WHERE</span></strong> bookId = <span style="color:red;">'OOk14cd'</span> <strong><span style="color:#993333;">AND</span></strong> <span style="color:#cc66cc;">1</span>=<span style="color:#cc66cc;">1</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span lang="EN">will result in a normal page while</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><strong><span style="color:#993333;">SELECT</span></strong><span lang="EN"> booktitle <strong><span style="color:#993333;">FROM</span></strong> booklist <strong><span style="color:#993333;">WHERE</span></strong> bookId = <span style="color:red;">'OOk14cd'</span> <strong><span style="color:#993333;">AND</span></strong> <span style="color:#cc66cc;">1</span>=<span style="color:#cc66cc;">2</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p style="text-align:justify;"><span lang="EN">will likely give a different result if the page is vulnerable to a SQL injection. An injection like this will prove that a blind SQL injection is possible, leaving the attacker to devise statements that evaluate to true or false depending on the contents of a field in another table. </span></p>
<h4><span class="mw-headline"><span lang="EN">Conditional Errors</span></span></h4>
<p><span lang="EN">This type of blind SQL injection causes a SQL error by forcing the database to evaluate a statement that causes an error if the WHERE statement is true. For example,</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><strong><span style="color:#993333;">SELECT</span></strong><span lang="EN"> <span style="color:#cc66cc;">1</span>/<span style="color:#cc66cc;">0</span> <strong><span style="color:#993333;">FROM</span></strong> users <strong><span style="color:#993333;">WHERE</span></strong> username=<span style="color:red;">'Ralph'</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span lang="EN">the division by zero will only be evaluated and result in an error if user Ralph exists.</span></p>
<h4><span class="mw-headline"><span lang="EN">Time Delays</span></span></h4>
<p style="text-align:justify;"><span lang="EN">Time Delays are a type of blind SQL injection that cause the SQL engine to execute a long running query or a time delay statement depending on the logic injected. The attacker can then measure the time the page takes to load to determine if the injected statement is true.</span></p>
<h2><span class="mw-headline"><span lang="EN">Preventing SQL Injection</span></span></h2>
<p style="text-align:justify;"><span lang="EN">To protect against SQL injection, user input must not directly be embedded in SQL statements. Instead, user input must be escaped or filtered or parameterized statements must be used.</span></p>
<h4><span class="mw-headline"><span lang="EN">Using Parameterized Statements</span></span></h4>
<p style="text-align:justify;"><span lang="EN">In some programming languages such as Java and .NET parameterized statements can be used that work with parameters (sometimes called placeholders or bind variables) instead of embedding user input in the statement. In many cases, the SQL statement is fixed. The user input is then assigned (bound) to a parameter. This is an example using Java and the <a title="JDBC" href="http://en.wikipedia.org/wiki/JDBC">JDBC</a> API:</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;height:69px;" border="1" cellspacing="0" cellpadding="0" width="402">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><strong><span style="color:#aaaadd;">PreparedStatement</span></strong><span lang="EN"> prep = conn.<span style="color:#006600;">prepareStatement
</span><span style="color:#66cc66;">(</span><span style="color:red;">"SELECT * FROM USERS WHERE USERNAME=? AND PASSWORD=?"</span><span style="color:#66cc66;">)</span>;</span>
<span lang="EN">prep.<span style="color:#006600;">setString</span><span style="color:#66cc66;">(</span><span style="color:#cc66cc;">1</span>, username<span style="color:#66cc66;">)</span>;</span>
<span lang="EN">prep.<span style="color:#006600;">setString</span><span style="color:#66cc66;">(</span><span style="color:#cc66cc;">2</span>, password<span style="color:#66cc66;">)</span>;</span></pre>
</td>
</tr>
</tbody>
</table>
<p><span lang="EN">The same goes for C#:</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;height:193px;" border="1" cellspacing="0" cellpadding="0" width="505">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:#0600ff;">using</span><span lang="EN"> <span style="color:green;">(</span>SqlCommand myCommand = <span style="color:green;">new</span> SqlCommand<span style="color:green;">
(</span><span style="color:gray;">"select * from Users where UserName=@username and Password=@password"</span>, myConnection<span style="color:green;">))</span></span>
<span lang="EN"><span>             </span><span>   </span></span><span style="color:green;">{</span><span lang="DE"><span>                    </span></span>
<span lang="DE"><span>                    </span>myCommand.<span style="color:blue;">Parameters</span>.<span style="color:blue;">AddWithValue</span><span style="color:green;">(</span><span style="color:gray;">"@username"</span>, user<span style="color:green;">)</span>;</span>
<span lang="DE"><span>                    </span></span><span lang="EN">myCommand.<span style="color:blue;">Parameters</span>.<span style="color:blue;">AddWithValue</span><span style="color:green;">(</span><span style="color:gray;">"@password"</span>, pass<span style="color:green;">)</span>;</span>
<span lang="EN"> </span>
<span lang="EN"><span>                    </span>myConnection.<span style="color:blue;">Open</span><span style="color:green;">()</span>;</span>
<span lang="EN"><span>                    </span>SqlDataReader myReader = myCommand.<span style="color:blue;">ExecuteReader</span><span style="color:green;">())</span></span>
<span lang="EN"><span>                    </span>...................</span>
<span lang="EN"><span>                </span><span style="color:green;">}</span></span></pre>
</td>
</tr>
</tbody>
</table>
<p><span lang="EN">In PHP, it&#8217;s usual to just escape the parameters before sending the SQL query:</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:blue;">$query</span><span lang="EN"> = <span style="color:#000066;">sprintf</span><span style="color:#66cc66;">(</span><span style="color:red;">"SELECT * FROM Users where UserName='%s' and Password='%s'"</span>, </span>
<span lang="EN"><span>        </span><span>          </span><span style="color:#000066;">mysql_real_escape_string</span><span style="color:#66cc66;">(</span><span style="color:blue;">$Username</span><span style="color:#66cc66;">)</span>, </span>
<span lang="EN"><span>                  </span><span style="color:#000066;">mysql_real_escape_string</span><span style="color:#66cc66;">(</span><span style="color:blue;">$Password</span><span style="color:#66cc66;">))</span>;</span>
<span style="color:#000066;">mysql_query</span><span style="color:#66cc66;">(</span><span style="color:blue;">$query</span><span style="color:#66cc66;">)</span><span lang="EN">;</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="text-align:justify;"><span lang="EN">For PHP version 4.1 and above, however, you can use extension like msqli for &#8220;true&#8221; prepared statement queries: </span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:blue;">$db</span><span lang="EN"> = <strong><span style="color:black;">new</span></strong> mysqli<span style="color:#66cc66;">(</span><span style="color:red;">"localhost"</span>, <span style="color:red;">"user"</span>, <span style="color:red;">"pass"</span>, <span style="color:red;">"database"</span><span style="color:#66cc66;">)</span>;</span>
<span style="color:blue;">$stmt</span><span lang="EN"> = <span style="color:blue;">$mysqli</span> -&gt; <span style="color:#006600;">prepare</span><span style="color:#66cc66;">(</span><span style="color:red;">"SELECT priv FROM testUsers WHERE username=? AND password=?"</span><span style="color:#66cc66;">)</span>;</span>
<span style="color:blue;">$stmt</span><span lang="EN"> -&gt; <span style="color:#006600;">bind_param</span><span style="color:#66cc66;">(</span><span style="color:red;">"ss"</span>, <span style="color:blue;">$user</span>, <span style="color:blue;">$pass</span><span style="color:#66cc66;">)</span>;</span>
<span style="color:blue;">$stmt</span><span lang="EN"> -&gt; <span style="color:#006600;">execute</span><span style="color:#66cc66;">()</span>;</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="text-align:justify;"><span lang="EN">The mysql_real_escape_string adds slashes (/) to escaped characters like single quotes &#8216; and double quotes &#8220;. Though, you should read <a href="#Vulnerabilities_inside_the_database_ser">this</a></span></p>
<p style="text-align:justify;"><span lang="EN">In ColdFusion, the CFQUERYPARAM statement is useful in conjunction with the CFQUERY statement to nullify the effect of SQL code passed within the CFQUERYPARAM value as part of the SQL clause.<sup><a href="#cite_note-4">[5]</a></sup> <sup><a href="#cite_note-5">[6]</a></sup>. An example is below.</span></p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f5f1d7 none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:#990000;">&lt;cfquery</span><span style="color:#333333;"> </span><span style="color:blue;">name</span><span style="color:#333333;">=</span><span style="color:#009900;">"Recordset1"</span><span style="color:#333333;"> </span><span style="color:blue;">datasource</span><span style="color:#333333;">=</span><span style="color:#009900;">"cafetownsend"</span><span style="color:#990000;">&gt;</span>
<span lang="EN">SELECT *</span>
<span lang="EN">FROM COMMENTS</span>
<span lang="EN">WHERE COMMENT_ID =<span style="color:#990000;">&lt;cfqueryparam</span><span style="color:#333333;"> </span><span style="color:blue;">value</span><span style="color:#333333;">=</span><span style="color:#009900;">"#URL.COMMENT_ID#"</span><span style="color:#333333;"> cfsqltype=</span><span style="color:#009900;">"cf_sql_numeric"</span><span style="color:#990000;">&gt;</span></span>
<span style="color:#990000;">&lt;/cfquery&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
<h4><span class="mw-headline"><span lang="EN">Enforcing the Use of Parameterized Statements</span></span></h4>
<p style="text-align:justify;"><span lang="EN">There are two ways to ensure an application is not vulnerable to SQL injection: using code reviews (which is a manual process), and enforcing the use of parameterized statements. Enforcing the use of parameterized statements means that SQL statements with embedded user input are rejected at runtime. Currently only the <a title="H2 (DBMS)" href="http://en.wikipedia.org/wiki/H2_%28DBMS%29">H2 Database Engine</a> supports this feature.</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arufi.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arufi.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arufi.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arufi.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arufi.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arufi.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/arufi.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/arufi.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/arufi.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/arufi.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arufi.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arufi.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arufi.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arufi.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arufi.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arufi.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=14&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://arufi.wordpress.com/2008/08/26/sql-injection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/274178fe6c00aa0eb28f7e183e05021b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arufi</media:title>
		</media:content>
	</item>
		<item>
		<title>phpMinAdmin is a powerful minimalist MySQL editor</title>
		<link>http://arufi.wordpress.com/2008/08/26/phpminadmin-is-a-powerful-minimalist-mysql-editor/</link>
		<comments>http://arufi.wordpress.com/2008/08/26/phpminadmin-is-a-powerful-minimalist-mysql-editor/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 08:04:57 +0000</pubDate>
		<dc:creator>arufi</dc:creator>
				<category><![CDATA[english language]]></category>

		<guid isPermaLink="false">http://arufi.wordpress.com/?p=12</guid>
		<description><![CDATA[If you&#8217;ve ever worked with and manipulated MySQL databases, chances are you&#8217;ve used phpMyAdmin to manage your databases from a Web interface. But phpMyAdmin can be a little complex; if you want a lightweight alternative, try phpMinAdmin. It&#8217;s easier to install than its more robust cousin and has an easy-to-navigate graphical user interface for most [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=12&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="xar-clearleft">
<p>If you&#8217;ve ever worked with and manipulated MySQL databases, chances are you&#8217;ve used <a href="http://www.phpmyadmin.net/">phpMyAdmin</a> to manage your databases from a Web interface. But phpMyAdmin can be a little complex; if you want a lightweight alternative, try <a href="http://phpminadmin.sourceforge.net/">phpMinAdmin</a>. It&#8217;s easier to install than its more robust cousin and has an easy-to-navigate graphical user interface for most important MySQL functions.</div>
<div id="featurecontent" class="xar-align-left">
<p>Many Web hosting solutions bundle phpMyAdmin to let users create databases for their blogging software or content management systems. If yours doesn&#8217;t, you&#8217;ll find installing phpMinAdmin far easier than <a href="http://wiki.cihar.com/pma/Quick_Install">installing phpMyAdmin</a>. phpMinAdmin is a single PHP script that requires no configuration. You just need to upload it to your Web server&#8217;s root directory and log in with your database connection settings. This also makes it an ideal tool for people working on local database projects who need a MySQL GUI but don&#8217;t have the time to install phpMyAdmin.</p>
<p>Once you&#8217;ve uploaded the script and entered your database connection details (host, database admin&#8217;s username, and password), you&#8217;ll be dropped to phpMinAdmin&#8217;s simple main page. I was initially surprised by its minimalism, especially when compared to phpMyAdmin&#8217;s landing page. Looking closely though, you can do quite a bit from phpMinAdmin&#8217;s main page &#8212; you can create a new database, edit database user privileges, and see a list of ongoing database activities, all from links on the right-hand pane, and from select a database for querying or editing, and back up all databases on the host from choices on the left.</p>
<p>The best part about phpMinAdmin is that it maintains minimalism throughout its interface without compromising on functionality. You get additional options and functions as you dive deeper into tasks such as creating a database or adding tables.</p>
<p>When you select a database from the drop-down list on the main interface, the view is updated to show you a list of all the tables in the database in the left pane. In the right pane you get advanced controls to alter the database, prepare simple <a href="http://en.wikipedia.org/wiki/Database_schema">database schemas</a>, <a href="http://en.wikipedia.org/wiki/View_%28database%29">create and store a database view</a>, and <a href="http://dev.mysql.com/doc/refman/5.0/en/create-procedure.html">create procedures and functions</a>.</p>
<p>If you are using phpMinAdmin to manage your blog or Web software, your interactions with a database will be limited to creating or removing one. If you are updating your Web software or moving to another one, you&#8217;ll also want to back up and restore your database. With phpMinAdmin you can do these tasks without much effort.</p>
<p>The &#8220;Create new database&#8221; link on the main page takes you to a simple form that asks you to enter a name of the database you want to create and select a <a href="http://en.wikipedia.org/wiki/Collation">collation scheme</a> for it from a drop-down list. Collation is the character set used to store data in the text field and is part of MySQL&#8217;s internationalization efforts. If you don&#8217;t select any collation, phpMinAdmin uses MySQL&#8217;s default collation, latin1_swedish_ci, which works fine for storing text in English.</p>
<p>If you create a database for a Web application, such as WordPress, the application&#8217;s installer will automatically create tables. But if you are working on a database project of your own, you can create tables with phpMinAdmin, using the &#8220;Create new table&#8221; link after selecting the database from the main interface. As in any relational database, a MySQL table consists of columns, all of which have unique names and are of a particular type and length. To make your task easier, phpMinAdmin lists all MySQL column types and their respective options in a drop-down list. You can also easily define primary keys, foreign keys, and triggers.</p>
<p>More importantly, modifying the structure of tables, keys, and triggers is as easy as creating them. In fact you can also alter the name of the database and its collation using the &#8220;Alter database&#8221; link after selecting the database from the pull-down list on the main interface. You also get a &#8220;Drop&#8221; button within the alter database section to delete the database and all its tables.</p>
<p>Another common database task is to sort the data in the tables. Instead of using WordPress&#8217;s built-in comment removal system, I find it easier to hunt for spam comments on my WordPress site (or for that matter any database-driven blogging software) by querying the database directly and then deleting the selected ones. phpMinAdmin is perfectly suited for this as well. To hunt for spam in the comments table in my WordPress database, I click on the &#8220;select&#8221; link next to the wp_comments table. In the interface that opens, phpMinAdmin helps me write a <a href="http://en.wikipedia.org/wiki/SQL#Queries">SELECT SQL query</a> by arranging all the relevant attributes, keywords, and clauses in drop-down lists.</p>
<p>Once your query returns a group of records, you can edit them individually using the &#8220;edit&#8221; link, or select them all, or particular ones. You can then delete the selected ones or use the &#8220;<a href="http://dev.mysql.com/doc/refman/5.0/en/truncate.html">Truncate table</a>&#8221; button to empty the table.</p>
<p>Since you can&#8217;t undeleted a dropped table, it&#8217;s a good idea to keep a backup of any tables you plan to delete. In fact, in general, backups are a guarantee against those situations when the database is corrupted due to reasons beyond your control, such as disk errors. Currently with phpMinAdmin you can import a single table, a whole database, or all databases on the host as SQL queries. This means when you use the &#8220;Dump&#8221; link after selecting a database from the pull-down menu in the main interface, phpMinAdmin will display a long list of SQL queries you can use to restore the database. Tools like phpMyAdmin can also read these queries and restore the database. You can also <a href="http://www.devshed.com/c/a/MySQL/Backing-up-and-restoring-your-MySQL-Database/2/">restore by directly feeding the SQL statements to MySQL</a>.</p>
<p>Similarly, to import a database with phpMinAdmin, you&#8217;ll have to either paste a SQL query or upload a file with the list of SQL queries. You&#8217;ll find the text box to paste the SQL query under the &#8220;SQL command&#8221; link on the main interface.</p>
<p>Jakub Vrána, phpMinAdmin&#8217;s developer, is working to improve the tool&#8217;s import and export options. He says he&#8217;s working on a new version of phpMinAdmin, which he hopes will be released in early September, that will allow users to choose the tables and the type of data they want to export, and the format of their choice. He&#8217;s also working on a feature that will sync databases on two machines easily. But Vrána isn&#8217;t considering working on a PostgreSQL version of phpMinAdmin.</p>
<p>phpMinAdmin is a nice little app that can be employed in a broad range of database projects. You may be able to do more with phpMyAdmin, but phpMinAdmin can do many of the most common MySQL database tasks, which makes it suitable for most kinds of database projects. Thanks to its no-nonsense install and easy-to-use interface, it&#8217;s also a good tool for anyone new to databases, for tasks that involve limited database interactions like maintaining a blog or other CMS.</p></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arufi.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arufi.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arufi.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arufi.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arufi.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arufi.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/arufi.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/arufi.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/arufi.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/arufi.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arufi.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arufi.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arufi.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arufi.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arufi.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arufi.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=12&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://arufi.wordpress.com/2008/08/26/phpminadmin-is-a-powerful-minimalist-mysql-editor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/274178fe6c00aa0eb28f7e183e05021b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arufi</media:title>
		</media:content>
	</item>
		<item>
		<title>Protecting your MySQL database from SQL injection attacks with GreenSQL</title>
		<link>http://arufi.wordpress.com/2008/08/26/protecting-your-mysql-database-from-sql-injection-attacks-with-greensql/</link>
		<comments>http://arufi.wordpress.com/2008/08/26/protecting-your-mysql-database-from-sql-injection-attacks-with-greensql/#comments</comments>
		<pubDate>Tue, 26 Aug 2008 07:57:43 +0000</pubDate>
		<dc:creator>arufi</dc:creator>
				<category><![CDATA[english language]]></category>

		<guid isPermaLink="false">http://arufi.wordpress.com/?p=10</guid>
		<description><![CDATA[SQL injection attacks can allow hackers to execute arbitrary SQL commands on your database through your Web site. To avoid these attacks, every piece of data supplied by a user on a Web form, through HTTP Post or CGI parameters, or other means, must be validated to not contain information that is not expected. GreenSQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=10&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="margin:0 0 0.0001pt;"><a href="http://en.wikipedia.org/wiki/SQL_injection">SQL injection</a> attacks can allow hackers to execute arbitrary SQL commands on your database through your Web site. To avoid these attacks, every piece of data supplied by a user on a Web form, through HTTP Post or CGI parameters, or other means, must be validated to not contain information that is not expected. GreenSQL is a firewall for SQL &#8212; it sits between your Web site and MySQL database and decides which SQL statements should and should not be executed. At least that&#8217;s the idea &#8212; in execution, I found some open doors.</p>
<p style="margin:0 0 0.0001pt;">GreenSQL is designed to be used as a proxy for a MySQL database. Instead of connecting directly to your MySQL database, you Web site connects to GreenSQL. GreenSQL forwards legitimate SQL to the MySQL database and returns the results. If GreenSQL detects SQL that is not whitelisted and that includes nasty or suspicious SQL, it will block that SQL and return the empty result set without contacting the MySQL database. For an idea of the SQL injection attacks that GreenSQL blocks, see the online <a href="http://demo.greensql.net/">demo page</a>.</p>
<p style="margin:0 0 0.0001pt;">GreenSQL is not in the distribution repositories for Fedora, openSUSE, or Ubuntu. It is available as a <a href="http://software.opensuse.org/ymp/home:yuli_s/openSUSE_10.3/greensql-fw.ymp">1-Click</a> install for opneSUSE 10.3, and for <a href="http://software.opensuse.org/ymp/home:jgotteswinter/Fedora_8/greensql-fw.ymp">Fedora 8</a>. The GreenSQL <a href="http://sourceforge.net/project/showfiles.php?group_id=199511">download page</a> includes packages for Fedora 7, openSUSE 10.2, FreeBSD, and Ubuntu Feisty Fawn and older. In this article I&#8217;ll install from source on a 64-bit Fedora 9 machine using version 0.8.4 of greensql-fw.</p>
<p style="margin:0 0 0.0001pt;">Installation does not use autotools, and you have to set up things like configuration files, system users, MySQL configuration, log file setup, and /etc/init.d files manually. The procedure is well documented in install.txt. Better yet, by executing a few of the shell scripts in the scripts directory, you can complete much of the setup. To compile the application, simply execute <code><span style="font-size:10pt;">make</span></code> in the top directory as shown below. On Fedora 9 I got the following error soon after compilation started, which was due to libevent-devel not being installed.</p>
<p style="margin:0 0 0.0001pt;">
<table class="MsoNormalTable" style="border:medium none;background:#f8edbe none repeat scroll 0 50%;margin-left:5.4pt;border-collapse:collapse;height:97px;" border="1" cellspacing="0" cellpadding="0" width="486">
<tbody>
<tr style="height:72pt;">
<td style="border:1pt solid windowtext;width:404.8pt;height:72pt;padding:0 5.4pt;" width="540" valign="top">
<pre><span style="color:maroon;">$ tar xzf /.../greensql-fw-0.8.4.tar.gz</span>
<span style="color:maroon;">$ cd greensql-fw-0.8.4/</span>
<span style="color:maroon;">$ make</span>
<span style="color:maroon;">...</span>
<span style="color:maroon;">connection.hpp:29: error: field 'proxy_event' has incomplete type</span>
<span style="color:maroon;">connection.hpp:30: error: field 'client_event' has incomplete type</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">
<p style="margin:0 0 0.0001pt;">Once I had libevent-devel installed, I found that I needed to modify /usr/include/event.h to include sys/types.h in order to compile event code.</p>
<table class="MsoTableGrid" style="border:medium none;background:#f8edbe none repeat scroll 0 50%;border-collapse:collapse;height:122px;" border="1" cellspacing="0" cellpadding="0" width="493">
<tbody>
<tr>
<td style="border:1pt solid windowtext;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">vi /usr/include/event.h</span>
<span style="color:maroon;">...</span>
<span style="color:maroon;">#include &lt;sys/time.h&gt;</span>
<span style="color:maroon;">#include &lt;sys/types.h&gt;</span>
<span style="color:maroon;">#include &lt;stdint.h&gt;</span>
<span style="color:maroon;">#include &lt;stdarg.h&gt;</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">At this stage, <code><span style="font-size:10pt;">make -k</span></code> failed on a few files which were calling string functions such as <code><span style="font-size:10pt;">strcasecmp</span></code> without having included the string.h header file. Depending on which version of gcc you are using the below issues might not be present when you compile GreenSQL.</p>
<table class="MsoTableGrid" style="border:medium none;background:#e6e6e6 none repeat scroll 0;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<p style="margin:0 0 0.0001pt;"><strong><span style="color:black;">gcc   issues</span></strong></p>
<p style="margin:0 0 0.0001pt;"><span style="color:black;">The   build issues presented in this article are due to gcc being pedantic when   compiling code that uses certain functions in string.h. In the past you could   simply use </span><code><span style="font-size:10pt;color:black;">strlen</span></code><span style="color:black;"> without including the header file. Now you must include   the header or gcc will fail to compile your code.</span></p>
<p style="margin:0 0 0.0001pt;"><span style="color:black;">The   64-bit library path change is a follow-on from not using a system detection   process like autotools to handle such changes automatically and the Makefile   being geared for a 32-bit distribution. While neither of these issues are   showstoppers, they do make it a little more involved to install GreenSQL on a   64-bit Fedora 9 machine.</span></p>
<p style="margin:0 0 0.0001pt;">
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">$ cd src</span>
<span style="color:maroon;">$ vi mysql/mysql_con.cpp </span>
<span style="color:maroon;">...</span>
<span style="color:maroon;">// License: GPL v2 (http://www.gnu.org/licenses/gpl.html)</span>
<span style="color:maroon;">//</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">#include &lt;string.h&gt;</span>
<span style="color:maroon;">#include "mysql_con.hpp"</span>
<span style="color:maroon;">...</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">$ vi config.hpp </span>
<span style="color:maroon;">...</span>
<span style="color:maroon;">#ifndef GREEN_SQL_CONFIG_HPP</span>
<span style="color:maroon;">#define GREEN_SQL_CONFIG_HPP</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">#include &lt;string.h&gt;</span>
<span style="color:maroon;">...</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">$ vi ../src/parser/expression.hpp</span>
<span style="color:maroon;">...</span>
<span style="color:maroon;">#ifndef _SQL_EXPRESSION_HPP_</span>
<span style="color:maroon;">#define _SQL_EXPRESSION_HPP_</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">#include &lt;string.h&gt;</span>
<span style="color:maroon;">...</span></pre>
<p style="margin:0 0 0.0001pt;">
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">
<p style="margin:0 0 0.0001pt;">If you are building GreenSQL on a 64-bit distribution you will also have to modify the Makefile slightly so that the build checks lib64 instead of just the lib directory, as shown below:</p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">$ vi src/Makefile</span>
<span style="color:maroon;">...</span>
<span style="color:maroon;">LIBS:=-L/usr/local/lib -L/usr/local/lib/mysql -L/usr/lib64/mysql -lmysqlclient -levent -lpcre</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">greensql-fw: $(OBJS)</span>
<span style="color:maroon;">...</span>
<span style="color:maroon;">$ make</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">Shown below are the commands to finish installation once the daemon is compiled. The package&#8217;s install.txt file describes manual installation, which uses the same commands that the scripts do. Using the scripts is likely to be the better option because the installation process can be improved (the contents of the scripts) while the procedure remains the same. The installation instructions recommend setting up the MySQL database before the /etc/greensql directory, but if you do that the MySQL script invocation fails to find the configuration file and you must make the changes to /etc/greensql/greensql.conf manually. This is a bit of a chicken and egg problem but the only major change you must make to the greensql.conf file is to get the MySQL database parameters.</p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">greensql-fw-0.8.4]# cd ./scripts/</span>
<span style="color:maroon;"># ./setup_user.sh</span>
<span style="color:maroon;">done...</span>
<span style="color:maroon;"># ./greensql-create-db.sh</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">---------------------------------------------</span>
<span style="color:maroon;">The following settings will be used:</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">MySQL admin user: [root]</span>
<span style="color:maroon;">MySQL admin password: []</span>
<span style="color:maroon;">MySQL server address: [127.0.0.1]</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">GreenSQL configuration DB name: [greendb]</span>
<span style="color:maroon;">DB user to create: [green]</span>
<span style="color:maroon;">Password to set: [pwd]</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">Do you want to change anything? [y/N] y</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">MySQL admin user [root]: </span>
<span style="color:maroon;">MySQL admin password []: XXxxXXxxXXxx-FIXME</span>
<span style="color:maroon;">MySQL server address (you can use ip:port string) [127.0.0.1]: </span>
<span style="color:maroon;">GreenSQL config db name [greendb]: </span>
<span style="color:maroon;">GreenSQL DB user name [green]: greendb</span>
<span style="color:maroon;">GreenSQL DB user password [pwd]: greendbpass</span>
<span style="color:maroon;">---------------------------------------------</span>
<span style="color:maroon;">The following settings will be used:</span>
<span style="color:maroon;">Do you want to change anything? [y/N] </span>
<span style="color:maroon;"> </span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">Creating MySQL database...</span>
<span style="color:maroon;">Adding MySQL user...</span>
<span style="color:maroon;">Creating MySQL tables...</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">GreenSQL configuration file is not writable!!!</span>
<span style="color:maroon;">Check that [database] section contains the following settings in</span>
<span style="color:maroon;">/etc/greensql/greensql.conf</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">[database]</span>
<span style="color:maroon;">dbhost=127.0.0.1</span>
<span style="color:maroon;">dbname=greendb</span>
<span style="color:maroon;">dbuser=greendb</span>
<span style="color:maroon;">dbpass=greendbpass</span>
<span style="color:maroon;"># dbport=3306</span>
<span style="color:maroon;">...</span>
<span style="color:maroon;"># ./setup_conf.sh</span>
<span style="color:maroon;">done...</span>
<span style="color:maroon;"># ./setup_log.sh </span>
<span style="color:maroon;">done...</span>
<span style="color:maroon;"># ./setup_binary.sh</span>
<span style="color:maroon;">done...</span>
<span style="color:maroon;"># vi /etc/greensql/greensql.conf </span>
<span style="color:maroon;">...</span>
<span style="color:maroon;">[database]</span>
<span style="color:maroon;">dbhost=127.0.0.1</span>
<span style="color:maroon;">dbname=greendb</span>
<span style="color:maroon;">dbuser=greendb</span>
<span style="color:maroon;">dbpass=greendbpass</span>
<span style="color:maroon;">...</span>
<span style="color:maroon;"># chkconfig<span>  </span>--add greensql </span>
<span style="color:maroon;">service greensql does not support chkconfig</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;"># /etc/init.d/greensql start</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">For testing purposes I created the <code><span style="font-size:10pt;">test</span></code> database and gave the user <code><span style="font-size:10pt;">ben</span></code> free access to it with the commands shown below:</p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;"># mysql -p</span>
<span style="color:maroon;">Enter password: </span>
<span style="color:maroon;">Welcome to the MySQL monitor. Commands end with ; or \g.</span>
<span style="color:maroon;">mysql&gt; GRANT ALL ON test.* TO ben@"%";</span>
<span style="color:maroon;">mysql&gt; FLUSH PRIVILEGES;</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">GreenSQL runs on port 3305 by default, which is one less than the default MySQL port of 3306. If you use the mysql console client and connect to the GreenSQL 3305 port you will not be able to create a new table, even though, as shown in the command below, when you connect directly to MySQL on port 3306 you are able to create a new table.</p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">$ mysql --verbose<span>  </span>-h<span>  </span>127.0.0.1 -P 3305 test</span>
<span style="color:maroon;">mysql&gt; create table foo ( id int );</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">create table foo ( id int )</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">Query OK, 0 rows affected (0.01 sec)</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">mysql&gt; insert into foo values ( 55 );</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">insert into foo values ( 55 )</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">ERROR 1146 (42S02): Table 'test.foo' doesn't exist</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">$ mysql --verbose<span>  </span>-h<span>  </span>127.0.0.1<span>   </span>-P 3306 test</span>
<span style="color:maroon;">Welcome to the MySQL monitor. Commands end with ; or \g.</span>
<span style="color:maroon;">mysql&gt; create table foo ( id int );</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">create table foo ( id int )</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">Query OK, 0 rows affected (0.01 sec)</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">mysql&gt; insert into foo values ( 55 );</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">insert into foo values ( 55 )</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">Query OK, 1 row affected (0.00 sec)</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">mysql&gt; insert into foo values ( 131 );</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">insert into foo values ( 131 )</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">Query OK, 1 row affected (0.00 sec)</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">mysql&gt;<span>  </span>select * from foo;</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">select * from foo</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">+------+</span>
<span style="color:maroon;">| id<span>   </span>|</span>
<span style="color:maroon;">+------+</span>
<span style="color:maroon;">|<span>   </span>55 | </span>
<span style="color:maroon;">|<span>  </span>131 | </span>
<span style="color:maroon;">+------+</span>
<span style="color:maroon;">2 rows in set (0.00 sec)</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">With the default GreenSQL configuration you cannot drop tables through the GreenSQL firewall. This is just as well, because table structure is not likely to change often and most likely will not change at all from the Web site interface.</p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">$ mysql --verbose<span>  </span>-h<span>  </span>127.0.0.1<span>   </span>-P 3305 test</span>
<span style="color:maroon;">Welcome to the MySQL monitor. Commands end with ; or \g.</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">mysql&gt;<span>  </span>select * from foo;</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">select * from foo</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">+------+</span>
<span style="color:maroon;">| id<span>   </span>|</span>
<span style="color:maroon;">+------+</span>
<span style="color:maroon;">|<span>   </span>55 | </span>
<span style="color:maroon;">|<span>  </span>131 | </span>
<span style="color:maroon;">+------+</span>
<span style="color:maroon;">2 rows in set (0.00 sec)</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">mysql&gt; drop table foo;</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">drop table foo</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">Query OK, 0 rows affected (0.00 sec)</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">mysql&gt;<span>  </span>select * from foo;</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">select * from foo</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">+------+</span>
<span style="color:maroon;">| id<span>   </span>|</span>
<span style="color:maroon;">+------+</span>
<span style="color:maroon;">|<span>   </span>55 | </span>
<span style="color:maroon;">|<span>  </span>131 | </span>
<span style="color:maroon;">+------+</span>
<span style="color:maroon;">2 rows in set (0.01 sec)</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">The injection tests did not seem to work as well as I had hoped. The first test was to delete tuples based on a condition that was always true. This wipes out all the data in a table and leave an empty table schema. By default this query worked through the firewall.</p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">$ mysql --verbose<span>  </span>-h<span>  </span>127.0.0.1<span>   </span>-P 3305 test</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">mysql&gt; delete from foo where 1=1;</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">delete from foo where 1=1</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">Query OK, 2 rows affected (0.00 sec)</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">mysql&gt;<span>  </span>select * from foo;</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;">select * from foo</span>
<span style="color:maroon;">--------------</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">Empty set (0.00 sec)</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">For the above SQL delete command, the /var/log/greensql.log file contained the following information:</p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">SQL_DEBUG: QUERY command[]: delete from foo where 1=1</span>
<span style="color:maroon;">SQL_DEBUG: AFTER NORM<span>   </span>: delete from foo where ?=?</span>
<span style="color:maroon;">SQL_DEBUG: RISK<span>         </span>: 0</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">The /etc/greensql/greensql.conf file allows you to set how risky you think certain things are. For example, you can assign a weight of 10 to the use of the <code><span style="font-size:10pt;">union</span></code> keyword or with direct variable comparison in a query (something like 1=2). The variables include <code><span style="font-size:10pt;">block_level = 30</span></code> so any query with a risk above 30 will not be forwarded to the MySQL server. In an attempt to make GreenSQL flag the above query I increased <code><span style="font-size:10pt;">risk_var_cmp_var</span></code> and <code><span style="font-size:10pt;">risk_always_true</span></code> up to 150 from their default of 30. Unfortunately, the query remained seen as a zero-risk query.</p>
<p style="margin:0 0 0.0001pt;">Because the above SQL might be valid, I based the query shown in the below logs on the template described in the <a href="http://www.greensql.net/publications/backdoor-webserver-using-mysql-sql-injection">MySQL SQL Injection</a> Web page of the GreenSQL Web site. This SQL injection relies on the Web site inserting data provided from the user into an SQL query string and submitting it to the database. It too was allowed through.</p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">SQL_DEBUG: QUERY command[]: delete from foo where id=181 or 1=1</span>
<span style="color:maroon;">SQL_DEBUG: AFTER NORM<span>   </span>: delete from foo where id=? or ?=?</span>
<span style="color:maroon;">SQL_DEBUG: RISK<span>         </span>: 0</span>
<span style="color:maroon;"> </span>
<span style="color:maroon;">SQL_DEBUG: QUERY command[]: delete from s where comment = 'whatever' or '1'='1'</span>
<span style="color:maroon;">SQL_DEBUG: AFTER NORM<span>   </span>: delete from s where comment = ? or ?=?</span>
<span style="color:maroon;">SQL_DEBUG: RISK<span>         </span>: 0</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">After much strace(1)ing and other prodding trying to work out why GreenSQL was flagging the above nasty query as zero risk it dawned on me to try a <code><span style="font-size:10pt;">SELECT</span></code> query. This was the key to getting GreenSQL to work as expected, blocking this nasty query, as the below portion of the log file shows.</p>
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td style="border:1pt solid windowtext;background:#f8edbe none repeat scroll 0 50%;width:442.8pt;padding:0 5.4pt;" width="590" valign="top">
<pre><span style="color:maroon;">SQL_DEBUG: QUERY command[]: select * from folks where name='sam' or '1'='1'</span>
<span style="color:maroon;">SQL_DEBUG: AFTER NORM<span>   </span>: select * from folks where name=? or ?=?</span>
<span style="color:maroon;">DEBUG:<span>     </span>Query has 'or' token</span>
<span style="color:maroon;">DEBUG:<span>     </span>Variable comparison only</span>
<span style="color:maroon;">SQL_DEBUG: RISK<span>         </span>: 3</span></pre>
</td>
</tr>
</tbody>
</table>
<p style="margin:0 0 0.0001pt;">Given that SQL injection in a <code><span style="font-size:10pt;">select</span></code> statement can allow a user to login to a Web site <a href="http://www.greensql.net/publications/backdoor-webserver-using-mysql-sql-injection">without a password</a>, having GreenSQL inspecting your selects is a good thing. In future releases I hope the developers extend GreenSQL&#8217;s protection to <code><span style="font-size:10pt;">delete</span></code> statements, as an injection in one of those can clear an entire table.</p>
<p style="margin:0 0 0.0001pt;">
<p style="margin:0 0 0.0001pt;">Source : <a href="http://www.linux.com/feature/145341" target="_blank">http://www.linux.com/feature/145341</a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/arufi.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/arufi.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/arufi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/arufi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/arufi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/arufi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/arufi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/arufi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/arufi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/arufi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/arufi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/arufi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/arufi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/arufi.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/arufi.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/arufi.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=arufi.wordpress.com&amp;blog=4059159&amp;post=10&amp;subd=arufi&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://arufi.wordpress.com/2008/08/26/protecting-your-mysql-database-from-sql-injection-attacks-with-greensql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/274178fe6c00aa0eb28f7e183e05021b?s=96&#38;d=identicon" medium="image">
			<media:title type="html">arufi</media:title>
		</media:content>
	</item>
	</channel>
</rss>
