<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: login (security through obscurity) &#8211; weird PHP script</title>
	<atom:link href="http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/</link>
	<description>Ethical Hacking, Penetration Testing &#38; Computer Security</description>
	<lastBuildDate>Sun, 08 Nov 2009 07:15:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sandeep nain</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-64081</link>
		<dc:creator>Sandeep nain</dc:creator>
		<pubDate>Mon, 10 Sep 2007 01:37:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-64081</guid>
		<description>Yes you are right and thats what Backbone has tried to explain above.

he clearly mentions that in the script he has given you need not to do that...

Backbone  said:
&lt;B&gt;As far as I see through this method there is no SQL Injection possibility, no need of mysql_real_escape_string() or to worry about hex encoded strings, etc&lt;/B&gt;

and he is trying to implement security through obscurity...</description>
		<content:encoded><![CDATA[<p>Yes you are right and thats what Backbone has tried to explain above.</p>
<p>he clearly mentions that in the script he has given you need not to do that&#8230;</p>
<p>Backbone  said:<br />
<b>As far as I see through this method there is no SQL Injection possibility, no need of mysql_real_escape_string() or to worry about hex encoded strings, etc</b></p>
<p>and he is trying to implement security through obscurity&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sank</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-64074</link>
		<dc:creator>Sank</dc:creator>
		<pubDate>Sun, 09 Sep 2007 20:15:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-64074</guid>
		<description>As long as you remove quotes and slashes and whatnot, you should be able to prevent the injection.</description>
		<content:encoded><![CDATA[<p>As long as you remove quotes and slashes and whatnot, you should be able to prevent the injection.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandeep nain</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-64045</link>
		<dc:creator>Sandeep nain</dc:creator>
		<pubDate>Sun, 09 Sep 2007 07:15:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-64045</guid>
		<description>Hi sank

Yes you are right he could have used the method you suggested (and most of the developers use it the same way) but it opens up the chances of sql injection..

where as the script written by backbone reduces that risk but on the other hand this script lacks performace... As this script gonna give a shocking performance on a table with 1000s of users....

irony is .... he got a prize for this script... but still its a good try from his side</description>
		<content:encoded><![CDATA[<p>Hi sank</p>
<p>Yes you are right he could have used the method you suggested (and most of the developers use it the same way) but it opens up the chances of sql injection..</p>
<p>where as the script written by backbone reduces that risk but on the other hand this script lacks performace&#8230; As this script gonna give a shocking performance on a table with 1000s of users&#8230;.</p>
<p>irony is &#8230;. he got a prize for this script&#8230; but still its a good try from his side</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sank</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-64042</link>
		<dc:creator>Sank</dc:creator>
		<pubDate>Sun, 09 Sep 2007 03:35:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-64042</guid>
		<description>I don&#039;t understand why you go through the trouble of looping instead of just letting the database do it for you?

&lt;code&gt;$build = &quot;SELECT * FROM usr WHERE uname=&#039;&quot;.$uname.&quot;&#039; AND passwd=&#039;&quot; .md5($passwd). &quot;&#039;;&lt;/code&gt;

If zero rows returned, done. Else 1 row returned, done.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t understand why you go through the trouble of looping instead of just letting the database do it for you?</p>
<p><code>$build = "SELECT * FROM usr WHERE uname='".$uname."' AND passwd='" .md5($passwd). "';</code></p>
<p>If zero rows returned, done. Else 1 row returned, done.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: secure PHP login script &#171; Insane Security</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-61813</link>
		<dc:creator>secure PHP login script &#171; Insane Security</dc:creator>
		<pubDate>Thu, 02 Aug 2007 02:11:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-61813</guid>
		<description>[...] 2nd, 2007   This is the finalization of the insane idea I had when publishing the  login (security through obscurity) - weird PHP script, idea that could not have been finalized without the post that Stephen did as a response to [...]</description>
		<content:encoded><![CDATA[<p>[...] 2nd, 2007   This is the finalization of the insane idea I had when publishing the  login (security through obscurity) &#8211; weird PHP script, idea that could not have been finalized without the post that Stephen did as a response to [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bl</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58179</link>
		<dc:creator>bl</dc:creator>
		<pubDate>Mon, 07 May 2007 17:22:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58179</guid>
		<description>I agree with those that think this is a bit overkill and think that there are better solutions.

1.  Loop through the results like the person said above.

2.  Use mysql_real_escape_string() Like someone else said

3.  or, don&#039;t allow anything except for word chars in their username, and use preg_replace(&#039;/[^\w]/&#039;, &#039;&#039;, $usr);

That will strip any non-word chars out thus sanitizing it on the way in, which is a technique used time and time again.

I admit though, it is pretty clever.</description>
		<content:encoded><![CDATA[<p>I agree with those that think this is a bit overkill and think that there are better solutions.</p>
<p>1.  Loop through the results like the person said above.</p>
<p>2.  Use mysql_real_escape_string() Like someone else said</p>
<p>3.  or, don&#8217;t allow anything except for word chars in their username, and use preg_replace(&#8217;/[^\w]/&#8217;, &#8221;, $usr);</p>
<p>That will strip any non-word chars out thus sanitizing it on the way in, which is a technique used time and time again.</p>
<p>I admit though, it is pretty clever.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: UndiFineD</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58044</link>
		<dc:creator>UndiFineD</dc:creator>
		<pubDate>Thu, 03 May 2007 22:25:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58044</guid>
		<description>Hmmm,
I&#039;ve been out of the lamp loop for a while...

moved on to data centre management.

oh and my login script was for an intranet environment, 
just to be clear on the query mess.
Still, I think this is an ok solution, for some situations.
And creativety should be sponsored and welcomed with open arms.
There aren&#039;t enough developers and designers and some them lack proper guidans thru proper management and training.</description>
		<content:encoded><![CDATA[<p>Hmmm,<br />
I&#8217;ve been out of the lamp loop for a while&#8230;</p>
<p>moved on to data centre management.</p>
<p>oh and my login script was for an intranet environment,<br />
just to be clear on the query mess.<br />
Still, I think this is an ok solution, for some situations.<br />
And creativety should be sponsored and welcomed with open arms.<br />
There aren&#8217;t enough developers and designers and some them lack proper guidans thru proper management and training.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: backbone</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58040</link>
		<dc:creator>backbone</dc:creator>
		<pubDate>Thu, 03 May 2007 20:14:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58040</guid>
		<description>10x UndiFineD added that to the loop... as I knew just really old,old,old while(1) { write(&#039;old&#039;); } versions of PHP where vulnerable to this...</description>
		<content:encoded><![CDATA[<p>10x UndiFineD added that to the loop&#8230; as I knew just really old,old,old while(1) { write(&#8217;old&#8217;); } versions of PHP where vulnerable to this&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: UndiFineD</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58032</link>
		<dc:creator>UndiFineD</dc:creator>
		<pubDate>Thu, 03 May 2007 14:01:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58032</guid>
		<description>He man, that was a great idea.
Unfortunatly there was a little flaw when I wrote it like this 2 years ago.

Some employees had the same password.
That was a sad day for me :(
I solved it by comparing an array of userids in a loop.
until the userid was found or the array was empty.

set your $ok=0; in the loop, this helps against 
login.php?$ok=1

stay creative :)</description>
		<content:encoded><![CDATA[<p>He man, that was a great idea.<br />
Unfortunatly there was a little flaw when I wrote it like this 2 years ago.</p>
<p>Some employees had the same password.<br />
That was a sad day for me <img src='http://www.darknet.org.uk/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /><br />
I solved it by comparing an array of userids in a loop.<br />
until the userid was found or the array was empty.</p>
<p>set your $ok=0; in the loop, this helps against<br />
login.php?$ok=1</p>
<p>stay creative <img src='http://www.darknet.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: backbone</title>
		<link>http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58026</link>
		<dc:creator>backbone</dc:creator>
		<pubDate>Thu, 03 May 2007 13:06:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.darknet.org.uk/2007/04/login-security-through-obscurity-weird-php-script/#comment-58026</guid>
		<description>that&#039;s how my logic works.... why do you think it&#039;s a weird script? ;) ...anyway I&#039;ve put your double equals, don&#039;t blame me if I use to write single equals...</description>
		<content:encoded><![CDATA[<p>that&#8217;s how my logic works&#8230;. why do you think it&#8217;s a weird script? <img src='http://www.darknet.org.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  &#8230;anyway I&#8217;ve put your double equals, don&#8217;t blame me if I use to write single equals&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
