<?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>Grapii &#187; Security</title>
	<atom:link href="http://www.grapii.com/tag/security/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.grapii.com</link>
	<description>Personal Site of Raj Patel</description>
	<lastBuildDate>Mon, 06 Sep 2010 13:45:46 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Warning! Opera Mini for iPhone Security Risk</title>
		<link>http://www.grapii.com/2010/04/opera-mini-for-iphone-security-risk/</link>
		<comments>http://www.grapii.com/2010/04/opera-mini-for-iphone-security-risk/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 22:49:57 +0000</pubDate>
		<dc:creator>grapii</dc:creator>
				<category><![CDATA[Applications]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://www.grapii.com/?p=1070</guid>
		<description><![CDATA[Interesting video regarding Opera Mini for the iPhone.  Just aswell I prefer the built in Safari web browser.


]]></description>
			<content:encoded><![CDATA[<p>Interesting video regarding Opera Mini for the iPhone.  Just aswell I prefer the built in Safari web browser.</p>
<p><span id="more-1070"></span></p>
<p style="text-align: center;"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="500" height="412" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.youtube.com/v/_5TM-8YKPcA" /><embed type="application/x-shockwave-flash" width="500" height="412" src="http://www.youtube.com/v/_5TM-8YKPcA"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grapii.com/2010/04/opera-mini-for-iphone-security-risk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Form security using SESSION.SESSIONID</title>
		<link>http://www.grapii.com/2008/01/form-security-using-sessionsessionid/</link>
		<comments>http://www.grapii.com/2008/01/form-security-using-sessionsessionid/#comments</comments>
		<pubDate>Fri, 18 Jan 2008 10:03:47 +0000</pubDate>
		<dc:creator>grapii</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://www.grapii.com/?p=17</guid>
		<description><![CDATA[I&#8217;ve been having problems recently with attempted spamming exploits on my form to email scripts (i.e. users downloading forms, messing with them and then submitting them remotely to my form handling scripts) and thought I&#8217;d see if comparing the sessionID of the sending pages and form handling pages could help to weed out these fake [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having problems recently with attempted spamming exploits on my form to email scripts (i.e. users downloading forms, messing with them and then submitting them remotely to my form handling scripts) and thought I&#8217;d see if comparing the sessionID of the sending pages and form handling pages could help to weed out these fake submissions.<br />
<span id="more-17"></span><br />
I also thought it would be even more secure if the I used a hashed version of the SessionID.</p>
<p>First I included the <a href="http://www.grapii.com/?p=12" title="Display Encrypting Usernames &amp; Passwords">MD5 function</a> in both the sending and form handling pages as it isn&#8217;t included with ASP</p>
<pre>&lt;!--#include file="md5.asp"--&gt;</pre>
<p>Then I defined a variable for the hashed SessionID</p>
<pre>Dim strHashedSessionID
strHashedSessionID = MD5(Session.SessionID)</pre>
<p>Next I added the hashed SessionID to the querystring of the form handling page</p>
<pre>&lt;form method="post" action="formhandler.asp?sender="&gt;</pre>
<p>On the form handling page, I added a server-side error message, generated only if the two values don&#8217;t match</p>
<pre>&lt;%
If Not Request.QueryString("sender") = strHashedSessionID Then
 Response.Write "Authentication error: Please re-sumbit the form"
End If
%&gt;</pre>
<p>Finally, if the two values do match, the email is sent</p>
<pre>&lt;%
If Request.QueryString("sender") = strHashedSessionID Then
 'send the email using CDOSYS
End If
%&gt;</pre>
<p>After adding some additional server-side form validation, I added the additional security scripting to my <del><a href="http://www.grapii.com/contact.asp" title="Grapii Contact Form">contact form</a></del>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.grapii.com/2008/01/form-security-using-sessionsessionid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips for Classic ASP developers on Vista</title>
		<link>http://www.grapii.com/2008/01/tips-for-classic-asp-developers-on-vista/</link>
		<comments>http://www.grapii.com/2008/01/tips-for-classic-asp-developers-on-vista/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 16:31:33 +0000</pubDate>
		<dc:creator>grapii</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://www.grapii.com/?p=24</guid>
		<description><![CDATA[Installed Vista Ultimate the other day, after much customising, I finally got round to installing IIS, everything seemed to work fine, until I migrated my Classic ASP applications.  Stumbled across a whole bunch of issues, which I finally resolved thanks to a bit of research on Google, so I thought I’d share some of [...]]]></description>
			<content:encoded><![CDATA[<p align="left">Installed Vista Ultimate the other day, after much customising, I finally got round to installing IIS, everything seemed to work fine, until I migrated my Classic ASP applications.  Stumbled across a whole bunch of issues, which I finally resolved thanks to a bit of research on Google, so I thought I’d share some of these tips not only for others but also for myself in case I have to do it again in the future.</p>
<p><span id="more-24"></span></p>
<p class="info">There are a few changes in IIS7 which Classic ASP developers should be aware of.</p>
<h3>IUSR and IIS_IUSRS authorisation</h3>
<p>When you first fire up your browser to your local sites/apps, you may get this error:</p>
<p style="text-align: center"><a href="http://www.grapii.com/wp-content/uploads/2008/02/iis0005.jpg" rel="lightbox[24]"><img title="HTTP Error 401.3" src="http://www.grapii.com/wp-content/uploads/2008/02/iis0005-150x150.jpg" alt="HTTP Error 401.3" /></a></p>
<p>IIS process needs access to the physical location of the web site, in this case C:UsersHomeWebSites, however the IIS accounts in IIS7 have now changed:</p>
<ul>
<li>The IUSR built-in account replaces the IUSR_MachineName account</li>
<li>The IIS_IUSRS built-in group replaces the IIS_WPG group</li>
</ul>
<p>Assign these accounts to the Windows directory security with Read &amp; Execute; List Folder Contents; Read</p>
<p style="text-align: center"><a href="http://www.grapii.com/wp-content/uploads/2008/02/iis0001.gif" rel="lightbox[24]"><img title="Permissions for WebSites" src="http://www.grapii.com/wp-content/uploads/2008/02/iis0001-150x150.gif" alt="Permissions for WebSites" /></a></p>
<h3>ASP not installed by default</h3>
<p>If you’re moving from Windows XP to Windows Vista, you may be getting this error:</p>
<p style="text-align: center"><a href="http://www.grapii.com/wp-content/uploads/2008/02/iis0006.jpg" rel="lightbox[24]"><img title="HTTP Error 404.3" src="http://www.grapii.com/wp-content/uploads/2008/02/iis0006-150x113.jpg" alt="HTTP Error 404.3" /></a></p>
<p>This is usually the case when you haven’t installed the ASP component. Go to control panel &amp;gt; Programs and Features &amp;gt; Turn Windows features on or off &amp;gt; Internet Information Services &amp;gt; World Wide Web Services &amp;gt; Application Development Features.</p>
<p align="center"><a href="http://www.grapii.com/wp-content/uploads/2008/02/iis0002.gif" rel="lightbox[24]"><img title="Windows Features" src="http://www.grapii.com/wp-content/uploads/2008/02/iis0002-150x150.gif" alt="Windows Features" /></a></p>
<h3>Script errors no longer shown in browser by default</h3>
<p>As a result of security paranoia, Microsoft turned off ASP’s default behaviour of sending script errors (including line number and code snippet to the browser.  So instead of seeing the typical error you will now see this:</p>
<pre>An error occurred on the server when processing the URL. Please contact the system administrator</pre>
<p>To see the full error, like it was in IIS6, change the ‘Send Errors To Browser’ setting to ‘True’. Go to IIS Manager &amp;gt; ASP &amp;gt; Debugging Properties</p>
<p align="center"><a href="http://www.grapii.com/wp-content/uploads/2008/02/iis0003.gif" rel="lightbox[24]"><img title="IIS Manager - Send Errors to Browser" src="http://www.grapii.com/wp-content/uploads/2008/02/iis0003-150x150.gif" alt="IIS Manager - Send Errors to Browser" /></a></p>
<p>You should now see this style of error:</p>
<p style="text-align: center"><a href="http://www.grapii.com/wp-content/uploads/2008/02/iis0007.jpg" rel="lightbox[24]"><img title="Microsoft VBScript Error 800a03ea" src="http://www.grapii.com/wp-content/uploads/2008/02/iis0007-150x133.jpg" alt="Microsoft VBScript Error 800a03ea" /></a></p>
<h3>Parents paths disabled by default</h3>
<p>This is an old issue, which hits me all the time.  Parent paths by default have been disabled since IIS6 (Windows Server 2003), but in IIS5.1 (Windows XP) it was enabled.  So if your coming from Windows XP to Windows Vista, this will be new, however, I keep forgetting it’s disabled in IIS6 all the time, and no exception here.</p>
<p>The enableParentPaths setting determines where ASP “includes” should be allowed to escape the parent directory (e.g. ../../../includeFile.inc).   You’ll see this error by default if you try to escape the current directory:</p>
<p style="text-align: center"><a href="http://www.grapii.com/wp-content/uploads/2008/02/iis0008.jpg" rel="lightbox[24]"><img title="Active Server Pages Error ASP 0131" src="http://www.grapii.com/wp-content/uploads/2008/02/iis0008-150x122.jpg" alt="Active Server Pages Error ASP 0131" /></a></p>
<p>or you may see this error if you are using a path with ../ in it and your ADODB code</p>
<p style="text-align: center"><a href="http://www.grapii.com/wp-content/uploads/2008/02/iis0009.jpg" rel="lightbox[24]"><img title="Server.MapPath() Error ASP 0175:80004005" src="http://www.grapii.com/wp-content/uploads/2008/02/iis0009-150x114.jpg" alt="Server.MapPath() Error ASP 0175:80004005" /></a></p>
<p>To revert back to IIS 5.1 behavior, simply change the ‘Enable Parent Paths’ setting.<br />
Go to IIS Manager &amp;gt; ASP &amp;gt; Behaviour</p>
<p align="center"><a href="http://www.grapii.com/wp-content/uploads/2008/02/iis0004.gif" rel="lightbox[24]"><img title="IIS Manager - Enable Parent Paths" src="http://www.grapii.com/wp-content/uploads/2008/02/iis0004-150x150.gif" alt="IIS Manager - Enable Parent Paths" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grapii.com/2008/01/tips-for-classic-asp-developers-on-vista/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Reducing the Risk of SQL Injection Attack</title>
		<link>http://www.grapii.com/2008/01/reducing-the-risk-of-sql-injection-attack/</link>
		<comments>http://www.grapii.com/2008/01/reducing-the-risk-of-sql-injection-attack/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 13:18:47 +0000</pubDate>
		<dc:creator>grapii</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Forms]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://www.grapii.com/?p=7</guid>
		<description><![CDATA[Databases can be compromised if they are open to SQL Injection Attack. Stripping invalid characters from form inputs will reduce this risk.
If you have a form on your site that interacts with a database (e.g. a username/password login form), you should secure the form by adding an additional stage between submission and the database look-up. [...]]]></description>
			<content:encoded><![CDATA[<p class="note">Databases can be compromised if they are open to SQL Injection Attack. Stripping invalid characters from form inputs will reduce this risk.</p>
<p>If you have a form on your site that interacts with a database (e.g. a username/password login form), you should secure the form by adding an additional stage between submission and the database look-up. One way to do this is to check for valid content.<span id="more-7"></span></p>
<p>As usenames and passwords are usually strings of alphanumeric characters, you can strip out &#8216;bad&#8217; characters from the input string.<br />
The easiest way to do this is to collect the form&#8217;s input and check each character against a regular expression, removing any that are invalid.</p>
<p>The code below removes all non-alphanumeric characters from the input string:</p>
<pre>&lt;%
'gets the text submitted via a form
Dim strUsername, strPassword
strUsername = Request.Form("username")
strPassword = Request.Form("password")

'call the function to use
strUsername = stripString(strUsername)
strPassword = stripString(strPassword)

'function to strip all non-alphnumric characters
function stripString(strInput)
 Dim objRE
 Set objRE = New RegExp
 With objRE
  .Pattern = "[^A-Za-z0-9]"
  .Global = True
 End With
 stripChars = objRE.Replace(strInput, "")
 Set objRE = nothing
End Function
%&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.grapii.com/2008/01/reducing-the-risk-of-sql-injection-attack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Encrypting Usernames and Password</title>
		<link>http://www.grapii.com/2007/12/encrypting-usernames-and-password/</link>
		<comments>http://www.grapii.com/2007/12/encrypting-usernames-and-password/#comments</comments>
		<pubDate>Sat, 15 Dec 2007 13:15:59 +0000</pubDate>
		<dc:creator>grapii</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Web Apps]]></category>

		<guid isPermaLink="false">http://www.grapii.com/?p=12</guid>
		<description><![CDATA[Using the MD5 and SHA1 hash functions
If you&#8217;re using a login script on your site you probably store usernames and passwords in a database for authenticating the login.
For security reasons, you should never store these as plain text but should encrypt them with a one-way hash function such as md5 or sha1.

As neither of these [...]]]></description>
			<content:encoded><![CDATA[<p class="note">Using the MD5 and SHA1 hash functions</p>
<p>If you&#8217;re using a login script on your site you probably store usernames and passwords in a database for authenticating the login.</p>
<p>For security reasons, you should never store these as plain text but should encrypt them with a one-way hash function such as md5 or sha1.<br />
<span id="more-12"></span></p>
<p>As neither of these funtions are included with ASP, you&#8217;ll need to download and unzip the hash function you want to use and upload it to your webspace.</p>
<p>To use the functions, include the file in the pages you want to use hashing.</p>
<pre>&lt;!--#include file="md5.asp"--&gt;
or
&lt;!--#include file="sha1.asp"--&gt;</pre>
<p>Then you simply call the function with either:</p>
<pre>&lt;% MD5("string") or SHA1("string") %&gt;</pre>
<p>For example, if you wanted to encrypt a Username and Password on a signup form, you would collect the Username and Password from the submitted form, hash them and then insert the hashed values into your database</p>
<pre>&lt;%
strHashedUsername = MD5(Request.Form("Username"))
strHashedPassword = MD5(Request.Form("Password"))
%&gt;</pre>
<p>To authenticate a user who is attempting to sign in, Hash the username and Password from the form and compare these with the strHashedUsername and strHashedPassword stored in your database.</p>
<p>If a user forgets their password you&#8217;ll need to generate a new, pseudo-random password for the user as hashing is one-way can&#8217;t be unencrypted.</p>
<p><small>Downloads: <a title="MD5" href="http://resource.grapii.com/md5.zip">md5.zip</a> <a title="SHA1" href="http://resource.grapii.com/sha1.zip">sha1.zip</a></small></p>
]]></content:encoded>
			<wfw:commentRss>http://www.grapii.com/2007/12/encrypting-usernames-and-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
