<?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>Burad's Blog &#187; programming</title>
	<atom:link href="http://www.aburad.com/blog/tag/programming/feed" rel="self" type="application/rss+xml" />
	<link>http://www.aburad.com/blog</link>
	<description>Linux, Tech, web , programming and other stuff I'm inerested in</description>
	<lastBuildDate>Thu, 11 Mar 2010 15:54:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zune Bug explained</title>
		<link>http://www.aburad.com/blog/2009/01/zune-bug-explained.html</link>
		<comments>http://www.aburad.com/blog/2009/01/zune-bug-explained.html#comments</comments>
		<pubDate>Fri, 02 Jan 2009 15:24:41 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.aburad.com/blog/?p=266</guid>
		<description><![CDATA[On new year eve, All Microsoft Zune players freezed, becoming totally unresponsive and practically useless.
&#8220;In what appears to be the biggest worldwide device failure in consumer electronics history, tens of thousands of owners of Microsoft&#8217;s Zune turned on the music player Wednesday morning only to discover it was the day the music died. By early [...]]]></description>
			<content:encoded><![CDATA[<p>On new year eve, All Microsoft Zune players freezed, becoming totally unresponsive and practically useless.</p>
<blockquote><p>&#8220;In what appears to be the biggest worldwide device failure in consumer electronics history, tens of thousands of owners of Microsoft&#8217;s Zune turned on the music player Wednesday morning only to discover it was the day the music died. By early afternoon, Microsoft released a statement saying the problem, which affected the original 30-gigabyte model of the Zune that first went on sale in September 2006, was solved. The issue: a bug in the way the gadget&#8217;s internal clock handles a leap year.&#8221;</p></blockquote>
<p>The problem was in a small part of code in Zune&#8217;s clock driver which resulted in Zune looping forever.</p>
<p><strong>Zune Failing : </strong><br />
<a href="http://gizmodo.com/5121311/reports-30gb-zunes-failing-everywhere-all-at-once">http://gizmodo.com/5121311/reports-30gb-zunes-failing-everywhere-all-at-once</a><br />
<a href="http://www.mercurynews.com/ci_11345379"> http://www.mercurynews.com/ci_11345379</a></p>
<p><strong>Cause : </strong>(<a href="http://www.zuneboards.com/forums/zune-news/38143-cause-zune-30-leapyear-problem-isolated.html">Zune bug explained here </a>)<br />
Bug in code ( Not taking leap year into account properly, seems simple ?)</p>
<p>Part of a function :</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<div>
<pre>
<code>
while (days > 365)
{
    if (IsLeapYear(year))
    {
        if (days > 366)
        {
            days -= 366;
            year += 1;
        }
    }
    else
    {
        days -= 365;
        year += 1;
    }
}
</code>
</pre>
</div>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p><strong>Bugs:</strong></p>
<p>1) It should be days==366 or days&gt;=366<br />
2) No else condition mentioned for nested if. (Should have been there specially when if is inside a while loop )</p>
<p><strong>Now Zune will keep looping forever.</strong> <a href="http://www.zuneboards.com/forums/zune-news/38143-cause-zune-30-leapyear-problem-isolated.html">Zune bug explained here </a></p>
<p><strong>Microsoft response :</strong> <a href="http://www.zune.net/en-us/support/zune30.htm">http://www.zune.net/en-us/support/zune30.htm</a><br />
This is big reputational risk for Microsoft&#8217;s Zune, when it trying hard to stand against Apple&#8217;s Ipod.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2009/01/zune-bug-explained.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google treasure hunt (Second puzzle)</title>
		<link>http://www.aburad.com/blog/2008/05/google-treasure-hunt-second-puzzzle.html</link>
		<comments>http://www.aburad.com/blog/2008/05/google-treasure-hunt-second-puzzzle.html#comments</comments>
		<pubDate>Mon, 19 May 2008 18:34:16 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[puzzle]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=244</guid>
		<description><![CDATA[Its about time (936266827 seconds before Y2K38) i.e 19may2008 17:07:58 (UTC) and the second puzzle is live (Check it out).   You can still try the first question here. Second puzzle from google treasure hunt is to calculate
Sum of line n for all files with path or name containing pattern and ending in particular [...]]]></description>
			<content:encoded><![CDATA[<p>Its about time (<a href="http://googleblog.blogspot.com/2008/05/google-treasure-hunt-update.html">936266827 seconds before Y2K38</a>) i.e 19may2008 17:07:58 (UTC) and the <a href="http://treasurehunt.appspot.com/">second puzzle is live (Check it out)</a>.   You can still try the <a href="http://treasurehunt.appspot.com/historic/robot/">first question here</a>. Second puzzle from <a href="http://google-au.blogspot.com/2008/05/google-treasure-hunt.html">google treasure hunt</a> is to calculate</p>
<blockquote><p>Sum of line <strong>n</strong> for all files with path or name containing pattern and ending in particular extension. Similarly Sum of line <strong>m</strong> for all files with some pattern.<br />
Hint: If the requested line does not exist, do not increment the sum.<br />
Multiply all the above sums together and enter the product below.</p></blockquote>
<p>for a given set of files contained in a zip archive. I have already submitted my answer <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  , but this time I will have to wait for 24hrs to check the status of my answer <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />  . I thinks its a good puzzle to test your quick shell script abilities. (Can also be done easily in perl/python). </p>
<p>For the solution part, I wont give the actual solution (As dont want it to spoil for others who are actually trying) but you can use shell commands [grep, find ,sed and pipe (|)] to get to solution. You can get all the required numbers  in 2 lines on shell.</p>
<p>Related Post:<br />
<a href="http://aburad.com/blog/2008/05/google-treaure-hunt.html">Google Treasure Hunt</a><br />
<a href="http://aburad.com/blog/2007/04/orios-riddle-completed.html">Orio&#8217;s Riddle Completed</a><br />
<a href="http://aburad.com/blog/2007/02/twisty-puzzles.html">Twisty Puzzles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/05/google-treasure-hunt-second-puzzzle.html/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Google treaure hunt</title>
		<link>http://www.aburad.com/blog/2008/05/google-treaure-hunt.html</link>
		<comments>http://www.aburad.com/blog/2008/05/google-treaure-hunt.html#comments</comments>
		<pubDate>Sun, 18 May 2008 19:26:01 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[puzzle]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=242</guid>
		<description><![CDATA[The Google Engineering team is launching its first ever Treasure Hunt, a contest designed to challenge your problem-solving skills.
Find more details at Google Australia blog here
They will be releasing first four puzzles in the next consecutive four weeks, one is alread released.
To get the URL of the contest you have to decode:
aHR0cDovL3RyZWFzdXJlaHVudC5hcHBzcG90LmNvbS8=
And yeah,   [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p>The Google Engineering team is launching its first ever Treasure Hunt, a contest designed to challenge your problem-solving skills.</p></blockquote>
<p>Find <a href="http://google-au.blogspot.com/2008/05/google-treasure-hunt.html">more details at Google Australia blog here</a><br />
They will be releasing first four puzzles in the next consecutive four weeks, one is alread released.<br />
To get the URL of the contest you have to decode:</p>
<blockquote><p>aHR0cDovL3RyZWFzdXJlaHVudC5hcHBzcG90LmNvbS8=</p></blockquote>
<p>And yeah, <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I was able to that do that. I&#8217;ll tell you the answer its <a href="http://treasurehunt.appspot.com/">http://treasurehunt.appspot.com/</a>, as its already on <a href="http://googleblog.blogspot.com/2008/05/google-treasure-hunt-update.html">Google Blog</a><br />
Actually its the <a href="http://en.wikipedia.org/wiki/Base64">base64</a> <a href="http://makcoder.sourceforge.net/demo/base64.php">decode of the given code.</a></p>
<p>You can find the  <a href="http://treasurehunt.appspot.com/">first puzzle here</a>.</p>
<blockquote><p>A robot is located at the top-left corner of a 34 x 49 grid.<br />
The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid. How many possible unique paths are there?</p></blockquote>
<p>I have solved this one. Give it a try, its not that difficult. Any way I&#8217;m there to help <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Here is the solution to the problem :<br />
The number of paths for n x m grid (n-1 down blocks and m-1 right blocks) is equal to number of ways of arranging n-1 D&#8217;s (Down move) and m-1 R&#8217;s (Right move). So it&#8217;s</p>
<blockquote><p>(n-1+m-1)! / ((n-1)! * (m-1)!)</p></blockquote>
<p>You can calculate it using calculator in Windows/Linux.<br />
I&#8217;m waiting for the next to come.</p>
<blockquote><p>The second puzzle will be appearing soon — to be exact, 936266827 seconds before Y2K38,</p></blockquote>
<p><strong>Update:</strong></p>
<p>Unix internal time is commonly stored in a data structure using a long int containing the number of seconds since 1970. This time is used in all time-related processes such as scheduling, file timestamps, etc. In a 32-bit machine, this value is sufficient to store time up to 18-jan-2038. After this date, 32-bit clocks will overflow and return erroneous values such as 32-dec-1969 or 13-dec-1901. <a href="http://vancouver-webpages.com/time/Y2K38.html">Read More about Y2K38</a>.<br />
<a href="http://en.wikipedia.org/wiki/Year_2038_problem"></a></p>
<p><a href="http://en.wikipedia.org/wiki/Year_2038_problem">According to wikipedia </a> The latest time that can be represented in this format, following the POSIX standard, <strong>is 03:14:07 UTC on Tuesday, January 19, 2038</strong>. So when you calculate specified 936266827 seconds before that next puzzle should come around <strong>19may2008 17:07:58 (The puzzle is alread there)(UTC) </strong>.</p>
<p>I have removed exact timing for you to get it on your own.(or is it still there ..haha ). And still if you need it, you can request in comments.<br />
I calculated it using <a href="http://www.stata.com/">stata</a>. You can easily calculate this in two lines in python:</p>
<blockquote><p><em> &gt;&gt;&gt; import time<br />
&gt;&gt;&gt; print time.ctime(2**31 &#8211; 1 &#8211; 936266827)<br />
</em></p></blockquote>
<p><strong></strong>Related Post:<br />
<a href="http://aburad.com/blog/2007/04/orios-riddle-completed.html">Orio&#8217;s Riddle Completed</a><br />
<a href="http://aburad.com/blog/2007/02/twisty-puzzles.html">Twisty Puzzles</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/05/google-treaure-hunt.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>View page source trick in firefox, flock</title>
		<link>http://www.aburad.com/blog/2008/04/view-page-source-trick-in-firefox-flock.html</link>
		<comments>http://www.aburad.com/blog/2008/04/view-page-source-trick-in-firefox-flock.html#comments</comments>
		<pubDate>Tue, 15 Apr 2008 18:07:39 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/2008/04/15/view-page-source-trick-in-firefox-flock/</guid>
		<description><![CDATA[You may have read about firefox&#8217;s special about: pages like about:config, about:cache etc. Or you can go through Firefox about: pages to have an idea about them. There is one similar functionality in firefox which allows you to view page source of a page. You can type

view-source:http://www.google.com/ 
this in location bar to view page source [...]]]></description>
			<content:encoded><![CDATA[<p>You may have read about firefox&#8217;s special <span style="font-style: italic">about: </span>pages like <span style="font-style: italic">about:config, about:cache</span> etc. Or you can go through <a href="http://aburad.com/blog/2007/01/firefox-about-pages.html">Firefox about: pages</a> to have an idea about them. There is one similar functionality in firefox which allows you to view page source of a page. You can type<br />
<a style="font-weight: bold" href="view-source://http//www.google.com/"></a></p>
<blockquote><p><a style="font-weight: bold" href="view-source://http//www.google.com/">view-source:http://www.google.com/ </a></p></blockquote>
<p>this in location bar to view page source of google.com.<br />
So i have made this Bookmarklet to view page source: <a href="javascript:window.open('view-source:'+top.location)=0;">View Source</a> (So you can drag this to your bookmark toolbar to have quick access).</p>
<p>Similarly you can type<span style="font-weight: bold"> </span><a style="font-weight: bold" href="javascript:">javascript:</a> in your location bar to open java script error console.</p>
<p>Update1:<br />
Key Board Shortcut: Use Ctrl+U to view page source</p>
<p>Related Post:<br />
<a href="http://aburad.com/blog/2007/01/firefox-about-pages.html">Firefox About Pages</a><br />
<a href="http://aburad.com/blog/2006/03/little-tweaks-with-javascript-bookmarklets.html">Little tweaks with javascript : Bookmarklets.</a><br />
<a href="http://aburad.com/blog/2007/04/open-webpages-in-sidebar.html">Open webpages in sidebar</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/04/view-page-source-trick-in-firefox-flock.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Cross-site Scripting (XSS)</title>
		<link>http://www.aburad.com/blog/2008/04/cross-site-scripting-xss.html</link>
		<comments>http://www.aburad.com/blog/2008/04/cross-site-scripting-xss.html#comments</comments>
		<pubDate>Tue, 15 Apr 2008 17:58:39 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Cross-site]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/2008/04/15/cross-site-scripting-xss/</guid>
		<description><![CDATA[Two days back, my shoutbox was hacked  . I was not aware that people are actually visiting this, which I made long back to have similar thing for Ethos in june, 2005. After that i haven&#8217;t updated the code and many things were left in between.
What actually happened:  Cross Site Scripting, when we [...]]]></description>
			<content:encoded><![CDATA[<p>Two days back, my <a href="http://aburad.com/shoutbox/">shoutbox</a> was hacked <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . I was not aware that people are actually visiting this, which I made<a href="http://aburad.com/blog/2005/06/shout-box-2.html"> long back to have similar thing for Ethos</a> in june, 2005. After that i haven&#8217;t updated the code and many things were left in between.</p>
<p><span style="font-style: italic; font-weight: bold;">What actually happened</span>:  Cross Site Scripting, when we want user to input some data (which may be html/javascript) and displays it back. So if html/script tags are not properly checked it can cause trouble. Earlier I hadn&#8217;t checked for javascript, iframe inputs. So somebody just inserted an iframe as message input in my shout box. And the source of iframe contained redirection to another website. So when shouts were displayed on the page the iframe code was displayed as it is and page got redirected to other page.</p>
<p>Luckily I checked the page just after the day this happened, So that way i actually got chance to update this orphaned code and made some fixes.</p>
<p><span style="font-weight: bold; font-style: italic;">Solution :</span> Idea is to filter meta characters such as (&lt; , &gt;, &#8216; , &#8221; etc) Which will prevent browser from processing them as part of some script, they will be processed as plain text only.<br />
So while doing in php you can do:</p>
<p><code>$shout=str_replace("&lt;","&lt;",$_GET["shout"]);</code></p>
<p>And to be on safer side we should also replace following characters:<br />
<code><br />
replace   (       with    (<br />
replace   )       with    )<br />
replace &amp;  with    &amp;<br />
replace   '        with    '<br />
replace   "        with    "<br />
</code><br />
Or If you are not expecting user to input these characters then you can simply replace these with null string;</p>
<p>Update: (25-apr-2008)<br />
You can also use php functions <a href="http://ch2.php.net/manual/en/function.htmlspecialchars.php">htmlspecialchars</a>, <a href="http://ch2.php.net/htmlentities">htmlentities</a>, <a href="http://ch2.php.net/manual/en/function.strip-tags.php">strip_tags</a>.</p>
<p>The replacements which I have mentioned above can be easily done using <a href="http://ch2.php.net/manual/en/function.htmlspecialchars.php">htmlspecialchars</a> but if you want to extend it to all html tags then you can use <a href="http://ch2.php.net/htmlentities">htmlentities</a>. And to strip both html and php tags from string you can use <a href="http://ch2.php.net/manual/en/function.strip-tags.php">strip_tags</a>. The disadvantage with strip_tags is that it doesn&#8217;t validate html so can cause trouble in case of broken html tags. It also provide you option to exclude list of tags from being stripped.</p>
<p>So now you can enjoy <a href="http://aburad.com/shoutbox/">Shout Box</a> until some new bug is found or its hacked again [;)]</p>
<p>Related post:<br />
<a href="http://aburad.com/blog/2006/03/sql-attacks-hacking.html">SQL Attacks: Hacking</a> (SQL injection)</p>
<p>Update(14th May 2008): <a href="http://ha.ckers.org/xss.html">XSS cheatsheet by ha.ckers.org</a> lists possible cross site scripting methods on various browsers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/04/cross-site-scripting-xss.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adobe AIR: Web to Desktop</title>
		<link>http://www.aburad.com/blog/2008/02/adobe-air-web-to-desktop.html</link>
		<comments>http://www.aburad.com/blog/2008/02/adobe-air-web-to-desktop.html#comments</comments>
		<pubDate>Tue, 19 Feb 2008 21:28:44 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[webdev]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[rubik]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=212</guid>
		<description><![CDATA[Past few days, I have came across Adobe AIR through digg, techmeme, delicious and so today i thought i should try this. Adobe AIR lets us their existing web development skills in HTML, AJAX, Flash and Flex to build and deploy rich Internet applications to the desktop. For Application development you will need two things:

Adobe [...]]]></description>
			<content:encoded><![CDATA[<p>Past few days, I have came across Adobe AIR through digg, techmeme, delicious and so today i thought i should try this. Adobe AIR lets us their existing web development skills in HTML, AJAX, Flash and Flex to build and deploy rich Internet applications to the desktop. For Application development you will need two things:</p>
<ul>
<li><a href="http://labs.adobe.com/downloads/air.html" title="Adobe AIR Runtime">Adobe AIR Runtime</a> : Necessary for running AIR applications. (For windows &amp; mac)</li>
<li><a href="http://labs.adobe.com/downloads/airsdk.html" title="AIR_SDK">AIR_SDK</a> Provide necessary libraries to build AIR application</li>
</ul>
<p>Having <a href="http://labs.adobe.com/wiki/index.php/AIR:Dreamweaver_CS3_Extension">Adobe AIR extension for Dreamweaver CS3</a> can be very helpful as it facilitates to package and preview .air application files directly within Adobe Dreamweaver CS3.</p>
<p>As my first AIR application, I ported my <a href="http://www.aburad.com/cubing/timer.html" title="Rubik Cube Timer">rubiks cube timer</a> as a desktop application (<a href="http://www.aburad.com/cubing/RubikTimer.air" title="RubikTimer">RubikTimer.air</a>). Its very easy using dreamweaver extension, have a look here : <a href="http://livedocs.adobe.com/labs/air/1/devappshtml/help.html?content=HTMLHelloWorld_1.html">Create your first HTML-based AIR application with the AIR SDK </a>(great tutorial for beginners).</p>
<p>One problem I faced: Usually <em>setInterval(&#8220;display()&#8221;,500)</em> works with Firefox/IE but it was not starting with no error message to look into but then i found out about using Adobe CommandLine tool. (via <a href="http://www.blog.mediaprojekte.de/tutorials/three-ways-to-debug-an-adobe-air-javascript-application/">Three ways to debug Adobe javascript Application</a>). It´s called ADL and resides in the /bin folder of the SDK. ADL showed the Error: &#8220;Unsafe javascript&#8221;. Then after some random changes when i change it to <em>&#8220;setInterval(display,500)&#8221;</em>, It started working. Another problem I faced was related to <em>keypress events in javascript</em>, were not working with AIR (still have to resolve this issue)</p>
<p>Download <a href="http://www.aburad.com/cubing/RubikTimer.air">RubikTimer.air here</a><br />
Web Based <a href="http://www.aburad.com/cubing/timer.html">Rubik Cube Timer</a></p>
<p>Related Post:</p>
<p><a href="http://labs.adobe.com/technologies/air/samples/">Sample Adobe AIR Applications</a><a rel="bookmark" href="http://aburad.com/blog/2008/02/trying-hands-on-google-gadgets.html" title="Permanent Link to Trying hands on Google gadgets"><br />
Trying hands on Google gadgets</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2008/02/adobe-air-web-to-desktop.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Paint Online</title>
		<link>http://www.aburad.com/blog/2007/04/paint-online.html</link>
		<comments>http://www.aburad.com/blog/2007/04/paint-online.html#comments</comments>
		<pubDate>Wed, 18 Apr 2007 16:33:00 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[listing]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Online Paint Brush]]></category>
		<category><![CDATA[paint]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=200</guid>
		<description><![CDATA[These days i&#8217;m getting so many websites which allows you to draw online..here is a list of some
Flash Based:

Imagination Cubed
Wetpaint Please Touch &#8211; Create Your Own Masterpiece!
Artpad
FlashPaint
Sketchr (also available at http://www.queeky.com)
Scratchpad
Online Paint Brush

HTML &#60; canvas &#62; Based:

Paint Chat [designed by me  ]
Canvas Painter
Canvas Paint (resembles to MS paint)

Java Based:

Drawing Online
ZEwall: Online Painting
JPainter : Online [...]]]></description>
			<content:encoded><![CDATA[<p>These days i&#8217;m getting so many websites which allows you to draw online..here is a list of some<br />
<span style="font-style: italic">Flash Based:</span></p>
<ul>
<li><a href="http://imaginationcubed.com/LaunchPage">Imagination Cubed</a></li>
<li><a href="http://www.wetpaintpleasetouch.com/">Wetpaint Please Touch &#8211; Create Your Own Masterpiece!</a></li>
<li><a href="http://artpad.art.com/artpad/painter/">Artpad</a></li>
<li><a href="http://www.flashpaint.com/">FlashPaint</a></li>
<li><a href="http://www.sketchr.net/">Sketchr</a> (also available at <a href="http://www.queeky.com/" class="user">http://www.queeky.com)</a></li>
<li><a href="http://web.okaygo.co.uk/apps/scratchpad/flashcom/">Scratchpad</a></li>
<li><a href="http://www.ababasoft.com/how_to_draw/paint_brush_mi.html">Online Paint Brush</a></li>
</ul>
<p><span style="font-style: italic">HTML &lt; canvas &gt; Based:</span></p>
<ul>
<li><a href="http://www.aburad.com/paintchat/paint_chat.php">Paint Chat</a> [designed by me <img src='http://www.aburad.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ]</li>
<li><a href="http://caimansys.com/painter/">Canvas Painter</a></li>
<li><a href="http://canvaspaint.org/">Canvas Paint</a> (resembles to MS paint)</li>
</ul>
<p><span style="font-style: italic">Java Based:</span></p>
<ul>
<li><a href="http://www.billybear4kids.com/Learn2Draw/PaintProgram/drawing.htm">Drawing Online</a></li>
<li><a href="http://www.zewall.com/index.htm">ZEwall: Online Painting</a></li>
<li><a href="http://www.izhuk.com/painter/">JPainter : Online image editor</a></li>
</ul>
<p>Related Post :<br />
<a href="http://aburad.com/blog/2007/02/paint-chat.html">Paint Chat !!</a><br />
<a href="http://aburad.com/blog/2006/03/web20-applications.html">Web2.0 Applications</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2007/04/paint-online.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SQL Attacks : Hacking</title>
		<link>http://www.aburad.com/blog/2006/03/sql-attacks-hacking.html</link>
		<comments>http://www.aburad.com/blog/2006/03/sql-attacks-hacking.html#comments</comments>
		<pubDate>Sat, 04 Mar 2006 21:42:00 +0000</pubDate>
		<dc:creator>burad</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[xkcd]]></category>

		<guid isPermaLink="false">http://aburad.com/blog/?p=50</guid>
		<description><![CDATA[Yesterday I was participating an hacking competetion in which at one stage I had login on a page and after that can get to next level . When at first i randomly typed any password. then it gave an sql error that &#8221; zero row selected&#8221; and incorrect password. So I thought of using SQL [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I was participating an hacking competetion in which at one stage I had login on a page and after that can get to next level . When at first i randomly typed any password. then it gave an sql error that &#8221; zero row selected&#8221; and incorrect password. So I thought of using <span style="font-style: italic;">SQL string injection</span> . SQL is poor in security issues surrounding is the login and url strings. So idea is you give these values in login form :<br />
user : &#8216; OR 1=1&#8211;<br />
password : &#8216; OR 1=1&#8211;</p>
<p>and voila you are in. the other possible strings for password are :</p>
<ul>
<li><span style="font-style: italic;"> &#8216; OR a=a&#8211;</span></li>
<li><span style="font-style: italic;"> &#8216; or 0=0 #</span></li>
<li><span style="font-style: italic;"> &#8220;) or (&#8220;a&#8221;=&#8221;a</span></li>
<li><span style="font-style: italic;"> &#8216;) or (&#8216;a&#8217;='a</span></li>
</ul>
<p>A funny comic strip from xkcd illustrating  sql injection.<a href="http://xkcd.com/327/"><br />
<img src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png" alt="xkcd" width="500" height="166" /></a></p>
<p>So whats the funda behind this :<br />
When you click &#8220;login&#8221; or &#8220;enter&#8221; on webpage the variables &#8216;userid&#8217; and &#8216;password&#8217;  are to sql. The underlying query is :</p>
<p><span style="font-style: italic;">SELECT * from auth_db where username = &#8216; $userid &#8216; AND password = &#8216;$password&#8217;</span></p>
<p>So if you have entered username = admin  and password = test123  then query executed will be :<br />
<span style="font-style: italic;">SELECT * from auth_db where username = &#8216; admin &#8216; AND password = &#8216;test123 &#8216;</span></p>
<p>So in auth_db , if userid and password are correct than corresponding row will be selected and as no of rows returned is &gt; 0 you will be granted access. But if password is incorrect than it will retun zero rows and permission won&#8217;t be granted. But if you use <span style="font-style: italic;">SQL string  injection </span>like if you put &#8216; OR 1=1&#8211; as password and username both than query executed will be :</p>
<p><span style="font-style: italic;">SELECT * from auth_db where username = &#8216; </span><span style="font-style: italic;">&#8216; OR 1=1&#8211;</span><span style="font-style: italic;"> &#8216; AND password = &#8221; OR 1=1&#8211; &#8216;</span></p>
<p>Because a pair of hyphens designate the beginning of a comment in SQL, the query becomes simply becomes :</p>
<p><span style="font-style: italic;">SELECT * from auth_db where username = &#8221; OR 1=1 </span></p>
<p>The expression 1=1 is always true for every row in the table, and a true expression or&#8217;d with another expression will always return true. So, assuming there&#8217;s at least one row in the Users table, this SQL will always return a nonzero count of records.So you are logged in now. And if in some cases But many times sql tries to parse = character in input strings and didn&#8217;t allow to do so, hence trick is using :<br />
&#8216; OR userid LIKE &#8216;%%</p>
<p>So resultant query will be</p>
<p><span style="font-style: italic;">SELECT * from auth_db where username = &#8216; </span>&#8216; OR userid LIKE &#8216;%% <span style="font-style: italic;">&#8216; AND password = &#8221; </span>OR userid LIKE &#8216;%% <span style="font-style: italic;">&#8216;</span><br />
So every string  matches &#8216;%%&#8217;  so it returns non zero number of and you are granted access.<br />
Not all SQL injection attacks involve forms authentication. All it takes is an application with some dynamically constructed SQL and untrusted user input. Most SQL-compliant databases, including SQL Server, store metadata in a series of system tables with the names sysobjects, syscolumns, sysindexes, and so on. This means that a hacker could use the system tables to ascertain schema information for a database to assist in the further compromise of the database. For example, the following text entered into the txtFilter textbox might be used to reveal the names of the user tables in the database:</p>
<pre class="clsCode" style="font-style: italic;">' UNION SELECT id, name, '', 0 FROM sysobjects WHERE xtype ='U' --</pre>
<p>The UNION statement in particular is useful to a hacker because it allows him to splice the results of one query onto another. In this case, the hacker has spliced the names of the user tables in the database to the original query of the Products table. The only trick is to match the number and datatypes of the columns to the original query. The previous query might reveal that a table named Users exists in the database. So after this with multiple queries you can get control over database.</p>
<p>Updated :<br />
Also visit <a href="http://spaces.msn.com/tamsun/Blog/cns%21549A39619D3FADA3%21488.entry">Ten hacker tricks to exploit SQL Server systems</a><br />
<a href="http://us2.php.net/mysql_real_escape_string">http://us2.php.net/mysql_real_escape_string</a><br />
<a href="http://www.unixwiz.net/techtips/sql-injection.html">http://www.unixwiz.net/techtips/sql-injection.html</a><br />
*******************************************************************************<br />
WARNING: the information provided is for educationally purposes only and not to be used for malicious use. i hold no responsibility<br />
********************************************************************************</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aburad.com/blog/2006/03/sql-attacks-hacking.html/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
