<?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"
	>

<channel>
	<title>cqure.net</title>
	<atom:link href="http://www.cqure.net/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cqure.net/wp</link>
	<description></description>
	<pubDate>Thu, 29 May 2008 18:02:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>OWASP - Sweden meeting</title>
		<link>http://www.cqure.net/wp/2008/05/owasp-sweden-meeting-20080527/</link>
		<comments>http://www.cqure.net/wp/2008/05/owasp-sweden-meeting-20080527/#comments</comments>
		<pubDate>Thu, 29 May 2008 18:01:53 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<category><![CDATA[injection]]></category>

		<category><![CDATA[meeting]]></category>

		<category><![CDATA[owasp]]></category>

		<category><![CDATA[presentation]]></category>

		<category><![CDATA[sql]]></category>

		<category><![CDATA[sweden]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=67</guid>
		<description><![CDATA[My presentation from the Swedish OWASP meeting the other day is now online.
I spoke about SQL injection (again), efficient UNION exploitation, OOB channels and DNS-tunneling in MSSql, Oracle and MySQL.
The presentation, DNS-server tool and a minimal cheat sheet can be found here.
I had a great time and enjoyed meeting friends, colleagues and listening to the [...]]]></description>
			<content:encoded><![CDATA[<p>My presentation from the Swedish OWASP meeting the other day is now online.<br />
I spoke about SQL injection (again), efficient UNION exploitation, OOB channels and DNS-tunneling in MSSql, Oracle and MySQL.</p>
<p>The presentation, DNS-server tool and a minimal cheat sheet can be found <a title="http://www.cqure.net/files/OWASP%20-%20Sweden%20-%2020080527%20-%20SQL%20injection.zip" href="http://www.cqure.net/files/OWASP%20-%20Sweden%20-%2020080527%20-%20SQL%20injection.zip">here</a>.<br />
I had a great time and enjoyed meeting friends, colleagues and listening to the other speaches.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2008/05/owasp-sweden-meeting-20080527/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MSSQLScan 0.8 released</title>
		<link>http://www.cqure.net/wp/2008/05/mssqlscan-08-released/</link>
		<comments>http://www.cqure.net/wp/2008/05/mssqlscan-08-released/#comments</comments>
		<pubDate>Sat, 03 May 2008 11:22:22 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=66</guid>
		<description><![CDATA[I made some minor adjustments and bugfixes to the 0.7 release and released 0.8. MSSQLScan should now support a graceous shutdown when doing a ctrl-break and not skip hosts when running out of sockets.
Get it here.
]]></description>
			<content:encoded><![CDATA[<p>I made some minor adjustments and bugfixes to the 0.7 release and released 0.8. MSSQLScan should now support a graceous shutdown when doing a ctrl-break and not skip hosts when running out of sockets.</p>
<p>Get it <a href="http://www.cqure.net/wp/mssqlscan/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2008/05/mssqlscan-08-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New tool DBPwAudit</title>
		<link>http://www.cqure.net/wp/2008/05/new-tool-dbpwaudit/</link>
		<comments>http://www.cqure.net/wp/2008/05/new-tool-dbpwaudit/#comments</comments>
		<pubDate>Thu, 01 May 2008 17:56:11 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<category><![CDATA[db2]]></category>

		<category><![CDATA[guess]]></category>

		<category><![CDATA[ibm]]></category>

		<category><![CDATA[mssql]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[oracle]]></category>

		<category><![CDATA[password]]></category>

		<category><![CDATA[quality]]></category>

		<category><![CDATA[sqlserver]]></category>

		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=65</guid>
		<description><![CDATA[I have released a new tool that can be used to verify password quality against several database engines. Make sure to check it out here.
]]></description>
			<content:encoded><![CDATA[<p>I have released a new tool that can be used to verify password quality against several database engines. Make sure to check it out <a href="http://www.cqure.net/wp/?page_id=64">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2008/05/new-tool-dbpwaudit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MSSQLScan version 0.7 released</title>
		<link>http://www.cqure.net/wp/2008/05/mssqlscan-version-07-released/</link>
		<comments>http://www.cqure.net/wp/2008/05/mssqlscan-version-07-released/#comments</comments>
		<pubDate>Thu, 01 May 2008 08:42:43 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<category><![CDATA[discover]]></category>

		<category><![CDATA[mssql]]></category>

		<category><![CDATA[mssql2000]]></category>

		<category><![CDATA[mssql2005]]></category>

		<category><![CDATA[mssql2008]]></category>

		<category><![CDATA[nmap]]></category>

		<category><![CDATA[port scan]]></category>

		<category><![CDATA[scan]]></category>

		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=63</guid>
		<description><![CDATA[I have released a new version of my MSSQLScan tool. It contains fixes for running out of sockets when scanning large networks with low timeouts and re-scheduling of unsuccesful probes.
Let me know how/if it works and please send me bug reports.
]]></description>
			<content:encoded><![CDATA[<p>I have released a new version of my MSSQLScan tool. It contains fixes for running out of sockets when scanning large networks with low timeouts and re-scheduling of unsuccesful probes.</p>
<p>Let me know how/if it works and please send me bug reports.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2008/05/mssqlscan-version-07-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>New blog</title>
		<link>http://www.cqure.net/wp/2008/04/new-blog/</link>
		<comments>http://www.cqure.net/wp/2008/04/new-blog/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 21:06:32 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=62</guid>
		<description><![CDATA[I have launched a new blog with &#8220;random thoughts about random things&#8221; &#8230; The reason why I&#8217;m launching a new site when barely keeping up with this one is that I want to keep this one security oriented while the new one a bit more &#8220;random&#8221;. The new blog can be found here http://patrik.cqure.net.
I&#8217;m guessing [...]]]></description>
			<content:encoded><![CDATA[<p>I have launched a new blog with &#8220;random thoughts about random things&#8221; &#8230; The reason why I&#8217;m launching a new site when barely keeping up with this one is that I want to keep this one security oriented while the new one a bit more &#8220;random&#8221;. The new blog can be found here <a href="http://patrik.cqure.net">http://patrik.cqure.net</a>.</p>
<p>I&#8217;m guessing we might have to outdated blogs in a couple of weeks <img src='http://www.cqure.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2008/04/new-blog/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Simplifying enumeration by error messages</title>
		<link>http://www.cqure.net/wp/2007/11/simplifying-enumeration-by-error-messages/</link>
		<comments>http://www.cqure.net/wp/2007/11/simplifying-enumeration-by-error-messages/#comments</comments>
		<pubDate>Wed, 28 Nov 2007 20:30:06 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<category><![CDATA[error messages]]></category>

		<category><![CDATA[injection]]></category>

		<category><![CDATA[microsoft sql server]]></category>

		<category><![CDATA[sql]]></category>

		<category><![CDATA[sql-injection]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=61</guid>
		<description><![CDATA[I have been experimenting with SQL-injection and information enumeration through error messages for a while.
The idea was to simplify the process of extracting data so that very little application logic would be needed to perform the task. Ideally a simple 3-5 line bash-script wrapping wget or curl should do the trick.
So a short recap: In [...]]]></description>
			<content:encoded><![CDATA[<p>I have been experimenting with SQL-injection and information enumeration through error messages for a while.<br />
The idea was to simplify the process of extracting data so that very little application logic would be needed to perform the task. Ideally a simple 3-5 line bash-script wrapping wget or curl should do the trick.</p>
<p><span id="more-61"></span>So a short recap: In order to successfully extract information through error messages;<br />
- The application has to be vulnerable to SQL-injection<br />
- The web server has to return detailed error information<br />
- The vulnerable SQL-statement has to be forced into an error condition</p>
<p>The information we want to extract should be placed so that it becomes a part of the returned error.<br />
This could typically be achieved by converting varchar values to integer or numeric values eg.</p>
<p>Consider a vulnerable authentication function that concatenates the username into a template SQL statement.<br />
We manipulate the username and insert the following: <em>&#8216; OR 1=@@version &#8211;</em><br />
The resulting SQL-statement, that follows below, triggers an error condition in which the database version information is disclosed.<br />
<em>SELECT userid FROM appusers WHERE username=&#8221; OR 1=@@version &#8212; AND password=&#8221;</em></p>
<p>The error message returned by the web server is:<br />
<em>Syntax error converting the nvarchar value &#8216;Microsoft SQL Server  2000 - 8.00.760 (Intel X86)<br />
Dec 17 2002 14:22:05<br />
Copyright (c) 1988-2003 Microsoft Corporation<br />
Desktop Engine on Windows NT 5.1 (Build 2600: Service Pack 2)<br />
&#8216; to a column of data type int.</em></p>
<p>This could easily be adapted to extract any information from any table. I will not go into details about finding database columns and tables but it involves looking into the sysobjects and syscolumns tables. Let&#8217;s assume we have found the appusers table from which we would like to extract information. This time we insert the following: <em>&#8216; OR 1=(SELECT TOP 1 username+&#8217;,'+password FROM appusers) &#8211;</em></p>
<p>We end up with the following SQL-statement triggering an error condition in which the first users username and password is disclosed.<br />
<em>SELECT id FROM appusers WHERE username=&#8221; OR 1=(SELECT TOP 1 username+&#8217;,'+password FROM appusers) &#8211;</em></p>
<p>The error message returned by the server is:<br />
<em>Syntax error converting the varchar value &#8216;admin,p4ssw0rd&#8217; to a column of data type int.</em></p>
<p>In order to trigger our error condition we need to return a single row as specified by the TOP 1 statement.<br />
So, in order to enumerate 20000 rows we need to add additional conditions to our subselect. Knowing an account (admin) we could simply add: <em>WHERE username &lt;&gt; &#8216;admin&#8217;</em></p>
<p>However, this would require us to process each answer and change our statement according to it&#8217;s outcome. What we want to achieve instead is to create a simple loop from which we can ask for a specific row number eg. 1 followed by 2, 3, 4, etc. This could easily be performed if our primary key is a numeric value in a non broken serie but not if our key is a GUID or of the data-type UNIQUEIDENTIFIER.</p>
<p>The approach I took was to stick an additional column specifying the row number to the columns I was interessted in. In our case with the appusers this would then look something like this:</p>
<p>rowno  user    password<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
1      admin   p4ssw0rd<br />
2      patrik  secret<br />
3      mattias haxxor</p>
<p>Now we could simply query for the second row in our user table in order to get my password. Adding rownumbers could probably be performed by creating a temporary table and copying data into it. In cases where the permissions are strict or we do not want to change the tested environment we need to perform the task in one go.</p>
<p>So given the layout of the appuser table the following statement would give us the table outlined above:<br />
<em>SELECT (SELECT COUNT(*) FROM appusers a2 WHERE a2.id&lt;=a1.id), username, password FROM appusers a1 </em></p>
<p>In order to exploit the application so that the error message would contain the username and password of the second row we would need to login using the following username:<br />
<em>&#8216; OR 1=(SELECT username+&#8217;,'+password FROM appusers a1 WHERE (SELECT COUNT(*) FROM appusers a2 WHERE a2.id&lt;=a1.id) = 2) &#8211;</em></p>
<p>So now we can simply ask for the next row by increasing the last number in our statement regardless of the data returned by the server.  Automating the enumeration of 20000 rows can now be done in a 3 line bash script and is left as an exercise to the reader.</p>
<p>So what can we do to restrict the possibility of mounting such an attack?<br />
1.  Perform security tests of applications prior to deploying them<br />
2.  Implement proper hardening guides and procedures for all system components<br />
3.  Educate system developers and project managers of the risks with poorly developed applications</p>
<p>/Patrik</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2007/11/simplifying-enumeration-by-error-messages/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MSSQLScan 0.6 release</title>
		<link>http://www.cqure.net/wp/2007/10/mssqlscan-06-release/</link>
		<comments>http://www.cqure.net/wp/2007/10/mssqlscan-06-release/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 22:01:00 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=60</guid>
		<description><![CDATA[I finally got to publishing a tool, which due to a number of reasons, has not happened for quite some time now. The MSSQLScan tool scans for Microsoft SQL Server *surprise*. It does so by using UDP which means that it can either discover servers by hitting a broadcast address or by querying each and [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got to publishing a tool, which due to a number of reasons, has not happened for quite some time now. The MSSQLScan tool scans for Microsoft SQL Server *surprise*. It does so by using UDP which means that it can either discover servers by hitting a broadcast address or by querying each and everyone. This will make sure that you find all instances and servers that no longer use the 1433 TCP port due to dynamic port allocations.</p>
<p>As usual your more than welcome to provide me with feedback, suggestions or bug reports.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2007/10/mssqlscan-06-release/feed/</wfw:commentRss>
		</item>
		<item>
		<title>T2 Security Conference</title>
		<link>http://www.cqure.net/wp/2007/10/t2-security-conference/</link>
		<comments>http://www.cqure.net/wp/2007/10/t2-security-conference/#comments</comments>
		<pubDate>Wed, 17 Oct 2007 21:55:54 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=59</guid>
		<description><![CDATA[I attended the T2 security conference last Friday where I presented a talk on SQL injection and out-of-band channelling. Unfortunately I wasn&#8217;t able to stay for the whole conference but the talks I attended were very good. Make sure to check it out next year. Hopefully, I will have a chance to publish my updated [...]]]></description>
			<content:encoded><![CDATA[<p>I attended the <a href="http://www.t2.fi">T2</a> security conference last Friday where I presented a talk on SQL injection and out-of-band channelling. Unfortunately I wasn&#8217;t able to stay for the whole conference but the talks I attended were very good. Make sure to check it out next year. Hopefully, I will have a chance to publish my updated slides during this week.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2007/10/t2-security-conference/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Oracle 11g password security</title>
		<link>http://www.cqure.net/wp/2007/09/oracle-11g-password-security/</link>
		<comments>http://www.cqure.net/wp/2007/09/oracle-11g-password-security/#comments</comments>
		<pubDate>Mon, 24 Sep 2007 17:36:33 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=57</guid>
		<description><![CDATA[Finally, Oracle has made changes to the way they store passwords. Oracle 11g introduces a different algorithm (SHA1), supports mixed-case passwords and adds salts to stored passwords. This all sounds great EXCEPT that the old weaker hashes are still being stored in the sys.user$ table.
It seems as if several different people have been looking in [...]]]></description>
			<content:encoded><![CDATA[<p>Finally, Oracle has made changes to the way they store passwords. Oracle 11g introduces a different algorithm (SHA1), supports mixed-case passwords and adds salts to stored passwords. This all sounds great EXCEPT that the old weaker hashes are still being stored in the sys.user$ table.</p>
<p>It seems as if several different people have been looking in to this at more or less the same time and have documented their efforts. One of them is Pete Finnigan <a href="http://www.petefinnigan.com/weblog/archives/00001097.htm" title="http://www.petefinnigan.com/weblog/archives/00001097.htm">http://www.petefinnigan.com/weblog/archives/00001097.htm</a>. Recurity Labs have done a more technical analysis of the 150Mb Oracle Linux binary <a href="http://www.phenoelit.net/lablog/oracle.sl" title="http://www.phenoelit.net/lablog/oracle.sl">http://www.phenoelit.net/lablog/oracle.sl</a> and conclude their work with this excellent comment:</p>
<p>&#8220;And we would like to welcome Oracle Corp. in the year 2007, the century of highly advanced, mixed-case passwords. <img src='http://www.cqure.net/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  It should be noted that Oracle, in fine tradition, makes the same mistake  Microsoft did a decade ago when they put the insecure LANMAN hash next to the brand new NTLM one. The table sys.user$ still holds the case insensitive DES encrypted password version next to the new one.&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2007/09/oracle-11g-password-security/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Passing-the-hash for everyone</title>
		<link>http://www.cqure.net/wp/2007/08/passing-the-hash-for-everyone/</link>
		<comments>http://www.cqure.net/wp/2007/08/passing-the-hash-for-everyone/#comments</comments>
		<pubDate>Thu, 16 Aug 2007 12:53:07 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=56</guid>
		<description><![CDATA[Core security released their PSH (passing-the-hash) toolkit today. Even though the concept of passing-the-hash is old, few tools putting it into practise have been available to the public. A number of companies working within security industry have had their own tools, some being more proud of them than others  I myself attempted to write [...]]]></description>
			<content:encoded><![CDATA[<p>Core security released their PSH (passing-the-hash) toolkit today. Even though the concept of passing-the-hash is old, few tools putting it into practise have been available to the public. A number of companies working within security industry have had their own tools, some being more proud of them than others <img src='http://www.cqure.net/wp/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> I myself attempted to write a generic proxy implementation for this in 2001 and published it here on cqure.net. It worked alright at the time, but has not done so for quite a while now.</p>
<p>In short passing-the-hash allows you to extract encrypted passwords (hashes) from a Windows system and use the hashes, without knowing the password, in order to authenticate to other Windows systems with users having the same passwords. The risk associated with this should be obvious to most people.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2007/08/passing-the-hash-for-everyone/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
