<?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>SKT Network Technologies</title>
	<atom:link href="http://www.sktnetwork.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sktnetwork.com</link>
	<description>Web Development with Fanatical Support</description>
	<lastBuildDate>Thu, 10 Nov 2011 05:21:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Creating Interactive Drill-Down Dashboards with PHP and FusionCharts</title>
		<link>http://www.sktnetwork.com/programming/creating-interactive-drill-down-dashboards-with-php-and-fusioncharts</link>
		<comments>http://www.sktnetwork.com/programming/creating-interactive-drill-down-dashboards-with-php-and-fusioncharts#comments</comments>
		<pubDate>Thu, 13 Jan 2011 07:30:26 +0000</pubDate>
		<dc:creator>Shamit Kumar Tomar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[fusioncharts]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://www.sktnetwork.com/?p=143</guid>
		<description><![CDATA[Shamit Kumar Tomar wrote a tutorial on FusionCharts how drill-down charts allow you to convert individual data plots of a chart into clickable hotspots (or links).]]></description>
			<content:encoded><![CDATA[<p>Recently, I wrote a tutorial for NetTutes+ about  making Drill-down dashboards in PHP using FusionCharts. Presenting data  in a graphical format always helps a lot in parsing  the data  efficiently. If the charts are interactive and linked, that’s  even  better.</p>
<p>Drill-down charts allow you to convert individual data   plots (columns in column chart, pie slices in pie chart etc) of a chart   into hotspots (or links).These items, when clicked, can open new charts  and you can navigate between these charts easily.</p>
<p><strong>Read the full tutorial on <a href="http://net.tutsplus.com/tutorials/php/learn-to-create-interactive-drill-down-dashboards-with-php-and-fusioncharts/" target="_blank">Creating Interactive Drill-Down Dashboards with PHP and FusionCharts</a> with demo link and downloadable files.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sktnetwork.com/programming/creating-interactive-drill-down-dashboards-with-php-and-fusioncharts/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>My 10 Biggest Fears as a Programmer</title>
		<link>http://www.sktnetwork.com/programming/my-10-biggest-fears-as-a-programmer</link>
		<comments>http://www.sktnetwork.com/programming/my-10-biggest-fears-as-a-programmer#comments</comments>
		<pubDate>Wed, 29 Dec 2010 05:30:34 +0000</pubDate>
		<dc:creator>Shamit Kumar Tomar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[thoughts]]></category>
		<category><![CDATA[fear]]></category>
		<category><![CDATA[programmer]]></category>

		<guid isPermaLink="false">http://www.sktnetwork.com/?p=140</guid>
		<description><![CDATA[Shamit Kumar Tomar lists and describes his biggest fears as a computer programmer. What he believes, scares him and his pursuit of happyness.]]></description>
			<content:encoded><![CDATA[<p>Everyone is scared of something. Living a life as a computer  programmer (or a coder, as some would say), I fear the most about the  following things (randomly ordered):</p>
<ol>
<li>One day, I will stop  liking my job (i.e. programming). I can imagine programming is the kind  of work that can be miserable if you don’t love it.</li>
<li>I may have to work on a language/environment that I dislike. (e.g. Java).</li>
<li>I  may end up in a job where I have to wear suit and a tie. Because I  believe that Neckties are simply punishment for wimping out and getting a  business degree.</li>
<li>I would end up working with another developer  who doesn’t actually know what they’re doing, but they believe their way  is the best way. And that developer is actually above me in the chain  of command, so I have to do things their way.</li>
<li>Data Loss. But then they say, you haven’t lived until you’ve dropped a production database.</li>
<li>Someone will steal my closed-source code.</li>
<li>My code may get posted on <a href="http://www.thedailywtf.com/" target="_blank">TheDailyWTF</a>.</li>
<li>Having no Internet. Someday the Internet as we know will cease to exist.</li>
<li>My significant other hates computer / programming / gadgets / me-in-front-of-a-computer.</li>
<li>Last but not the least, I will die alone.</li>
</ol>
<p>Thankfully I’ve not had any of these fears realized yet!</p>
<p>Of  these, the first is the biggest one. Imagine, getting bored of  everything about developing, programming, computers, Internet… I’m  afraid that, after investing so many year in programming (15 and  counting), we get to that age that, “Please… no more computers!” and  then I wonder what will I do.</p>
<p>Getting afraid that even though I  have the passion of developing and creating web business applications  (that’s what drives me), I’m getting sick of such new versions of  programming languages, new ways of doing it, new paradigms, it all come  too fast… I can’t know it all as I wanted. I’m exhaust of pursuing the  new technologies, takes time to be good at one, and when your good…  there are 5 more, 3 of them Upgrades! Hell! But then again… without  programming something… what else can I do?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sktnetwork.com/programming/my-10-biggest-fears-as-a-programmer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Donation To Wikileaks</title>
		<link>http://www.sktnetwork.com/thoughts/my-donation-to-wikileaks</link>
		<comments>http://www.sktnetwork.com/thoughts/my-donation-to-wikileaks#comments</comments>
		<pubDate>Sat, 04 Dec 2010 04:30:03 +0000</pubDate>
		<dc:creator>Shamit Kumar Tomar</dc:creator>
				<category><![CDATA[thoughts]]></category>
		<category><![CDATA[donation]]></category>
		<category><![CDATA[wikileaks]]></category>

		<guid isPermaLink="false">http://www.sktnetwork.com/?p=137</guid>
		<description><![CDATA[After much thought, I finally donated to Wikileaks for what they did by releasing Iraq War Logs and US Embassy Cable leaks. Whatever Julian Assange (showrunner of Wikileaks) is doing is tremendous and takes a lot of courage to do. And this is my little something for the guy. I hope it helps him. For [...]]]></description>
			<content:encoded><![CDATA[<p>After much thought, I finally donated to <a href="http://en.wikipedia.org/wiki/WikiLeaks">Wikileaks</a> for what they did by releasing <a href="http://www.diarydig.org/">Iraq War Logs</a> and <a href="http://213.251.145.96/cablegate.html">US Embassy Cable leaks</a>. Whatever <a href="http://en.wikipedia.org/wiki/Julian_Assange">Julian Assange</a> (showrunner of Wikileaks) is doing is tremendous and takes a lot of courage to do. And this is my little something for the guy. I hope it helps him.</p>
<p>For the uninitiated, WikiLeaks is an international non-profit media  organization that publishes submissions of otherwise unavailable  documents from anonymous news sources and leaks. And of course, the govt  is now after him. Read more about the <a href="http://en.wikipedia.org/wiki/United_States_diplomatic_cables_leak">Cable Leak at Wikipedia</a>.The United States diplomatic cables leak began on 28 November 2010 when the website WikiLeaks and five major newspapers published a cache of confidential documents of detailed correspondences between the U.S. State Department and its diplomatic missions around the world. This is effectively melting down the US Foreign Policy.</p>
<p><a href="http://www.sktnetwork.com/wp-content/uploads/2010/12/wikileaks-donation1.png"><img class="alignnone size-full wp-image-142" title="Shamit Kumar Tomar donation to Wikileaks" src="http://www.sktnetwork.com/wp-content/uploads/2010/12/wikileaks-donation1.png" alt="Shamit Kumar Tomar donation to Wikileaks" width="690" height="645" /></a><br />
.</p>
<p>The amount may be small but that’s what he has done from Indian perspective yet. Fair enough. And ya, something is better than nothing. So, for anyone reading this, <a href="http://213.251.145.96/support.html">please donate now</a>.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 543px; width: 1px; height: 1px; overflow: hidden;"><strong>WikiLeaks</strong> is an international <a class="mw-redirect" title="Non-profit" href="http://en.wikipedia.org/wiki/Non-profit">non-profit</a> <a title="New media" href="http://en.wikipedia.org/wiki/New_media">media organization</a> that publishes submissions of otherwise unavailable documents from anonymous <a title="Journalism sourcing" href="http://en.wikipedia.org/wiki/Journalism_sourcing">news sources</a> and <a title="News leak" href="http://en.wikipedia.org/wiki/News_leak">leaks</a>.</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sktnetwork.com/thoughts/my-donation-to-wikileaks/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Three Rules of Coding</title>
		<link>http://www.sktnetwork.com/programming/three-rules-of-coding</link>
		<comments>http://www.sktnetwork.com/programming/three-rules-of-coding#comments</comments>
		<pubDate>Sun, 14 Nov 2010 03:27:08 +0000</pubDate>
		<dc:creator>Shamit Kumar Tomar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[rules]]></category>
		<category><![CDATA[three]]></category>

		<guid isPermaLink="false">http://www.sktnetwork.com/?p=130</guid>
		<description><![CDATA[Shamit Kumar Tomar describes the rules of computer coding he believes.]]></description>
			<content:encoded><![CDATA[<p>Well, people say a lot about computer coding and often non-coders take it pretty lightly. However, after all the years into the programming, here&#8217;s the three rules of coding, I believe in:</p>
<ol>
<li>Programming is an Art.</li>
<li>A computer code will always do exactly what you tell it to.</li>
<li>Writing the code is the easy part. Writing it so someone else can understand it later is the important part. So, make it work, then make it elegant, then make it fast.</li>
</ol>
<p>The rules may appear different to different people and all of them may not agree but that&#8217;s just how I believe it and those are my two cents.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sktnetwork.com/programming/three-rules-of-coding/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Mysql_Real_Escape_String instead of AddSlashes</title>
		<link>http://www.sktnetwork.com/programming/using-mysql_real_escape_string-instead-of-addslashes</link>
		<comments>http://www.sktnetwork.com/programming/using-mysql_real_escape_string-instead-of-addslashes#comments</comments>
		<pubDate>Sun, 01 Aug 2010 19:42:24 +0000</pubDate>
		<dc:creator>Shamit Kumar Tomar</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://sktnetwork.local/?p=40</guid>
		<description><![CDATA[So you thought that using magic_quotes_gpc and addslashes() is enough. Thing again. In a nutshell, addslashes() is generally not good enough when dealing with multibyte encoded strings. The Problem In GBK, 0xbf27 is not a valid multi-byte character, but 0xbf5c is perfectly valid. If interpreted as single-byte characters, 0xbf27 is 0xbf (¿) followed by 0x27 ('), [...]]]></description>
			<content:encoded><![CDATA[<p>So you thought that using magic_quotes_gpc and addslashes() is enough. Thing again. In a nutshell, addslashes() is generally not good enough when dealing with multibyte encoded strings.</p>
<h2>The Problem</h2>
<p>In <a href="http://en.wikipedia.org/wiki/GBK">GBK</a>, <code>0xbf27</code> is not a valid multi-byte character, but <code>0xbf5c</code> is perfectly valid. If interpreted as single-byte characters, <code>0xbf27</code> is <code>0xbf</code> (<code>¿</code>) followed by <code>0x27</code> (<code>'</code>), and <code>0xbf5c</code> is <code>0xbf</code> (<code>¿</code>) followed by <code>0x5c</code> (<code></code>).</p>
<p>So what? Now, if someone wants to attempt an SQL injection attack against a MySQL database, having single quotes escaped with a backslash is a bummer. If you&#8217;re using <code>addslashes()</code>, however, he&#8217;s in luck. All he need to do is inject something like <code>0xbf27</code>, and <code>addslashes()</code> modifies this to become <code>0xbf5c27</code>, a valid multi-byte character followed by a single quote. In other words, he can successfully inject a single quote despite the escaping. That&#8217;s because <code>0xbf5c</code> is interpreted as a single character, and not two. Oops, there goes the backslash.</p>
<h2>The Demonstration</h2>
<p>To demonstrate, I&#8217;m going to use <a href="http://dev.mysql.com/downloads/mysql/5.0.html">MySQL 5.0</a> and PHP&#8217;s <a href="http://php.net/mysqli">mysqli</a> extension. If you want to try this yourself, make sure you&#8217;re using GBK. I just changed <code>/etc/my.cnf</code>, but that&#8217;s because I&#8217;m testing locally:</p>
<pre class="brush: plain; title: ; notranslate">
[client]
default-character-set=GBK
</pre>
<p>Create a table called <code>users</code>:</p>
<pre class="brush: sql; title: ; notranslate">
CREATE TABLE users (
 username VARCHAR(32) CHARACTER SET GBK,
 password VARCHAR(32) CHARACTER SET GBK,
 PRIMARY KEY (username)
);
</pre>
<p>The following script mimics a situation where only <code>addslashes()</code> (or <code>magic_quotes_gpc</code>) is used to escape the data being used in a query:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php

$mysql = array();

$db = mysqli_init();
$db-&gt;real_connect('localhost', 'myuser', 'mypass', 'mydb');

/* SQL Injection Example */
$_POST['username'] = chr(0xbf) .
 chr(0x27) .
 ' OR username = username /*';
$_POST['password'] = 'guess';

$mysql['username'] = addslashes($_POST['username']);
$mysql['password'] = addslashes($_POST['password']);

$sql = &quot;SELECT *
 FROM   users
 WHERE  username = '{$mysql['username']}'
 AND    password = '{$mysql['password']}'&quot;;

$result = $db-&gt;query($sql);

if ($result-&gt;num_rows) {
 /* Success */
} else {
 /* Failure */
}

?&gt;
</pre>
<p>So, despite the use of <code>addslashes()</code>, one can log in successfully without knowing a valid username or password. He can simply exploit the SQL injection vulnerability.</p>
<p>This type of attack is possible with any character encoding where there is a valid multi-byte character that ends in <code>0x5c</code>, because <code>addslashes()</code> can be tricked into creating a valid multi-byte character instead of escaping the single quote that follows. UTF-8 does not fit this description.</p>
<h2>The Solution</h2>
<p>So what can you do? The solution is to use <code>mysql_real_escape_string()</code>, or use <a href="http://www.zend.com/php5/articles/php5-mysqli.php#Heading11">prepared statements</a>, which are supported by nearly all PHP database extensions with the notable exceptions of MySQL (ext/mysql) and SQLite2 (ext/sqlite). So, to be on the safe side, I&#8217;d recommend using the PDO interface to talks with those databases or in the case of MySQL using the newer MySQLi (ext/mysqli) extension. Those interfaces provide prepared statement support, which allows for separation between query structure and the query parameters.</p>
<p>It should be noted that while PDO does emulated prepared statements for older versions of MySQL that do not support them natively, emulation is still prone to the same kind of issues demonstrated. Therefore for security reasons you should definitely consider upgrading to a more modern version of MySQL and SQLite (SQLite 3).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sktnetwork.com/programming/using-mysql_real_escape_string-instead-of-addslashes/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

