<?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; security</title>
	<atom:link href="http://www.certpal.com/blogs/tag/security/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>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>Debugging HTTPS traffic</title>
		<link>http://www.certpal.com/blogs/2009/12/debugging-https-traffic/</link>
		<comments>http://www.certpal.com/blogs/2009/12/debugging-https-traffic/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 05:49:11 +0000</pubDate>
		<dc:creator>CertPal</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.certpal.com/blogs/?p=495</guid>
		<description><![CDATA[If you have to deal with HTTPS traffic and sniff it, it is possible. Learn a trick that debugging proxies use to analyze secure data and how they work around it. There are some drawbacks however, but developers can work around them.]]></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%2Fdebugging-https-traffic%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F12%2Fdebugging-https-traffic%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-503" title="security_lock" src="http://www.certpal.com/blogs/wp-content/uploads/security_lock.png" alt="security_lock" width="79" height="104" />There are times when you work with SSL traffic. Your website might be protected with a certificate so that traffic between you and the client is secure. At times like this, being a developer is troublesome. Browser cache settings need to be analyzed by looking at the HTTP headers. Encoding / Content type may need to be analyzed to ensure that a particular page is displayed correctly. These things cannot be looked into if the traffic is secure. There are situations under which the environment is secure but you must still sniff the data. So how do you manage this ?</p>
<p>Tools like <a href="http://www.charlesproxy.com/" target="_blank">Charles </a>(A debugging proxy) help you do this. Charles allows you to proxy to a secure connection over a protocol like HTTPS and still read the traffic. So how does it do this ? Lets have a look.</p>
<p>Your environment probably has a self signed certificate like the one issued below, using keytool.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">keytool <span style="color: #339933;">-</span>genkey <span style="color: #339933;">-</span>keyalg RSA <span style="color: #339933;">-</span>keysize <span style="color: #cc66cc;">1024</span> <span style="color: #339933;">-</span>alias example.<span style="color: #006633;">com</span> <span style="color: #339933;">-</span>keystore mystore.<span style="color: #006633;">ks</span> <span style="color: #339933;">-</span>validity <span style="color: #cc66cc;">9999</span>
&nbsp;
keytool <span style="color: #339933;">-</span>list <span style="color: #339933;">-</span>keystore .<span style="color: #339933;">/</span>mystore.<span style="color: #006633;">ks</span> <span style="color: #339933;">-</span>v
&nbsp;
Enter keystore password<span style="color: #339933;">:</span>  changeit
&nbsp;
Keystore type<span style="color: #339933;">:</span> jks
Keystore provider<span style="color: #339933;">:</span> SUN
&nbsp;
Your keystore contains <span style="color: #cc66cc;">1</span> entry
&nbsp;
Alias name<span style="color: #339933;">:</span> example.<span style="color: #006633;">com</span>
Creation date<span style="color: #339933;">:</span> Dec <span style="color: #cc66cc;">21</span>, <span style="color: #cc66cc;">2009</span>
Entry type<span style="color: #339933;">:</span> keyEntry
<span style="color: #003399;">Certificate</span> chain length<span style="color: #339933;">:</span> <span style="color: #cc66cc;">1</span>
<span style="color: #003399;">Certificate</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span>
<span style="color: #003399;">Owner</span><span style="color: #339933;">:</span> CN<span style="color: #339933;">=</span>www.<span style="color: #006633;">org</span>.<span style="color: #006633;">com</span>, OU<span style="color: #339933;">=</span>Org, O<span style="color: #339933;">=</span>SomeCompany, L<span style="color: #339933;">=</span>Somewhere, ST<span style="color: #339933;">=</span>Someplace, C<span style="color: #339933;">=</span>US
Issuer<span style="color: #339933;">:</span> CN<span style="color: #339933;">=</span>www.<span style="color: #006633;">org</span>.<span style="color: #006633;">com</span>, OU<span style="color: #339933;">=</span>Org, O<span style="color: #339933;">=</span>SomeCompany, L<span style="color: #339933;">=</span>Somewhere, ST<span style="color: #339933;">=</span>Someplace, C<span style="color: #339933;">=</span>US
Serial number<span style="color: #339933;">:</span> 4b2ef9e0
Valid from<span style="color: #339933;">:</span> Mon Dec <span style="color: #cc66cc;">21</span> <span style="color: #cc66cc;">10</span><span style="color: #339933;">:</span>00<span style="color: #339933;">:</span><span style="color: #cc66cc;">24</span> GMT<span style="color: #339933;">+</span>05<span style="color: #339933;">:</span><span style="color: #cc66cc;">30</span> <span style="color: #cc66cc;">2009</span> until<span style="color: #339933;">:</span> Thu May 07 <span style="color: #cc66cc;">10</span><span style="color: #339933;">:</span>00<span style="color: #339933;">:</span><span style="color: #cc66cc;">24</span> GMT<span style="color: #339933;">+</span>05<span style="color: #339933;">:</span><span style="color: #cc66cc;">30</span> <span style="color: #cc66cc;">2037</span>
<span style="color: #003399;">Certificate</span> fingerprints<span style="color: #339933;">:</span>
MD5<span style="color: #339933;">:</span>  XX<span style="color: #339933;">:</span>XX<span style="color: #339933;">:</span>XX...
<span style="color: #006633;">SHA1</span><span style="color: #339933;">:</span> XX<span style="color: #339933;">:</span>XX<span style="color: #339933;">:</span>XX...
&nbsp;
<span style="color: #339933;">*******************************************</span>
<span style="color: #339933;">*******************************************</span></pre></div></div>

<p>When a certificate like this one is presented to a web browser, it will look like so. Let&#8217;s extract the certificate and open it up.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">keytool <span style="color: #339933;">-</span>export <span style="color: #339933;">-</span>keystore .<span style="color: #339933;">/</span>mystore.<span style="color: #006633;">ks</span> <span style="color: #339933;">-</span>file .<span style="color: #339933;">/</span>testtex.<span style="color: #006633;">crt</span> <span style="color: #339933;">-</span>alias example.<span style="color: #006633;">com</span></pre></div></div>

<p><strong>Untrusted self signed certificate:</strong></p>
<p><img class="aligncenter size-full wp-image-496" title="cert_not_trusted" src="http://www.certpal.com/blogs/wp-content/uploads/cert_not_trusted.png" alt="cert_not_trusted" width="345" height="355" /></p>
<p>Our certificate is obviously not trusted since it is self signed. A certificate signed by a CA will not exhibit a security warning. Like the one presented by google for the gmail login page, which is shown below</p>
<p><strong>Trusted certificate from google.com:</strong></p>
<p><img class="aligncenter size-full wp-image-498" title="google_cert_hierarchy" src="http://www.certpal.com/blogs/wp-content/uploads/google_cert_hierarchy.png" alt="google_cert_hierarchy" width="511" height="361" /></p>
<p>When you start a proxy that has HTTPS support, say charles for instance, it does the magic by inserting its own certificate into the certificate hierarchy. The Charles CA Certificate, now becomes the root certificate in this hierarchy, allowing it to decrypt the information that is sent between the client and server.</p>
<p><strong>Modified certificate hierarchy:</strong></p>
<p><img class="aligncenter size-full wp-image-499" title="charles_google_cert" src="http://www.certpal.com/blogs/wp-content/uploads/charles_google_cert.png" alt="charles_google_cert" width="520" height="611" /></p>
<p>Charles signs the certificate that google presents, so it will now be able to decrypt the information that is sent by the server. However the side effect is that your browser will no longer trust this certificate since the root CA is not in your trusted store.</p>
<p><strong>Untrusted connection due to modified hierarchy:</strong></p>
<p><img class="aligncenter size-full wp-image-500" title="charles_connection_not_trusted" src="http://www.certpal.com/blogs/wp-content/uploads/charles_connection_not_trusted.png" alt="charles_connection_not_trusted" width="574" height="308" /></p>
<p>You can get over the problem by importing the certificate or installing it into the MS trust store. This is one technique that proxies use to debug traffic. Know of another method / proxy software ?  Leave a comment. Happy debugging <img src='http://www.certpal.com/blogs/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<script type="text/javascript">var dzone_url = 'http://www.certpal.com/blogs/2009/12/debugging-https-traffic/';</script><br />
<script type="text/javascript">var dzone_title = 'Debugging HTTPS traffic';</script><br />
<script type="text/javascript">var dzone_blurb = '[description]';</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%2F12%2Fdebugging-https-traffic%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.certpal.com%2Fblogs%2F2009%2F12%2Fdebugging-https-traffic%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/debugging-https-traffic/feed/</wfw:commentRss>
		<slash:comments>2</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>

