<?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>Accuvant Insight &#187; dmaynor</title>
	<atom:link href="http://insight.accuvant.com/author/dmaynor/feed/" rel="self" type="application/rss+xml" />
	<link>http://insight.accuvant.com</link>
	<description>Security Strategy Expertly Executed</description>
	<lastBuildDate>Wed, 08 Sep 2010 17:05:17 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SCTP Linux Kernel Vulnerability Assessment and Reproduction</title>
		<link>http://insight.accuvant.com/appsec/sctp-linux-kernel-vulnerability-assessment-and-reproduction/</link>
		<comments>http://insight.accuvant.com/appsec/sctp-linux-kernel-vulnerability-assessment-and-reproduction/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 21:42:25 +0000</pubDate>
		<dc:creator>dmaynor</dc:creator>
				<category><![CDATA[Application Security]]></category>
		<category><![CDATA[Vulnerabilities]]></category>

		<guid isPermaLink="false">http://insight.accuvant.com/?p=11</guid>
		<description><![CDATA[Overview:
The blog post here makes statements about a vulnerability in the Linux kernel handling of SCTP data. The primary point of the post is to show how a vulnerability that was once thought to be of a relative low risk was incorrectly assessed and it can provide a 3rd party remote access to a server [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Overview:</strong><br />
The blog post <a title="kernelbof" href="http://kernelbof.blogspot.com/2009_04_01_archive.html" target="_blank">here</a> makes statements about a vulnerability in the Linux kernel handling of SCTP data. The primary point of the post is to show how a vulnerability that was once thought to be of a relative low risk was incorrectly assessed and it can provide a 3rd party remote access to a server using SCTP. This post will attempt to verify the claims, duplicate the examples, and give a risk assessment.</p>
<p>Public Vulnerability Information<br />
The following links provide information about the vulnerability:</p>
<p>http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0065</p>
<p>http://www.vupen.com/english/advisories/2009/0029</p>
<p>http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9fcb95a105758b81ef0131cd18e2db5149f13e95</p>
<p>Vulnerability Details<br />
An analysis of the patch that fixes the vulnerability show the following additions in code:</p>
<blockquote><p>http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=9fcb95a105758b81ef0131cd18e2db5149f13e95;hp=aea3c5c05d2c409e93bfa80dcedc06af7da6c13b</p></blockquote>
<blockquote><p>&#8212; a/net/sctp/sm_statefuns.c<br />
+++ b/net/sctp/sm_statefuns.c<br />
@@ -3689,6 +3689,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(const struct sctp_endpoint *ep,<br />
{<br />
struct sctp_chunk *chunk = arg;<br />
struct sctp_fwdtsn_hdr *fwdtsn_hdr;<br />
+       struct sctp_fwdtsn_skip *skip;<br />
__u16 len;<br />
__u32 tsn;</p></blockquote>
<blockquote><p>@@ -3718,6 +3719,12 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn(const struct sctp_endpoint *ep,<br />
if (sctp_tsnmap_check(&amp;asoc-&gt;peer.tsn_map, tsn) &lt; 0)<br />
goto discard_noforce;</p></blockquote>
<blockquote><p>+       /* Silently discard the chunk if stream-id is not valid */<br />
+       sctp_walk_fwdtsn(skip, chunk) {<br />
+               if (ntohs(skip-&gt;stream) &gt;= asoc-&gt;c.sinit_max_instreams)<br />
+                       goto discard_noforce;<br />
+       }<br />
+<br />
sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_FWDTSN, SCTP_U32(tsn));<br />
if (len &gt; sizeof(struct sctp_fwdtsn_hdr))<br />
sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_FWDTSN,<br />
@@ -3749,6 +3756,7 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(<br />
{<br />
struct sctp_chunk *chunk = arg;<br />
struct sctp_fwdtsn_hdr *fwdtsn_hdr;<br />
+       struct sctp_fwdtsn_skip *skip;<br />
__u16 len;<br />
__u32 tsn;</p></blockquote>
<blockquote><p>@@ -3778,6 +3786,12 @@ sctp_disposition_t sctp_sf_eat_fwd_tsn_fast(<br />
if (sctp_tsnmap_check(&amp;asoc-&gt;peer.tsn_map, tsn) &lt; 0)<br />
goto gen_shutdown;</p></blockquote>
<blockquote><p>+       /* Silently discard the chunk if stream-id is not valid */<br />
+       sctp_walk_fwdtsn(skip, chunk) {<br />
+               if (ntohs(skip-&gt;stream) &gt;= asoc-&gt;c.sinit_max_instreams)<br />
+                       goto gen_shutdown;<br />
+       }<br />
+<br />
sctp_add_cmd_sf(commands, SCTP_CMD_REPORT_FWDTSN, SCTP_U32(tsn));<br />
if (len &gt; sizeof(struct sctp_fwdtsn_hdr))<br />
sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_FWDTSN,</p></blockquote>
<p>This patch adds the addition of a new variable as well as two diffrent checks for an invalid stream ID. The comments about each code addition explains exactly what the code is for:</p>
<blockquote><p>/* Silently discard the chunk if stream-id is not valid */</p></blockquote>
<p>Both code snippets do the same thing: they convert a value from network to host order then check is the result is greater than or equal to asoc-&gt;c.sinit_max_instreams. There are two important things about this code snippet.</p>
<p>The first is that there is an indication that this vulnerability is remotely exploitable since the value is being converted from network to host byte order.</p>
<p>The second is that the simple check of greater than or equal to is a length check that is designed to prevent an overwrite of some sort.</p>
<p>Following the declaration and assignment of these values, reveals what the vulnerability is. Due to a logic error in the handling of certain types of packets, more specifically the FWD packets, the kernel can be tricked into writing chucks of data beyond the boundary allocated for it resulting in memory corruption. This memory corruption can be used to manipulate memory in such a way that execution of arbitrary code occurs and allows an attacker take control of the target machine.</p>
<p>This validates the statements made in the blog post about the nature and the risk associated with the vulnerability.</p>
<p><strong>Exploitation</strong><br />
Exploit code for this vulnerability has been released here: http://www.milw0rm.com/exploits/8556</p>
<p>In order to test the code, a Linux server is needed to act as the victim and a Linux client is needed to act as the attacker. For the client, a Backtrack 4 VMware image is used. Since the default install of Backtrack does not have the SCTP development libraries, the tool aptitude is used to install them with the following command:</p>
<p>aptitude install libsctp-dev</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-19" title="snapshot41" src="http://insight.accuvant.com/wp-content/uploads/2009/04/snapshot41.png" alt="snapshot41" width="717" height="538" /></p>
<p>After aptitude reports success, the exploit code can be downloaded from Milw0rm and compiled using the command:</p>
<blockquote><p>gcc sctp.c -o sctp</p></blockquote>
<p><img class="aligncenter size-full wp-image-20" title="snapshot7" src="http://insight.accuvant.com/wp-content/uploads/2009/04/snapshot7.png" alt="snapshot7" width="676" height="502" /></p>
<p>The exploit can be tested with the command “./sctp”.</p>
<p>For the server, a VMWare image of Ubunti 8.10 is used. This server needs SCTP development libraries installed in the same way the Backtrack libraries were installed. The VMware image can be found here: http://www.vmware.com/appliances/directory/95733</p>
<p>Since the exploit requires a process using SCTP to be running an example can be found from IBM here: http://www.ibm.com/developerworks/linux/library/l-sctp/</p>
<p>After uncompressing and building the tool using the make command it is executed.</p>
<p>The exploit running:</p>
<p><img class="aligncenter size-full wp-image-21" title="snapshot8" src="http://insight.accuvant.com/wp-content/uploads/2009/04/snapshot8.png" alt="snapshot8" width="676" height="502" /></p>
<p>The traffic captured in wireshark:</p>
<p><img class="aligncenter size-full wp-image-22" title="snapshot9" src="http://insight.accuvant.com/wp-content/uploads/2009/04/snapshot9.png" alt="snapshot9" width="831" height="609" /></p>
<p>The exploit works as advertised and can give a remote attacker access to a server. The exploit is designed to only issue the “id” command and report the results but this could be easily modified to allow interactive access or to deliver to a botnet payload.</p>
<p><strong>Analysis</strong><br />
This exploit works as advertised and can give remote access to a 3rd party. SCTP can be implemented by a variety of different custom applications. SCTP can also be installed on servers with network intensive applications like Voice over IP. Most application testing would miss the inclusion of SCTP since most general purpose scanning tools do not detect a server supporting it. Source code or server access is the most reliable way to verify SCTP is supported.</p>
<p>In closing, since a vulnerability was discovered, reported, and is now shown to be exploitable in the Linux implementation of SCTP, other operating systems that support it will be targeted as well. If your applications rely on SCTP or a server with SCTP enabled, isolating it from the rest of the network is now a must.</p>
]]></content:encoded>
			<wfw:commentRss>http://insight.accuvant.com/appsec/sctp-linux-kernel-vulnerability-assessment-and-reproduction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The difference between high speed and low drag application assessments.</title>
		<link>http://insight.accuvant.com/appsec/7/</link>
		<comments>http://insight.accuvant.com/appsec/7/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 21:11:14 +0000</pubDate>
		<dc:creator>dmaynor</dc:creator>
				<category><![CDATA[Application Security]]></category>

		<guid isPermaLink="false">http://insight.accuvant.com/?p=7</guid>
		<description><![CDATA[The difference between a mediocre application assessment and a stellar one is assimilation of information and the ability to apply it to the problem at hand. During an application assessment an individual has a limited amount of time to understand an application, its underlying architecture, the development methodology and compress that into knowledge that can [...]]]></description>
			<content:encoded><![CDATA[<p>The difference between a mediocre application assessment and a stellar one is assimilation of information and the ability to apply it to the problem at hand. During an application assessment an individual has a limited amount of time to understand an application, its underlying architecture, the development methodology and compress that into knowledge that can be used to locate and exploit weakness in the target.</p>
<p>What if the scope changes? If an app tester is on site evaluating a target and new information about a weakness of flaw in the environment became available, that information should be quickly applied assimilated and applied tot he audit otherwise any deliverable could be deemed worthless becasue it is not up to date with the current threat facing the application.</p>
<p>A case in point is a Linux kernel vulnerability discussed on April 27th, 2009 on a blog called KernelBOF. The blog post details a problem in the Linux Kernel handling of SCTP data. The CVE information can be found here: http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0065</p>
<p>The main point of the post is that people do not understand or appropriately rate the risk of kernel bugs such as this one. The bug was released on January 5th, 2009 and at the time documentation seemed to indicate that the perceived risk of this vulnerability was as a Denial-of-Service (DoS) only and the actual affect is unknown. The KernelBOF blog then dives into deep detail about the vulnerability and shows why it is really a threat.</p>
<p>A good app assessment engineer should be able to take the vulnerability information, reproduce it, and give the client insight into how it affects their environment. The following next blog post entitled “SCTP Linux Kernel Vulnerability Assessment and Reproduction” will give insight into the process and how certain judgments are made about the risk.</p>
<p>&#8211;app assessment team</p>
]]></content:encoded>
			<wfw:commentRss>http://insight.accuvant.com/appsec/7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
