<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:gml="http://www.opengis.net/gml"
>

<channel>
	<title>Rohit's Blog &#187; Security</title>
	<atom:link href="http://www.smart-techie.com/blog/category/computing/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.smart-techie.com/blog</link>
	<description>My opinion about anything and everything!</description>
	<lastBuildDate>Sun, 15 Jan 2012 05:13:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Why was Yahoo SMTP misbehaving?</title>
		<link>http://www.smart-techie.com/blog/2008/04/why-was-yahoo-smtp-misbehaving/</link>
		<comments>http://www.smart-techie.com/blog/2008/04/why-was-yahoo-smtp-misbehaving/#comments</comments>
		<pubDate>Sat, 05 Apr 2008 15:44:55 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.smart-techie.com/blog/?p=60</guid>
		<description><![CDATA[Yahoo provides free SMTP access to all its non yahoo.com domain email addresses. I started using the server around 6 months back. The best part was that the SMTP servers were dumb. They were acting as open message relays for anyone who had a valid Yahoo ID. So I could send an email message as [...]]]></description>
			<content:encoded><![CDATA[<p>Yahoo provides free SMTP access to all its non yahoo.com domain email addresses. I started using the server around 6 months back. The best part was that the SMTP servers were dumb. They were acting as open message relays for anyone who had a valid Yahoo ID. So I could send an email message as support@yahoo-inc.com using the SMTP server and the Yahoo server would happily send my email message. Worse, the receiver had very few options for detecting that the email message was fake. It came from a Yahoo server and looked like a message from Yahoo customer care and so should be genuine. The reason for this (as I suspect) were Yahoo Plus accounts. They used the same SMTP servers as the free country domain Yahoo accounts. Apparently, Yahoo didn&#8217;t verify the FROM address for its paying Yahoo Plus customers and so passed the benefits to the free customers too.</p>
<p>The ramifications for this became apparent. Yahoo servers started sending out spam. I had no proof in the beginning but <a href="http://blog.fastmail.fm/2008/02/12/yahoo-smtp-accounts-sending-spam/" rel="nofollow">this post</a> verified my suspicions. Spammers became aware of the golden opportunity and started abusing Yahoo servers to the fullest. This led to really tough times for the Yahoo Mail people and their PR guys as apparent from <a href="http://www.ymailblog.com/blog/2008/02/resolved-email-delays-through-smtp-servers/">this post</a> on Yahoo Mail Blog. Not only were the email servers overloaded, but ISPs started blocking mails from Yahoo servers which led to delayed/undelivered mails.</p>
<p>Now it seems that Yahoo has changed the way it routes emails through its SMTP servers. Earlier methods were quite trivial as the mail headers would have shown.   <code>     <br />Received: from smtp104.plus.mail.re1.yahoo.com (smtp104.plus.mail.re1.yahoo.com [69.147.102.67]) by rly-ma08.mx.aol.com (v120.9) with ESMTP id MAILRELAYINMA088-8c647354bcb3bd; Sat, 10 Nov 2007 01:12:27 -0400     <br />Received: (qmail 55018 invoked from network); 10 Nov 2007 06:12:27 -0000     <br />Received: from unknown (HELO localhost) (myYahooID@myIPAddress with login)     <br />by smtp104.plus.mail.re1.yahoo.com with SMTP; 10 Nov 2007 06:12:26 -0000</code></p>
<p>Gradually Yahoo started repairing its servers from the smtp11x.plus.mail.re1.yahoo.com series to smtp10x.plus.mail.re1.yahoo.com as the latter still worked for a long time without FROM address checks.</p>
<p>Now the mail headers are more complicated. It seems that Yahoo does some internal checks regarding whether the FROM address is valid and then only routes the emails.   <br /><code>Received: from n3.bullet.mail.ac4.yahoo.com (n3.bullet.mail.ac4.yahoo.com [76.13.13.29])     <br />by mx.google.com with SMTP id d12si10680167and.24.2008.04.05.08.35.00;     <br />Sat, 05 Apr 2008 08:35:01 -0700 (PDT)     <br />Received-SPF: neutral (google.com: 76.13.13.29 is neither permitted nor denied by best guess record for domain of myYahooAddress) client-ip=76.13.13.29;     <br />DomainKey-Status: good (test mode)     <br />Authentication-Results: mx.google.com; spf=neutral (google.com: 76.13.13.29 is neither permitted nor denied by best guess record for domain of myYahooAddress) smtp.mail=myYahooAddress; domainkeys=pass (test mode) header.From=myYahooAddress     <br />Received: from [76.13.13.26] by n3.bullet.mail.ac4.yahoo.com with NNFMP; 05 Apr 2008 07:31:40 -0000     <br />Received: from [68.142.237.88] by t3.bullet.mail.ac4.yahoo.com with NNFMP; 05 Apr 2008 15:34:24 -0000     <br />Received: from [216.252.111.166] by t4.bullet.re3.yahoo.com with NNFMP; 05 Apr 2008 15:34:24 -0000     <br />Received: from [127.0.0.1] by omp101.mail.re3.yahoo.com with NNFMP; 05 Apr 2008 15:34:24 -0000     <br />X-Yahoo-Newman-Id: 666616.8045.bm@omp101.mail.re3.yahoo.com     <br />Received: (qmail 61052 invoked from network); 5 Apr 2008 15:34:24 -0000     <br />DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws;s=s1024; d=yahoo.co.in;     <br />h=Received:X-YMail-OSG:X-Yahoo-Newman-Property:Message-ID: Date:From:User-Agent:MIME-Version:To: Subject:Content-Type:Content-Transfer-Encoding;b=1zOo54htnYlA5Gy3kNjQQVpRD8fYyEbgwwejDXI4Jr/RZ32+QDvvwYLxJOdSkbwWyJhA3P5PfBVX+mGGYePhw3TXtmfqdVSUcu/BGnwpyONzF3umcYLylkOzLBu/URre6lF+6gdEnRPsfIE3isy25r9dfELJke0wDDwqEdCEYg= ;     <br />Received: from unknown (HELO Why?are?spaces?replaced?by??BTW?if?you?read?this?you?are?a?G33K) (myYahooID@myIPAddress with plain)by smtp103.plus.mail.re1.yahoo.com with SMTP; 5 Apr 2008 15:34:24 -0000</code></p>
<p>BTW I had told this to the Engineering head of Yahoo Atlanta during my internship interview here and he was surprised by this. Unfortunately I couldn&#8217;t demo this for him as Yahoo had started fixing this problem starting that day only.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-techie.com/blog/2008/04/why-was-yahoo-smtp-misbehaving/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Orkut and a Worm</title>
		<link>http://www.smart-techie.com/blog/2007/12/orkut-and-a-worm/</link>
		<comments>http://www.smart-techie.com/blog/2007/12/orkut-and-a-worm/#comments</comments>
		<pubDate>Fri, 21 Dec 2007 04:08:56 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Computing]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.smart-techie.com/blog/2007/12/56/</guid>
		<description><![CDATA[So its not often that my computer is actually infected by a Worm (or Virus). But then when I got an email from an old friend about scrapping when I hadn&#8217;t done so, I was surprised. A quick and thorough scan of my PC revealed nothing. Now I faintly remembered receiving 2 scraps (which obviously [...]]]></description>
			<content:encoded><![CDATA[<p>So its not often that my computer is actually infected by a Worm (or Virus). But then when I got an email from an old friend about scrapping when I hadn&#8217;t done so, I was surprised. A quick and thorough scan of my PC revealed nothing.</p>
<p>Now I faintly remembered receiving 2 scraps (which obviously looked like Spam) from my friends and that I had deleted them promptly. Could it be a case of <a title="Cross Site Scripting" href="http://en.wikipedia.org/wiki/Cross-site_scripting" id="mecc">Cross Site Scripting</a>? A <a title="blog article" href="http://www.marrowbones.com/commons/technosocial/2007/12/orkut_worm_code_and_why_was_go.html" id="r9a5" rel="nofollow">blog article</a> that I read today confirmed by suspicions.</p>
<p>Now in <a href="http://www.smart-techie.com/blog/2007/06/creating-secure-web-interfaces/">my previous post</a> I had emphasized my belief that &#8220;All input is evil&#8221; and even though Google seems to do a pretty good job with Blogger, filtering out <i>bad</i> HTML and unwanted scripts; it has failed to do that with Orkut. Especially when it keeps adding more and more features to make the UI richer and interactive, the importance of such measures increases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-techie.com/blog/2007/12/orkut-and-a-worm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Inspecting Web Interfaces</title>
		<link>http://www.smart-techie.com/blog/2007/06/inspecting-web-interfaces/</link>
		<comments>http://www.smart-techie.com/blog/2007/06/inspecting-web-interfaces/#comments</comments>
		<pubDate>Wed, 27 Jun 2007 15:22:52 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Coding/ Programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Web Links]]></category>

		<guid isPermaLink="false">http://www.smart-techie.com/blog/2007/06/inspecting-web-interfaces/</guid>
		<description><![CDATA[(Continued from Secure Web Interfaces) OK, I had a tremendous urge to call this post &#8220;Hacking Web Interfaces&#8221;. But due to some uneducated folks who believe hacking is a bad word, I think I will stick to its euphemism. The most direct way to feed random data to a web-service is in a raw format. [...]]]></description>
			<content:encoded><![CDATA[<p><em>(Continued from <a href="http://www.smart-techie.com/blog/2007/06/creating-secure-web-interfaces/">Secure Web Interfaces</a>)<br />
</em></p>
<p>OK, I had a tremendous urge to call this post &#8220;Hacking Web Interfaces&#8221;. But due to some uneducated folks who believe hacking is a bad word, I think I will stick to its euphemism.</p>
<p>The most direct way to feed random data to a web-service is in a raw format. Use telnet for absolute low level communications or tools like Fiddler, for communications at a higher level like HTTP.&nbsp;But with sites hosting hundreds of script files and html pages on their server, this approach has become more and more impractical. But there are other means to mess with the client side code.</p>
<h3>DOM Inspector</h3>
<p>If you use Firefox, you will notice there&#8217;s a utility called <a href="http://www.mozilla.org/projects/inspector/">DOM Inspector</a> that is included with it. As the name suggests, it allows you to see the DOM of the rendered HTML page. But, it also allows you to modify that DOM. You can modify the values of the properties of different DOM objects in the tree and even insert new objects.</p>
<p>Let&#8217;s try this technique on a product of one of the largest software companies, Google Calendar. I will use no other software than Firefox and DOM inspector.</p>
<p>Let&#8217;s go to the Settings screen. They have a setting for the &#8220;Custom View&#8221; property for the calendar.</p>
<p><a href="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image-1.png" atomicselection="true" rel="lightbox"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="99" alt="Google Calendar Settings" src="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_thumb-2.png" width="122" border="0" /></a></p>
<p>Now I am a guy who wants to know what he would be doing in next 2 months but there is no option for that kind of view. Hmm, lets see if the DOM can help us. Firing the DOM Inspector, we see that the logic is quite simple.</p>
<p><a href="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_3.png" atomicselection="true" rel="lightbox"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="99" alt="Firefox DOM Inspector" src="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_thumb_3.png" width="127" border="0" /></a></p>
<p>The value of the ComboBox determines how the duration for which the custom view display the calendar. The value in the ComboBox is simply translated to the number of days. So I change the value to 42 (which is 6 weeks) and save my Settings.&nbsp;Et voilÃ , I get a custom view with 6 weeks <img src='http://www.smart-techie.com/blog/smilies/msn_smiley.png' alt='&#58;&#41;' class='wp-smiley' width='21' height='21' title='&#58;&#41;' /> Cool!</p>
<p><a href="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_4.png" atomicselection="true" rel="lightbox"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="99" alt="Customized Google Calendar" src="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_thumb_4.png" width="122" border="0"/></a></p>
<h3>Using Visual Studio with IE</h3>
<p>IE has a script debugger built in, but it is worthwhile to go in for Visual Studio as the debugger of choice. There&#8217;s a free version of the Visual Studio suite called the Express edition available which you can download and use.</p>
<p>Now to make it work&#8230;</p>
<ol>
<li>
<p>Enable Script debugging in Internet Explorer.</p>
<p><a href="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_5.png" atomicselection="true" rel="lightbox"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="99" alt="Internet Explorer Settings" src="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_thumb_5.png" width="78" border="0"/></a></p>
<li>
<p>Create a New Solution with an Empty Website (File &gt; New &gt; Web Site&#8230;)</p>
<p><a href="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/WebProject.png" atomicselection="true" rel="lightbox"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="87" alt="New WebSite Project" src="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/WebProject_thumb.png" width="132" border="0"/></a></p>
<li>
<p>Go to Property Pages for the new Website in Solution Explorer and enter the URL you want to debug. Don&#8217;t worry if you don&#8217;t know the URL, just enter any URL and fire the breakpoints only when you hit the required URL.</p>
<p><a href="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/PropertyPages.png" atomicselection="true" rel="lightbox"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="75" alt="Property Pages" src="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/PropertyPages_thumb.png" width="132" border="0"/></a></p>
<li>
<p>You might get a dialog asking you to include the web.config file. Answer Yes and continue. Now you will be surfing with the debugger attached to Internet Explorer. You can hit pause, set breakpoints and even skip those functions that don&#8217;t interest you <img src='http://www.smart-techie.com/blog/smilies/msn_wink.gif' alt='&#59;&#41;' class='wp-smiley' width='19' height='19' title='&#59;&#41;' /></p>
</li>
</ol>
<h3>Using&nbsp;Venkman with Firefox</h3>
<p><a href="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_6.png" atomicselection="true" rel="lightbox"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="99" alt="Venkman Firefox shortcut" src="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_thumb_6.png" width="56" border="0"/></a></p>
<p>I would have loved it if Visual Studio also worked with Firefox. There&#8217;s a solution called <a href="http://www.mozilla.org/projects/venkman/" target="_blank" rel="nofollow">Venkman</a>. I won&#8217;t go through the complete detail of how to go about using it, you can read it up <a href="http://www.mozilla.org/projects/venkman/venkman-walkthrough.html" target="_blank" rel="nofollow">here</a>.</p>
<p><a href="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_7.png" atomicselection="true" rel="lightbox"><img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="94" alt="Venkman Firefox" src="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_thumb_7.png" width="132" border="0"/></a></p>
<p>I haven&#8217;t found a way to skip code (a la Visual Studio) using this yet. </p>
<p>You can change variable values by directly typing the JavaScript code for it. </p>
<p>The interface doesn&#8217;t have all the bells and whistles but should be able to get most of your work done.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-techie.com/blog/2007/06/inspecting-web-interfaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Secure Web Interfaces</title>
		<link>http://www.smart-techie.com/blog/2007/06/creating-secure-web-interfaces/</link>
		<comments>http://www.smart-techie.com/blog/2007/06/creating-secure-web-interfaces/#comments</comments>
		<pubDate>Sun, 24 Jun 2007 11:47:55 +0000</pubDate>
		<dc:creator>Rohit</dc:creator>
				<category><![CDATA[Coding/ Programming]]></category>
		<category><![CDATA[Computing]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">http://www.smart-techie.com/blog/2007/06/creating-secure-web-interfaces/</guid>
		<description><![CDATA[On the Internet, security is overrated. Every third site you visit talks about it. But&#160;still, not many sites take steps to implement it. This has been the complaint of people all these years and is still true today. Unless it is a site that is dealing with financial transactions, most interfaces provided by these sites [...]]]></description>
			<content:encoded><![CDATA[<p>On the Internet, security is overrated. Every third site you visit talks about it. But&nbsp;still, not many sites take steps to implement it. This has been the complaint of people all these years and is still true today. Unless it is a site that is dealing with financial transactions, most interfaces provided by these sites are non-secure and prone to client side attacks. I believe it is a false assumption that unless your site is processing a credit card payments, it doesn&#8217;t need security. Security is not just about protecting &#8216;monetary transactions&#8217;. It is more than that, it involves protecting your computational resources (bandwidth, CPU usage), intellectual resources (JS files, web services) and of course, the services that the site is providing (like acting as a SMS gateway).</p>
<p>In this post I take a look at some ridiculously simple security blunders committed by popular sites. These might not always be critical but provide an interesting insight into the design quality metrics followed at these companies.</p>
<p>While surfing the Net, whenever I see a website offering a cool service, my natural instinct is to find out how they are doing it. For example, Rediff used to have this ActiveX based multilingual mail composition feature, which they replaced with a JavaScript based one. Cool! So now I could work on Firefox and still send my mail in Hindi! How (naively?) were they doing this? Create an IFrame and put the entire composition feature in it. Hmmm, OK, but couldn&#8217;t someone just rip off the JS files and create, say, a multilingual composition plugin for WordPress using their code. Access to the .js files doesn&#8217;t even require a login to the Rediff servers and using them is as easy as pointing the URL to <a title="http://f1mail.rediff.com/quill/QuillPadWeb.html" href="http://f1mail.rediff.com/quill/QuillPadWeb.html">http://f1mail.rediff.com/quill/QuillPadWeb.html</a>. I am not sure what their testing team (if they have one) thought of this, but this allows someone to use the cool text entry interface by just copying 4 files off the Rediff site.</p>
<p><a href="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image.png" atomicselection="true" rel="lightbox"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="76" alt="image" src="http://i104.photobucket.com/albums/m190/rohit_sud/Blog/image_thumb.png" width="132"/></a> </p>
<p>The easiest way to thwart leechers is to deny access to the scripts unless you are logged on. That would take care of <a href="http://en.wikipedia.org/wiki/Direct_linking" target="_blank">direct linking</a> (protecting computational resources). But there&#8217;s no easy solution if someone just copies the files off the server and hosts them on his website (protecting intellectual resources). What do you do then? Probably obfuscate the code enough so that he never knows what file he has to copy. Yahoo mail does an excellent job of the obfuscation. Even their images are <em>protected</em> (in a loose way) by referring them through their MD5 hashes; enough to deter a casual hacker.</p>
<p>Another flaw is doing all (and I mean <strong>ALL</strong>) the validation at the client side using JavaScript. Client side validation is a nice way to&nbsp;reduce load&nbsp;at the server end. But sometimes, this solution is implemented without safeguards.
<p>While designing any API, there is a golden rule that has to be followed&#8230; <code><br />
<blockquote>All input is evil</p></blockquote>
<p></code>
<p>Agreed, you have JS to check and ensure that the user input is correct. But what if I <a href="http://en.wikipedia.org/wiki/Code_injection" target="_blank">inject code</a> through your web service using a simple script debugger like Visual Studio for IE and <a href="http://www.mozilla.org/projects/venkman/" target="_blank" rel="nofollow">Venkman</a> for Firefox. Even if I am not able to inject code, I will certainly be able to inject syntactically valid input data which&nbsp;is still invalid.&nbsp;To illustrate, imagine a banking service where&nbsp;the amount that can be withdrawn is checked against current balance using JavaScript. I could very well skip the function, overwrite the function which gets the current balance and a lot more.&nbsp;Unless the server is checking the validity of the transaction itself, I&nbsp;would be able&nbsp;to make any kind of transaction.</p>
<p>In my <a href="http://www.smart-techie.com/blog/2007/06/inspecting-web-interfaces/">next post</a> I will discuss, some techniques that can be misused to thwart JavaScript based validations. The purpose of the post will be to further educate software designers about the pitfalls of client side validation which is not backed by robust server side validation.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.smart-techie.com/blog/2007/06/creating-secure-web-interfaces/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

