<?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>CertPal &#187; General</title>
	<atom:link href="http://www.certpal.com/blogs/category/general/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.certpal.com/blogs</link>
	<description>Technology and certifications</description>
	<lastBuildDate>Mon, 18 Jul 2011 06:48:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Finding text similarities with fuzzy hashes &#8211; Duplicate code for example</title>
		<link>http://www.certpal.com/blogs/2011/04/finding-text-similarities-with-fuzzy-hashes-duplicate-code-for-example/</link>
		<comments>http://www.certpal.com/blogs/2011/04/finding-text-similarities-with-fuzzy-hashes-duplicate-code-for-example/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 10:57:18 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[fuzzy]]></category>
		<category><![CDATA[hash]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=1028</guid>
		<description><![CDATA[Fuzzy hashes can be applied to identifying spam / find duplicate code / determining malicious requests. A short excerpt on the concept is presented here]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2011%2F04%2Ffinding-text-similarities-with-fuzzy-hashes-duplicate-code-for-example%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2011%2F04%2Ffinding-text-similarities-with-fuzzy-hashes-duplicate-code-for-example%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>How would an email server go about identifying spam email ? The problem is an interesting one. The challenges towards identifying spam are&#8230;</p>
<p>1. Scaling any solution to thousands of emails<br />
2. Identifying spam even when there are small changes to the spam content<br />
3. Reducing false positives</p>
<p>One solution could be to identify a hash for the spam message and compare the hash with the hash of a new message. The problem with this approach is that minute changes in a message can result in a different hash. A fuzzy hash (<a href="http://www.forensicswiki.org/wiki/Context_Triggered_Piecewise_Hashing" target="_blank">Context triggered piecewise hash (CTPH)</a>)  solves this by calculating hashes based on a trigger point in the text. Hash values are calculated for pieces of the text, delimited by a trigger. For example the trigger for the following text could be &#8216;a&#8217; and &#8216;or&#8217;</p>
<blockquote><p><span style="color: #ff00ff;"><strong><span style="color: #0000ff;">why would </span><span style="color: #000000;"><span style="text-decoration: underline;">a</span></span> lazy sunday be greeted with sleep. </strong></span><strong><span style="text-decoration: underline;">or</span></strong> <span style="color: #800080;"><strong>was I wrong? You were not sleeping ?</strong></span></p></blockquote>
<p>Here are the MD5 sums for this text, split by the delimiters / triggers</p>
<p><span style="color: #800080;"><strong><span style="color: #0000ff;">why would = 3cbca4bc4bba85fd54f384867ff4fd3e</span></strong></span></p>
<p><span style="color: #800080;"><strong><strong><span style="color: #ff00ff;"> lazy sunday be greeted with sleep. = e007174b7ef850ccc4b68ae1db98d1fe</span></strong></strong></span></p>
<p><span style="color: #800080;"><strong><strong><strong>was I wrong? You were not sleeping ? = 17d36b21dc2dfe530ea677075519a265</strong></strong></strong></span></p>
<p><span style="color: #800080;"><span style="font-weight: 900;"><br />
</span></span></p>
<p>Summing up these hashes gives a final hash. If this text were considered spam, and minor changes occur to the spam, the individual hashes can be compared to arrive at a &#8216;match score&#8217;.</p>
<blockquote><p><span style="color: #ff00ff;"><strong><span style="color: #0000ff;">why would </span><span style="color: #000000;"><span style="text-decoration: underline;">a</span></span> lazy sunday be greeted with sleep. </strong></span><strong><span style="text-decoration: underline;">or</span></strong> <span style="color: #800080;"><strong><span style="color: #ff6600;">was I wrong? You were not sleeping ? Did you get the jIAgra pills I sent ?</span></strong></span></p></blockquote>
<p><span style="color: #800080;"><strong><span style="color: #0000ff;">why would = 3cbca4bc4bba85fd54f384867ff4fd3e</span></strong></span></p>
<p><span style="color: #800080;"><strong><strong><span style="color: #ff00ff;"> lazy sunday be greeted with sleep. = e007174b7ef850ccc4b68ae1db98d1fe</span></strong></strong></span></p>
<p><span style="color: #800080;"><strong><strong><strong><span style="color: #ff6600;"> was I wrong? You were not sleeping ? Did you get the jIAgra pills I sent ? = 556ce7bf1c804330863e4d39755d5c58</span></strong></strong></strong></span></p>
<p>Only one of the hashes has changed. This would give a good score. The <a href="http://ssdeep.sourceforge.net/" target="_blank">ssdeep</a> library calculates fuzzy hashes for you. Comparing similar spam messages is like comparing similar source code. Developers love to copy one piece of code from Project A and paste it into Project B. Eclipse plugins like &#8216;Google code pro analytix&#8217; try to track similar code. I am not aware if the plugin uses fuzzy hashes to make this comparison, but it is a possibility.</p>
<p>The fuzzy hash concept can be be extended to solve other problems</p>
<ul>
<li>A DDOS tool issues the same type of request across different clients. If a fuzzy hash is applied to one request and it is identified as spam, the same can be done across all other requests. If the same request originates from the IP again, the fuzzy hash calculation is not necessary. Simply ban the IP for a few days.</li>
<li>Environments that are affected by a common problem probably log the same error message. A network timeout could affect say 5 servers. Comparing the error message likeness across the server logs can help determine the problem quicker</li>
<li>CTPH is also used in <a href="http://accessdata.com/downloads/media/Fuzzy_Hashing_for_Investigators.pdf" target="_blank">forensics</a>.</li>
</ul>
<p>The next time you encounter a problem that involves &#8216;text similarity&#8217; give fuzzy hashes a thought.</p>
<p><script type="text/javascript">// <![CDATA[
var dzone_url = 'http://www.certpal.com/blogs/2011/04/finding-text-similarities-with-fuzzy-hashes-duplicate-code-for-example/';
// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
var dzone_title = 'Finding text similarities with fuzzy hashes - Duplicate code for example';
// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
var dzone_blurb = 'Fuzzy hashes can be applied to identifying spam / find duplicate code / determining malicious requests. A short excerpt on the concept is presented here';
// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
var dzone_style = '2';
// ]]&gt;</script><br />
<script src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2011%2F04%2Ffinding-text-similarities-with-fuzzy-hashes-duplicate-code-for-example%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2011%2F04%2Ffinding-text-similarities-with-fuzzy-hashes-duplicate-code-for-example%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2011/04/finding-text-similarities-with-fuzzy-hashes-duplicate-code-for-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using greasemonkey to prototype your web UI</title>
		<link>http://www.certpal.com/blogs/2011/03/using-greasemonkey-to-prototype-your-web-ui/</link>
		<comments>http://www.certpal.com/blogs/2011/03/using-greasemonkey-to-prototype-your-web-ui/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 16:04:01 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[greasemonkey]]></category>
		<category><![CDATA[mock]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=1018</guid>
		<description><![CDATA[GreaseMoney differentiates itself in its ability to mock a live web UI. Never underestimate the impact of a mock feature on a live website. How an idea is presented to a person that might green-light it is pretty critical. ]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2011%2F03%2Fusing-greasemonkey-to-prototype-your-web-ui%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2011%2F03%2Fusing-greasemonkey-to-prototype-your-web-ui%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: center;"><a href="http://www.certpal.com/blogs/wp-content/uploads/grease_monkey.png"><img class="size-full wp-image-1019 aligncenter" title="grease_monkey" src="http://www.certpal.com/blogs/wp-content/uploads/grease_monkey.png" alt="" width="32" height="32" /></a></p>
<p>When mock-ups and screenshots fail to deliver the idea that you are trying to convey, a prototype can deliver a strong impact. But why should you prototype with <a href="http://en.wikipedia.org/wiki/Greasemonkey" target="_blank">GreaseMonkey</a> when you can check out code from source control and mock a web page with a few shabbily scribbled lines of javascript ?</p>
<p>I often find myself comparing GreaseMoney with the Netbeans swing builder for thick clients. Its great because you can deliver a quick UI without worrying about the underlying functionality. But where GreaseMoney differentiates itself is in its ability to mock a <strong>live</strong> web page. By live I mean one that is already deployed on production. Never underestimate the impact of mocking a feature on a live website. Changing the innerHTML of a few HTML elements and hacking out some JS can get you quick results.</p>
<p>How an idea is presented to a person that might green-light it is pretty critical.From my experience, here is how it usually plays out</p>
<table style="height: 82px;" width="547">
<tbody>
<tr>
<th style="text-align: center;">How you present your idea</th>
<th style="text-align: center;">Possible reaction</th>
</tr>
<tr>
<td style="text-align: left;">Prepare a slide deck / design document and email it</td>
<td style="text-align: left;">Sounds interesting. Lets try it sometime.</td>
</tr>
<tr>
<td style="text-align: left;">Mock the UI and send a link / jar</td>
<td style="text-align: left;">Pretty cool. Lets get this live by Mar this year</td>
</tr>
<tr>
<td style="text-align: left;">Screen scrap a live page and pretend to have implemented the feature</td>
<td style="text-align: left;"><strong><span style="color: #800080;">Holy cow !</span> </strong>We need that right now</td>
</tr>
</tbody>
</table>
<p>Of course, I am not trying to suggest that all ideas that you mock on a screen-scrapped live web site will kick off. An idea is great only when your potential users realize its significance and importance. The way you can get them excited about it, is to actually show them what it could look like. Once they are wowed, they will be eating out of your hand.</p>
<p>Be wary of the risk of getting folks too excited. Explain carefully that you are screen scrapping a page before you present it. The last thing you want is a customer thinking that you already implemented an idea <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>If you have never used GreaseMonkey before, the <a href="http://diveintogreasemonkey.org/helloworld/divein.html" target="_blank">hello world</a> tutorial is a great place to start. As you get your way around the simple stuff, you will eventually perform relatively complex operations like changing HTML content, setting timers, making ajax calls. Some of those steps will not work due to limitations in the way GreaseMonkey works. Which is when this <a href="http://wiki.greasespot.net/Avoid_Common_Pitfalls_in_Greasemonkey" target="_blank">common pitfalls</a> page will be of great help.</p>
<p>Good luck mocking your web page.</p>
<p><script type="text/javascript">var dzone_url = 'http://www.certpal.com/blogs/2011/03/using-greasemonkey-to-prototype-your-web-ui/';</script><br />
<script type="text/javascript">var dzone_title = 'Using greasemonkey to prototype your web UI';</script><br />
<script type="text/javascript">var dzone_blurb = 'GreaseMoney differentiates itself in its ability to mock a live web UI. Never underestimate the impact of a mock feature on a live website. How an idea is presented to a person that might green-light it is pretty critical. ';</script><br />
<script type="text/javascript">var dzone_style = '2';</script><br />
<script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2011%2F03%2Fusing-greasemonkey-to-prototype-your-web-ui%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2011%2F03%2Fusing-greasemonkey-to-prototype-your-web-ui%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2011/03/using-greasemonkey-to-prototype-your-web-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find open files in linux using lsof</title>
		<link>http://www.certpal.com/blogs/2010/12/find-open-files-in-linux-using-lsof/</link>
		<comments>http://www.certpal.com/blogs/2010/12/find-open-files-in-linux-using-lsof/#comments</comments>
		<pubDate>Wed, 29 Dec 2010 16:22:30 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[lsof]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=962</guid>
		<description><![CDATA[Use the lsof command to find open files that may occupy space despite being deleted. A small script shows you how to go about finding the top ten open files in the linux OS.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F12%2Ffind-open-files-in-linux-using-lsof%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F12%2Ffind-open-files-in-linux-using-lsof%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Deleting a file that has been opened by another process in linux does not free up disk space. Running the df or du commands will indicate conflicting results. Closing / killing the process that opened the files will release the space on the disk. The lsof command can help you track, say the top ten open files in your OS sorted by disk space. If you ever run into trouble with large open files, use the following command</p>
<p><strong>Top ten open files:</strong><br />
lsof / | awk &#8216;{if($7 &gt; 1048576) print $7/1048576 &#8220;MB&#8221; &#8221; &#8221; $9 }&#8217; | sort -n -u | tail</p>
<p><strong>Output:</strong></p>
<p>3.8054MB /usr/lib/libgtk-x11-2.0.so.0.2200.0<br />
4.28024MB /usr/share/icons/hicolor/icon-theme.cache<br />
8.17912MB /usr/lib/locale/locale-archive<br />
8.86022MB /var/lib/apt/lists/lk.archive.ubuntu.com_ubuntu_dists_maverick_main_binary-i386_Packages<br />
11.4047MB /usr/lib/flashplugin-installer/libflashplayer.so<br />
14.6893MB /usr/lib/firefox-3.6.10/libxul.so<br />
15.6504MB /var/cache/apt/pkgcache.bin<br />
27.4744MB /var/lib/apt/lists/lk.archive.ubuntu.com_ubuntu_dists_maverick_universe_binary-i386_Packages<br />
34.6615MB /usr/share/icons/gnome/icon-theme.cache<br />
44.1719MB /home/user/.mozilla/firefox/tnrqzpro.default/urlclassifier3.sqlite</p>
<p>You can also lookup <a href="http://www.cyberciti.biz/faq/howto-linux-get-list-of-open-files/" target="_self">open files based on pid / port number</a>. I hope the script saves you some time, should you ever find yourself in this situation.</p>
<p><script type="text/javascript">var dzone_url = 'http://www.certpal.com/blogs/2010/12/find-open-files-in-linux-using-lsof/';</script><br />
<script type="text/javascript">var dzone_title = 'Find the largest open files in linux using lsof';</script><br />
<script type="text/javascript">var dzone_blurb = 'Use the lsof command to find open files that may occupy space despite being deleted. A small script shows you how to go about finding the top ten open files';</script><br />
<script type="text/javascript">var dzone_style = '2';</script><br />
<script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F12%2Ffind-open-files-in-linux-using-lsof%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F12%2Ffind-open-files-in-linux-using-lsof%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/12/find-open-files-in-linux-using-lsof/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing ubuntu &#8211; An adventure</title>
		<link>http://www.certpal.com/blogs/2010/10/installing-ubuntu-an-adventure/</link>
		<comments>http://www.certpal.com/blogs/2010/10/installing-ubuntu-an-adventure/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 15:33:36 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=894</guid>
		<description><![CDATA[An article on the perils encountered during a linux installation. Most problems were not really linux's fault. Errors like 'Error 1: Filename must be either an absolute pathname or blocklist' were but other issues revolving around corrupted CDs and BIOS were more troubling.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F10%2Finstalling-ubuntu-an-adventure%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F10%2Finstalling-ubuntu-an-adventure%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.certpal.com/blogs/wp-content/uploads/ubuntu.png"><img class="alignright size-full wp-image-897" title="ubuntu" src="http://www.certpal.com/blogs/wp-content/uploads/ubuntu.png" alt="" width="118" height="27" /></a>Having switched to Suse linux a while back, I am enjoying the ride but for a few gripes. The UI does not load as smoothly as it should under certain circumstances. The keyboard also acts all crazy without warning. The new ubuntu release 10.10 is here, so I wanted to give that a shot hoping the experience would be better than what Suse had to offer. May be this was a KDE Vs Gnome problem. Perhaps 32 bit installations are less troublesome than the 64 bit ones. Well I wont know unless I try.</p>
<h2><strong>And it begins:</strong></h2>
<p>After downloading the Ubuntu ISO, I went about writing it to a CD and started the install process. The installation was riddled with error messages. Selecting partition X on hard disk 1, made the installer hate me. It complained saying &#8216;Either the hard disk or the CD has some sort of media related problem&#8217;. &#8216;hmmm&#8230; its probably the hard disk since there were no errors when the CD was written&#8217; I thought.</p>
<p>Selecting another partition fixed the problem. It was now time for GRUB, the bootloader to fail. For some unknown reason, GRUB failed to install correctly on any given partition. One of the installation choices allowed me to install a bootloader manually after the install process. So I ended up installing Ubuntu; booting to Suse linux; manually adding a menu selection into GRUB by selecting the appropriate partition. This also failed with GRUB spurting out the following message on boot &#8216;Error 1: Filename must be either an absolute pathname or blocklist&#8217;. Debugging this problem took forever. It turned out to be a missing parameter for the &#8216;configfile&#8217; command which caused the error. But no luck in the end. Ubuntu refused to load.</p>
<h2><strong>Media corruption:</strong></h2>
<p>It finally dawned on me that I should have checked the ISO hash with the one on the CD that was burned. The <a href="https://help.ubuntu.com/community/HowToMD5SUM" target="_blank">Ubuntu help page</a> on this is great ! And it turns out that the hash was different and the CD was corrupt. Firstly, I found it very hard to digest that this was even possible. May be because it had never happened before. Secondly, I never knew that <a href="http://www.pendrivelinux.com/" target="_blank">pen drive linux</a> was a very convenient solution for an error free bootable linux. I decided to take that route.</p>
<h2><strong><strong>Buggy BIOS:</strong></strong></h2>
<p>Fast forward a few minutes and I have my flash drive plugged in, ready to boot Ubuntu and reinstall. Now my computer hangs up and displays a black screen of&#8230;. err death ? The BIOS tells me that a USB ZIP drive has been recognized. Wait&#8230; what ? A zip drive ? I plugged in a flash drive. So may be the BIOS is buggy. I updated the BIOS and now&#8230; finally&#8230; I get to reinstall Ubuntu. The installation went through without a hitch.</p>
<p>Looking back on the experience I wonder if some of these hurdles prevent folks from adopting linux. Some are not really linux&#8217;s fault while others are. Corrupt CDs / Buggy BIOS / Use of technical language during the installation like &#8216;partitions&#8217; &#8216;mount&#8217; etc / bootloader configuration. Being someone that is technically inclined, I enjoy solving some of these interesting problems. To someone else, these are just annoyances. People just want to get things done. I can understand why even one of these problems could end up frustrating someone and make them give up.</p>
<p>Anyway, I hope the anecdote above saves someone a few hours. This was how I blew my Sunday <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><script type="text/javascript">var dzone_url = 'http://www.certpal.com/blogs/2010/10/installing-ubuntu-an-adventure/';</script><br />
<script type="text/javascript">var dzone_title = 'Installing ubuntu - An adventure';</script><br />
<script type="text/javascript">var dzone_blurb = 'An article on the perils encountered during a linux installation. Most problems were not really linux's fault. Corrupted CDs / Buggy BIOS were more troubling.';</script><br />
<script type="text/javascript">var dzone_style = '2';</script><br />
<script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F10%2Finstalling-ubuntu-an-adventure%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F10%2Finstalling-ubuntu-an-adventure%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/10/installing-ubuntu-an-adventure/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Crypt DES and 8 character truncated passwords</title>
		<link>http://www.certpal.com/blogs/2010/05/crypt-des-and-8-character-truncated-passwords/</link>
		<comments>http://www.certpal.com/blogs/2010/05/crypt-des-and-8-character-truncated-passwords/#comments</comments>
		<pubDate>Tue, 18 May 2010 14:38:00 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[crypt]]></category>
		<category><![CDATA[des]]></category>
		<category><![CDATA[encryption]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=734</guid>
		<description><![CDATA[Be wary of the crypt + DES encryption method as it truncates passwords to 8 characters in length. The users are usually not informed of the truncation which leads the account vulnerable to password guesses]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F05%2Fcrypt-des-and-8-character-truncated-passwords%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F05%2Fcrypt-des-and-8-character-truncated-passwords%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.certpal.com/blogs/wp-content/uploads/security_lock.png"><img class="alignright size-full wp-image-503" title="security_lock" src="http://www.certpal.com/blogs/wp-content/uploads/security_lock.png" alt="" width="79" height="104" /></a>Many passwords in linux are encrypted using the <a href="http://en.wikipedia.org/wiki/Crypt_%28Unix%29" target="_blank">crypt() utility</a>. The user is usually not aware of the difference between a crypt and a MD5 encryption. Well it can turn out to be important, especially if crypt uses the default DES-based scheme to perform the encryption.</p>
<p>The problem with crypt() + Traditional DES is that it truncates the password length to 8 characters. Users are not usually aware of this and assume that the entire length of the password has been saved and encrypted. Take the apache tool htpasswd for example. It uses <a href="http://httpd.apache.org/docs/2.0/programs/htpasswd.html" target="_blank">crypt() to encrypt passwords</a> (It may also use its own MD5 routine) into a password file. The following command creates a new user in a password file</p>
<p>htpasswd password_file new_user</p>
<p>After this command is executed, you are prompted for a password. If the password is greater than 8 characters, for example &#8211; 123456789, it will still be accepted and no warning will be provided that it was truncated. So providing the password 12345678 will also allow you to be authenticated into the system. Why is this bad ?</p>
<ul>
<li>The time taken to crack 8 character passwords is shorter (in relative comparison).</li>
</ul>
<ul>
<li>It is also likely that the password was truncated in these scenarios, so an attacker may well target passwords that are exactly 8 characters in length.</li>
</ul>
<ul>
<li>Some people have the knack of prefixing the password with the username first. Bad idea if your username happens to be 8 characters long <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<ul>
<li>The user may not even be aware of the problem, since he/she assumes that the password is strong and greater than 8 characters.</li>
</ul>
<p>So the next time you provide a password to a system, you might want to know how they get saved into a persistence store and what encryption is used.</p>
<p><script type="text/javascript">var dzone_url = 'http://www.certpal.com/blogs/2010/05/crypt-des-and-8-character-truncated-passwords/';</script><br />
<script type="text/javascript">var dzone_title = 'Crypt DES and 8 character truncated passwords';</script><br />
<script type="text/javascript">var dzone_blurb = 'Be wary of the crypt + DES encryption method as it truncates passwords to 8 characters in length. The users are usually not informed of the truncation which leads the account vulnerable to password guesses';</script><br />
<script type="text/javascript">var dzone_style = '2';</script><br />
<script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F05%2Fcrypt-des-and-8-character-truncated-passwords%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F05%2Fcrypt-des-and-8-character-truncated-passwords%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/05/crypt-des-and-8-character-truncated-passwords/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Learn to secure your application with Google Jarlsberg</title>
		<link>http://www.certpal.com/blogs/2010/05/learn-to-secure-your-application-with-google-jarlsberg/</link>
		<comments>http://www.certpal.com/blogs/2010/05/learn-to-secure-your-application-with-google-jarlsberg/#comments</comments>
		<pubDate>Mon, 10 May 2010 06:00:38 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=721</guid>
		<description><![CDATA[Learn to secure your application with Google Jarlsberg, a small cheesy application written by google with intentional security holes.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F05%2Flearn-to-secure-your-application-with-google-jarlsberg%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F05%2Flearn-to-secure-your-application-with-google-jarlsberg%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.certpal.com/blogs/wp-content/uploads/google_jarlsberg.png"><img class="alignright size-full wp-image-724" title="google_jarlsberg" src="http://www.certpal.com/blogs/wp-content/uploads/google_jarlsberg.png" alt="" width="84" height="85" /></a>I came across an interesting application today. Google has released an application named Jarlsberg that is full of security holes. The intent is to make developers learn how these holes work and put them in a position to combat the security vulnerabilities.</p>
<p>You can <a href="http://jarlsberg.appspot.com/" target="_blank">visit the app</a> to learn more. Security flaws to be detected are classified under the following categories</p>
<ul>
<li>Black box. You dont know the code</li>
<li>White box. Requires you to see the code to understand how to break it.</li>
<li>Gray box. Some code will be made visible.</li>
</ul>
<p>I also came across an <a href="http://code.google.com/edu/submissions/jarlsberg/Jarlsberg_Instructor_Guide.pdf" target="_blank">instructor&#8217;s guide</a> that has problems to be solved in the application, graded by their difficulty level.</p>
<p>What better way to learn an exploit than to perform it on a test system ? Some of the exploits involve</p>
<ul>
<li><a href="http://jarlsberg.appspot.com/part2#2__cross_site_scripting" target="_blank">XSS and related challenges</a></li>
<li><a href="http://jarlsberg.appspot.com/part4#4__path_traversal" target="_blank">Path traversal exploits</a></li>
<li><a href="http://jarlsberg.appspot.com/part4#4__denial_of_service" target="_blank">DOS</a></li>
<li><a href="http://jarlsberg.appspot.com/part5#5__buffer_and_integer_overflow" target="_blank">Buffer overflow</a></li>
<li><a href="http://jarlsberg.appspot.com/part5#5__sql_injection" target="_blank">SQL Injection</a></li>
</ul>
<p>and so much more. <a href="http://jarlsberg.appspot.com/" target="_blank">Give it a try now</a></p>
<p><script type="text/javascript">var dzone_url = 'http://www.certpal.com/blogs/2010/05/learn-to-secure-your-application-with-google-jarlsberg/';</script><br />
<script type="text/javascript">var dzone_title = 'Learn to secure your application with Google Jarlsberg';</script><br />
<script type="text/javascript">var dzone_blurb = 'Learn to secure your application with Google Jarlsberg, a small cheesy application written by google with intentional security holes.';</script><br />
<script type="text/javascript">var dzone_style = '2';</script><br />
<script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F05%2Flearn-to-secure-your-application-with-google-jarlsberg%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F05%2Flearn-to-secure-your-application-with-google-jarlsberg%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/05/learn-to-secure-your-application-with-google-jarlsberg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to open multiple SSH tunnels</title>
		<link>http://www.certpal.com/blogs/2010/03/howto-ssh-tunnel-multiple/</link>
		<comments>http://www.certpal.com/blogs/2010/03/howto-ssh-tunnel-multiple/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 08:07:52 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunnel]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=602</guid>
		<description><![CDATA[OpenSSH can be used to open multiple tunnels to remote services via SSH. Local ports can be opened up and the information communicated with these ports can be relayed to a remote machine. This tutorial explains how to open many ssh tunnels]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F03%2Fhowto-ssh-tunnel-multiple%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F03%2Fhowto-ssh-tunnel-multiple%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p style="text-align: center;"><a href="http://www.certpal.com/blogs/wp-content/uploads/tunnel.png"><img class="aligncenter size-full wp-image-603" style="border: 1px dashed black;" title="tunnel" src="http://www.certpal.com/blogs/wp-content/uploads/tunnel.png" alt="" width="282" height="170" /></a></p>
<p style="text-align: left;">
<p style="text-align: left;">I use remote linux services often and exposing them as local services can be performed securely using SSH. For example you can access a tomcat server or email server hosted at IP 1.2.3.4 by opening a secure SSH tunnel between your local machine and the target address &#8211; 1.2.3.4.</p>
<p>The <a href="http://www.openssh.com/" target="_blank">OpenSSH tool</a> can be used to perform SSH related activities on your machine. Simply install it with yum, apt-get or Yast, if it is not already available. Once you have it use the following command to open multiple SSH tunnels to your services</p>
<p><strong>Open tunnel and execute commands:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> 1.2.3.4 <span style="color: #660033;">-lmyUser</span> <span style="color: #660033;">-L</span> <span style="color: #000000;">3098</span>:1.2.3.4:<span style="color: #000000;">21</span> <span style="color: #660033;">-L</span> <span style="color: #000000;">3099</span>:1.2.3.4:<span style="color: #000000;">80</span> <span style="color: #660033;">-L</span> <span style="color: #000000;">3100</span>:1.2.3.4:<span style="color: #000000;">443</span></pre></div></div>

<p>The command is explained below</p>
<p><strong>1.2.3.4</strong> &#8211; Your target IP</p>
<p><strong>l</strong> &#8211; The user to login as</p>
<p><strong>L</strong> &#8211; A local tunnel to a remote port</p>
<p><strong>3098</strong> &#8211; The local port to use when establishing this tunnel</p>
<p><strong>21</strong> &#8211; The remote port at 1.2.3.4 to which the tunnel will be established</p>
<p>Multiple tunnels can be opened by specifying multiple -L flags. For example http://localhost:3099 will now redirect to http://1.2.3.4:80/ That is a fancy way of saying all HTTP requests ( 80 is the default port ) for 1.2.3.4 can now be reached locally at port 3099.</p>
<p>Note that the above command will also log you into the remote system. If you want to open the tunnels alone, use the -N switch and the -f switch as shown below</p>
<p><strong>Open tunnels only:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-f</span> myUser<span style="color: #000000; font-weight: bold;">@</span>1.2.3.4 <span style="color: #660033;">-L</span> <span style="color: #000000;">3099</span>:1.2.3.4:<span style="color: #000000;">25</span> <span style="color: #660033;">-N</span></pre></div></div>

<p>The -f switch asks SSH to work in the background and -N asks SSH not to execute any commands.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F03%2Fhowto-ssh-tunnel-multiple%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F03%2Fhowto-ssh-tunnel-multiple%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/03/howto-ssh-tunnel-multiple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to turn off google buzz</title>
		<link>http://www.certpal.com/blogs/2010/02/how-to-turn-off-google-buzz/</link>
		<comments>http://www.certpal.com/blogs/2010/02/how-to-turn-off-google-buzz/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 06:06:00 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[buzz]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=564</guid>
		<description><![CDATA[How to turn off google buzz. Buzz integrates with your Gmail inbox and you can get rid of it if you want to.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Fhow-to-turn-off-google-buzz%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Fhow-to-turn-off-google-buzz%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://www.certpal.com/blogs/wp-content/uploads/no.png"><img class="alignright size-full wp-image-565" title="no" src="http://www.certpal.com/blogs/wp-content/uploads/no.png" alt="" width="65" height="65" /></a>I logged into a gmail inbox today, surprised to find &#8216;Google Buzz&#8217; asking me if I wanted in. I clearly said &#8216;No&#8217;. Not yet another social network. pfft. So after I said &#8216;No&#8217; there it was sitting comfortably on the navigation bar and telling me people were following me and I could follow them.</p>
<p>There is a small link on the bottom of your Gmail page that says &#8216;<strong>turn off buzz</strong>&#8216;. Click on that and you get disconnected from the social network. I wonder what google plans for Orkut.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Fhow-to-turn-off-google-buzz%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Fhow-to-turn-off-google-buzz%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/02/how-to-turn-off-google-buzz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle apologizes about kenai.com</title>
		<link>http://www.certpal.com/blogs/2010/02/oracle-kenai-com/</link>
		<comments>http://www.certpal.com/blogs/2010/02/oracle-kenai-com/#comments</comments>
		<pubDate>Mon, 08 Feb 2010 05:44:16 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[kenai]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=557</guid>
		<description><![CDATA[Oracle apologizes for its communication about kenai.com's future by saying that the future of kenai projects are secure at java.net]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Foracle-kenai-com%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Foracle-kenai-com%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>After project owners were asked to move out of kenai.com, Oracle now admits that it did a poor job at communicating its plans for the project. An <a href="http://blogs.sun.com/projectkenai/entry/the_future_of_kenai_com" target="_blank">updated post</a> from Oracle says that the future of kenai.com projects is secure. Those projects will be migrated to java.net and continued as is. Here is an extract from the post</p>
<blockquote><p>We don&#8217;t believe it makes sense to continue investing in multiple hosted development sites that are basically doing the same thing. Our plan is to shut down kenai.com and focus our efforts on java.net as the hosted development community. We are in the process of migrating java.net to the kenai technology. This means that any project currently hosted on kenai.com will be able to continue as you are on java.net. We are still working out the technical details, but the goal is to make this migration as seamless as possible for the current kenai.com projects</p></blockquote>
<p>Most developers seem to be <a href="http://eriwen.com/tools/moving-to-github/">moving out of kenai.com</a> after being asked to leave. For those of you that do not want to move, there may still be hope <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><script type="text/javascript">// <![CDATA[
var dzone_url = 'http://www.certpal.com/blogs/2010/02/oracle-kenai-com/';
// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
var dzone_title = 'Oracle apologizes about kenai.com';
// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
var dzone_blurb = '[description]';
// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
var dzone_style = '2';
// ]]&gt;</script><br />
<script src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Foracle-kenai-com%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Foracle-kenai-com%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/02/oracle-kenai-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error: ORA-01418: specified index does not exist</title>
		<link>http://www.certpal.com/blogs/2010/02/ora-01418-specified-index-does-not-exist/</link>
		<comments>http://www.certpal.com/blogs/2010/02/ora-01418-specified-index-does-not-exist/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 05:09:31 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=550</guid>
		<description><![CDATA[A look at the "Error: ORA-01418: specified index does not exist" problem and how it can be solved. The error is misleading at times and does not always mean that the specified index does not exist. You might simply not have the privilege to execute index related queries.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Fora-01418-specified-index-does-not-exist%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Fora-01418-specified-index-does-not-exist%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I ran into a weird little error while trying to tune the performance of a query in the oracle database. A table had an index on a VARCHAR2 column. After a fair number of inserts were made the population of this table grew to 1.5 million records. A query that did an join on the VARCHAR2 column was talking ages to get the results. Well, it was taking 900ms actually but the SLA for the API call is way below that.</p>
<p>An &#8220;explain plan for QUERY&#8221; statement was run followed by a select from plan_details. It turns out the index is never used and a full table scan was used to get the data. Hence the problem.</p>
<p>So all I have to do is find out why the index is not being picked up. It probably has to do with statistics, and a rebuild on the index might help I thought. Or may be I need to analyze the index. So I went about trying to do some of these things. There were no DBAs around so I had to experiment a little.</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;">analyze <span style="color: #993333; font-weight: bold;">INDEX</span> YOUR_INDEX_NAME validate <span style="color: #993333; font-weight: bold;">STRUCTURE</span>;
&nbsp;
Error: ORA<span style="color: #66cc66;">-</span>01418: specified <span style="color: #993333; font-weight: bold;">INDEX</span> does <span style="color: #993333; font-weight: bold;">NOT</span> exist
&nbsp;
SQLState:  <span style="color: #cc66cc;">72000</span>
ErrorCode: <span style="color: #cc66cc;">1418</span></pre></div></div>

<p>This was totally weird. I knew that the index did exist and the name was correct. To double check I ran this query</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> all_indexes <span style="color: #993333; font-weight: bold;">WHERE</span> INDEX_NAME<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'YOUR_INDEX_NAME'</span></pre></div></div>

<p>And it did return my index correctly. After trying several other commands related to indexes they all returned the same thing. I tried to prefix the SCHEMA name and that did not help.</p>
<p>So it turns out, I do not have permissions to create indexes or do any operations related to them and that is what throws this error. The error is pretty misleading since there already exists an error code for insufficient prvileges for performing a given operation &#8211; Error: ORA-00990: missing or invalid privilege.</p>
<p>I passed the index related queries on to a DBA and the performance of my application queries were back on track. I hope this saves a developer the time I lost trying to find out why the index did not exist.</p>
<p>PS: Oracle 11 also has an index visibility option which can be verified with</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> INDEX_NAME<span style="color: #66cc66;">,</span>VISIBILITY <span style="color: #993333; font-weight: bold;">FROM</span> USER_INDEXES <span style="color: #993333; font-weight: bold;">WHERE</span> INDEX_NAME<span style="color: #66cc66;">=</span><span style="color: #ff0000;">'YOUR_INDEX_NAME'</span>;</pre></div></div>

<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Fora-01418-specified-index-does-not-exist%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F02%2Fora-01418-specified-index-does-not-exist%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/02/ora-01418-specified-index-does-not-exist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Will you continue to use Sun projects ?</title>
		<link>http://www.certpal.com/blogs/2010/01/sun-projects-poll/</link>
		<comments>http://www.certpal.com/blogs/2010/01/sun-projects-poll/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 11:50:44 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[poll]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[sun]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=524</guid>
		<description><![CDATA[A poll to scratch the surface of the question 'Will Sun projects continue to be used in development and production environments around the world'. ]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F01%2Fsun-projects-poll%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F01%2Fsun-projects-poll%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>A few days ago the EU had approved the takeover of Sun microsystems by Oracle. This brings to an end the long awaited acquisition. There have been several blog entries about the fate of the open source projects that Sun currently supports. I have read some of the arguments put forward about why developers should move away from / use certain projects.</p>
<p>However I also find myself in a dilemma. I installed GlassFish and deployed a few apps on it recently. I found it interesting and was impressed with it within a few minutes of using it. MySql is also a great open source project. There are many tools built around the database and it competes well with PostGresql. Netbeans is also a great IDE and supports glassfish.</p>
<p>I am very tempted to continue using these projects for the development of new pet projects and to learn new specs. Right now I expect the support for these projects to continue for a few years, and I do not really expect to see great innovation of any sort. The best case scenario is that Oracle leverages the usefulness of these projects and decides to keep them alive while giving them healthy financial support. One is allowed to dream <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_mrgreen.gif' alt=':mrgreen:' class='wp-smiley' /> </p>
<p>So it boils down to the following question. &#8220;<strong>Will you as a developer / architect / &lt;Insert technical position here&gt; continue to use projects like GlassFish, Netbeans, MySql etc ?</strong>&#8221; Or are you looking to move away to other open source projects immediately ? Voice your thoughts through this poll</p>
<p>Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.<br />
<script type="text/javascript">// <![CDATA[
var dzone_url = 'http://www.certpal.com/blogs/2010/01/sun-projects-poll/';
// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
var dzone_title = 'Will you continue to use Sun projects ?';
// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
var dzone_blurb = 'A poll to scratch the surface of the question 'Will Sun projects continue to be used in development and production environments around the world'. ';
// ]]&gt;</script><br />
<script type="text/javascript">// <![CDATA[
var dzone_style = '2';
// ]]&gt;</script><br />
<script src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F01%2Fsun-projects-poll%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F01%2Fsun-projects-poll%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/01/sun-projects-poll/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Problems in production</title>
		<link>http://www.certpal.com/blogs/2010/01/problems-in-production/</link>
		<comments>http://www.certpal.com/blogs/2010/01/problems-in-production/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 11:21:47 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[prod]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=514</guid>
		<description><![CDATA[Three anecdotes about problems that I encountered in various live environments recently. The variety of problems just goes to show that you can still encounter unexpected things after several hours of testing.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F01%2Fproblems-in-production%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F01%2Fproblems-in-production%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="alignright size-full wp-image-515" title="prod-burn" src="http://www.certpal.com/blogs/wp-content/uploads/prod-burn.PNG" alt="prod-burn" width="100" height="127" />I have been a tad busy fixing some weird little bugs lately. They helped me appreciate the multitude of things that can go wrong in a live environment and served as a gentle reminder that you should always be on your heels.</p>
<p>Here they are</p>
<p><strong>1. </strong><strong>LDAP and the user</strong></p>
<p>A web application product was configured to use an LDAP directory structure. The directory was segregated into roles / groups / OUs, the usual. One of the users had trouble logging into the product. This was weird because this person was a valid user and Outlook seemed to recognize him. Outlook uses the same LDAP tree. So I dug into it. The easiest way to check what is going on is to use a LDAP directory browser. I use the one provided by <a href="http://www.novell.com/coolsolutions/tools/13765.html" target="_blank">Novell for free</a>. The LDAP<strong>s</strong> support is not great but it will do for basic lookups.</p>
<p>So as I dug into the tree, it turns out this user was mapped as a group. Yes a group. The product was configured so that only the &#8220;user accounts&#8221; LDAP directory was looked into for valid users. So since this user was, ummm a group, the application was unable to find him. My only thought was &#8216;wow ! how did this go under the radar for so long ?&#8217;. The mistake was understandable though since groups and users are under a similar looking structure. The LDAP admin must have had too many doughnuts at lunch and probably dozed through when configuring the user into the system <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p><strong>2. Authentication failure</strong></p>
<p>This one involves the LDAP too. We built a web app recently that was supposed to check for users under a specific tree node. The logic was to bind to the LDAP and if that is successfull then it must mean that the user exists. Unfortunately the negative scenario to this logic was not tested all that well. The API did not throw an exception when the Bind failed. So this meant that I could login to the application without a password. This also meant I could use any user name I wanted to and login. Even one that does not exist. I was tempted to do some operations as MrBunnyRabbit76 but fixed the bug instead.</p>
<p><strong>3. FTP and the CPU</strong></p>
<p>Now comes this little gem. A FTP process had been scheduled in CRON to run every 10 minutes or so. Its job is to ensure that a local folder and a remote FTP folder are in sync with each other. The program used to do this is lftp with the R switch (for reverse). It so happens that the FTP account gets locked because it ran out of space. The account is unlocked the next day. However the lftp processes did not terminate for some reason when the account was locked.</p>
<p>I come back to check on a web application on the server and it gives a 503 error. hmm&#8230; weird I thought. Everything is fine, tomcat is up, apache is up and yet a 503. The problem was that the lftp processes that did not terminate caused the CPU to be overloaded. All other processes were begging for some CPU time. The lftp processes were sitting quietly and drinking up precious CPU power for almost 2 days. Once the processes were killed things went back to normal.</p>
<p>Weird things happen in PROD whether it is your fault or not. No matter how much you test, it always pays to be on your watch <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F01%2Fproblems-in-production%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2010%2F01%2Fproblems-in-production%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2010/01/problems-in-production/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do you really need that design pattern ?</title>
		<link>http://www.certpal.com/blogs/2009/12/do-you-really-need-that-design-pattern/</link>
		<comments>http://www.certpal.com/blogs/2009/12/do-you-really-need-that-design-pattern/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 15:25:16 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[design]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=481</guid>
		<description><![CDATA[Using design patterns where they do not belong can lead to over engineered code. Use patterns only when you really need to. Trivial code that is easy to maintain will always triumph over a complicated design pattern. In short, HelloWorld does not need a design pattern]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F12%2Fdo-you-really-need-that-design-pattern%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F12%2Fdo-you-really-need-that-design-pattern%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>I chanced upon <a href="http://blogs.microsoft.co.il/blogs/gilf/archive/2009/11/22/applying-strategy-pattern-instead-of-using-switch-statements.aspx " target="_blank">a post </a>a while back about how a switch statement should be replaced with the strategy pattern. If you have not had a chance to go through it, please do. The post is not very long.  I found myself disagreeing very strongly with the author of the post and I was surprised to find that people thought this was a good idea.</p>
<p>The gist of the post was that using the Strategy pattern was better than using switch statements to determine which logic to execute. Here is why I think the idea used there was bad</p>
<ol>
<li>The introduction of the Strategy pattern, in the example, introduces three new classes. So for every case in a switch statement, we should go about replacing the corresponding code with a new class ? This could easily lead to an explosion in the number of classes.</li>
<li> Distributing logic across classes makes it harder for a developer to follow. When I traverse 2 / 3 links down a code path I might lose track of where I started.</li>
<li> Introducing a new case means I have to introduce one more class, remember to add that as a strategy and switch to that strategy correctly when the case is presented.</li>
<li>Introducing a new class to handle a &#8216;case&#8217; might not make sense. Classes are supposed to cohesively carry out a function. Introducing a new class for every function that a class is supposed to perform, dilutes the purpose of the class.</li>
<li>The code that was supposed to perform the switch case is simply done else where and called a strategy.</li>
</ol>
<p>Applying patterns where they do not belong, can be an anti pattern by itself. I can relate with what the author is trying to do. When I finished the &#8216;Head first design patterns&#8217; book I was racing to implement a pattern for everything that was around me. The book stopped me right there and warned &#8216;HelloWorld does not need a design pattern&#8217;. And they are absolutely right. For a design pattern to succeed, you need</p>
<ol>
<li>The right problem to apply the pattern.</li>
<li>Correct implementation of the pattern to solve the problem.</li>
<li>Knowledge and relevant documentation if necessary, to let the maintenance developer down the line know that this is how you used the pattern.</li>
</ol>
<p>Patterns are meant to solve common design problems but trying to use them everywhere can lead to overly engineered code that is hard to read and maintain. Use patterns only when they are necessary and help you solve the problem.
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F12%2Fdo-you-really-need-that-design-pattern%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F12%2Fdo-you-really-need-that-design-pattern%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2009/12/do-you-really-need-that-design-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google wave</title>
		<link>http://www.certpal.com/blogs/2009/10/google-wave/</link>
		<comments>http://www.certpal.com/blogs/2009/10/google-wave/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 12:44:02 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[wave]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=378</guid>
		<description><![CDATA[A few observations that I made regarding the google wave dev preview. The wave is interesting but google has some way to go before perfecting errors / flaws in its product.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F10%2Fgoogle-wave%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F10%2Fgoogle-wave%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><img class="alignright size-full wp-image-384" title="wavelogo" src="http://www.certpal.com/blogs/wp-content/uploads/wavelogo.png" alt="wavelogo" width="154" height="154" />After a long wait I got a google wave account. yay ! Took the wave for a spin over the last few days and there were some interesting things that I observed. I wrote my first java wave robot and it was pretty cool. But an explanation of how the robot works should be left to another post all together. I will share my general observations in this post.</p>
<p><strong>Deleted welcome messages: </strong></p>
<p>The first thing that was weird was that welcome messages are often deleted by wave users or by bots. This is nuts. The wave welcome messages also have a lot of noise amidst them with quotes like &#8216;<span style="color: #ff0000;"><strong>Please do not delete this </strong></span>!&#8217; in bold red with a big font size. Wave still does not have a feature to disable edits. It is coming soon but it is not yet active.</p>
<p><strong>Lonely waves:</strong></p>
<p>Almost every one is complaining about this. They have a wave account but the 8 invites that were promised have not yet arrived (for some). The reason being that google wave is expanding its user base very slowly to avoid a massive crash of the system. It is also difficult to find waves centered around a topic. I tried to find java discussion but my searches ended up with nothing <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' />   If you are a java geek and have a google wave account simply add your wave account name in the comments section. At least those reading this post will know how to contact you.</p>
<p><strong>Miscellaneous / Tit bits:</strong></p>
<ul>
<li>Google wave was pretty slow. But I expected that since this is a DEV preview.</li>
</ul>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-379" title="wave-sidebar" src="http://www.certpal.com/blogs/wp-content/uploads/wave-sidebar.PNG" alt="wave-sidebar" width="25" height="109" /></p>
<ul>
<li>A funky sidebar was present on each window. I did not like this. I am used to clicking somewhere within the side bar&#8217;s empty space to move up or down. Fortunately the mouse wheel works with the side bar.</li>
</ul>
<ul>
<li>Some robots are creating havoc. Editing comments left by others and deleting wave replies. This leaves some people vexed.</li>
</ul>
<ul>
<li>There are some cool robots out there. I tried out the <a href="http://answers.oreilly.com/topic/374-reacting-to-wave-conversations-and-inserting-wave-gadgets-with-a-wave-robot/" target="_blank">ISBN wave robot </a>that replaces the ISBN number with a picture of a book and a link to O&#8217;Reilly. I can think of many applications where such robots can come in handy.</li>
</ul>
<p><img class="aligncenter size-full wp-image-382" title="wave-usab" src="http://www.certpal.com/blogs/wp-content/uploads/wave-usab.PNG" alt="wave-usab" width="458" height="216" /></p>
<ul>
<li>Editing / deleting wave replies (blips) involves 2 clicks. You click a drop down and then select an option from it. Usability of the blip can be enhanced by placing small icons near each blip, which you can click to perform that action. Just a thought.</li>
</ul>
<ul>
<li>Removing yourself from a wave discussion is not yet supported. You can add contacts without asking the contact&#8217;s permission first.</li>
</ul>
<ul>
<li>There are wave &#8216;groups&#8217; out there that discuss specific topics. You can subscribe to these wave groups. But sometimes, like in a forum thread, the discussion takes a U turn and towards the end of the discussion the participants are talking about something entirely unrelated to the root topic.</li>
</ul>
<ul>
<li>Searching for waves is done in a variety of ways. You can search by tags / contributors / authors / wave ID / gadgets etc etc. Each wave can be tagged to particular keywords like a blog post.</li>
</ul>
<p>This is just a tip of the ice berg. The java robot was very exciting to create and it was more exciting to watch it in action. There are some good tutorials out there that tell you how to write a bot but I see a gap where the flow of events and the overall picture of the robot is not brought out. I will try to cover that in my next post. You can subscribe to the <a href="http://feeds.feedburner.com/Certpal" target="_blank">RSS feed</a> if you would like to keep an eye on it.<br />
<script type="text/javascript">var dzone_url = 'http://www.certpal.com/blogs/2009/10/google-wave/';</script><br />
<script type="text/javascript">var dzone_title = 'Google wave';</script><br />
<script type="text/javascript">var dzone_blurb = 'A few observations that I made regarding the google wave dev preview. The wave is interesting but google has some way to go before perfecting errors / flaws in its product.';</script><br />
<script type="text/javascript">var dzone_style = '2';</script><br />
<script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F10%2Fgoogle-wave%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F10%2Fgoogle-wave%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2009/10/google-wave/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Google hacks</title>
		<link>http://www.certpal.com/blogs/2009/10/google-hacks/</link>
		<comments>http://www.certpal.com/blogs/2009/10/google-hacks/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 17:11:55 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=364</guid>
		<description><![CDATA[Google can be used to reveal web site vulnerabilities. Tweaking google searches can help reveal them. Learn how to secure your site to prevent google from accidentally caching important content on your website. These tips will help prevent google hacks on your site.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F10%2Fgoogle-hacks%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F10%2Fgoogle-hacks%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Let me begin this post by saying that I am not writing this so that you can read this and become a haCkEr. I am writing this post so you can learn to identify a vulnerability and try to avoid an embarrassment.</p>
<p>Google is an amazing search engine. The problem is that it is too good at what it does sometimes <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Here are some ways that google can reveal vulnerabilities on your website by mistake.<br />
<br/></p>
<h2><strong>You allowed google to index a critical file:</strong></h2>
<p>This happens more often than you think. WordPress for example houses important files under the wp-* folders and it is no one&#8217;s business except yours to look at these files. Other files like .htaccess htpasswd are critical to your site&#8217;s security (if you are using apache and &#8216;allow overrides&#8217;). Do not allow google to index them. You can prevent that by placing a robots.txt file on the root path of your website. <a href="http://www.google.com/support/webmasters/bin/answer.py?hl=en&amp;answer=156449" target="_blank">More on that here</a>.</p>
<p>The better option is to put in place a configuration that will not allow the sensitive file to be displayed in the first place. Not all robots will obey what you instruct using robots.txt. The FilesMatch directive on apache can help you protect your site.</p>
<p>You can double check that google can read your robots.txt using google <a href="http://www.google.com/analytics/" target="_blank">analytics</a>. You can check the files that google has indexed using the query<strong>&#8216;site:yoursitename.com</strong></p>
<p><br/></p>
<h2><strong>Google indexed a service page that is being served on a non regular port:</strong></h2>
<p>Examples of this are login pages or services that do not require a password. Searching for such pages can be done using the &#8220;inurl&#8221; keyword in searches. Here is an example <strong>inurl:8080</strong>. There are ways to tweak that search string to reveal more information about services on other ports. When you complement inurl:something_unique_in_the_url with a search using quotes, like <strong>inurl:1234 intitle:&#8221;Administration blah&#8221;</strong>, it can yield some very interesting results. Pick your favorite admin tool and replace the port and title with the admin home page equivalent. The search works on many major application / web servers.</p>
<p>Remember that google indexes your page. Even if you correct the problem, the damage is done and is still being done. With cached pages, a service that does not ask for user name and passwords (yes there are important services that do not require a username/password) will be completely indexed. Yikes ! The data that your service exposes is cached and indexed for everyone to see. Not what we want.</p>
<p>To avoid this simply shutdown services you do not need. If you need a service but you want that service to be private, block the port with a firewall.</p>
<p>You can optionally tell google bot and other bots not to index the page in question. But that is not really a solution. Be proactive and secure the service. A cached page can end up earning you some DOS attacks.<br />
<br/></p>
<h2><strong>Google cracks MD5:</strong></h2>
<p>I realized that google could be used to crack weak passwords <a href="http://www.lightbluetouchpaper.org/2007/11/16/google-as-a-password-cracker/" target="_blank">from this post</a>. If the encryption is done without salting, the password will result in the same hash every time. A weak password can be guessed easily using this technique.</p>
<p>The lesson here is to use a strong password that no one will guess. The other lesson is to ensure that the links on your site do not pass along sensitive information. Here is the <a href="http://www.google.com/search?q=20f1aeb7819d7858684c898d1e98c1bb" target="_blank">google search </a>in case it interests you</p>
<p><br/></p>
<h2><strong>Cached directory pages:</strong></h2>
<p>Your web server is quite capable of displaying a directory listing. What this means is that besides displaying HTML, if I were to request for a directory name instead, your web server will reveal the contents of the directory to me. Why is this bad ? It helps find more vulnerable files that are housed inside those directories. You can ask apache not to serve directory content by configuring the same in httpd.conf. The line of configuration will look something like this<br />
<br/><br/><br />
Options Indexes FollowSymLinks<br />
# More stuff here</p>
<p>Remove the word <a href="http://httpd.apache.org/docs/2.0/mod/core.html" target="_blank">Indexes</a>.</p>
<p>The related search query in google is <strong>intitle:&#8221;index of /&#8221;</strong>. Tweaking it will provide better results.</p>
<p>Before you make any configuration changes, always make a backup. Read about the changes you are making and understand what you are doing before you do it. Try these tricks on your site and check if it is secure. Be creative. Think about other sensitive terms like jsessionid, username, passwd, password, id etc.<br />
<script type="text/javascript">var dzone_url = 'http://www.certpal.com/blogs/2009/10/google-hacks/';</script><br />
<script type="text/javascript">var dzone_title = 'Google hacks';</script><br />
<script type="text/javascript">var dzone_blurb = 'Google can be used to reveal web site vulnerabilities. Tweaking google searches can help reveal them. Learn how to secure your site to prevent google from accidentally caching important content on your website. These tips will help prevent google hacks on your site.';</script><br />
<script type="text/javascript">var dzone_style = '2';</script><br />
<script language="javascript" src="http://widgets.dzone.com/links/widgets/zoneit.js"></script>
<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F10%2Fgoogle-hacks%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F10%2Fgoogle-hacks%2F&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
]]></content:encoded>
			<wfw:commentRss>http://www.certpal.com/blogs/2009/10/google-hacks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

