<?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; windows 7</title>
	<atom:link href="http://praetorianprefect.com/archives/tag/windows-7/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>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>
		<item>
		<title>Windows Task Scheduler: Backwards Incompatibility</title>
		<link>http://praetorianprefect.com/archives/2009/09/windows-task-scheduler-backwards-incompatibility/</link>
		<comments>http://praetorianprefect.com/archives/2009/09/windows-task-scheduler-backwards-incompatibility/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 01:49:35 +0000</pubDate>
		<dc:creator>Simon Price</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows 7]]></category>
		<category><![CDATA[WMI]]></category>
		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://praetorianprefect.com/?p=741</guid>
		<description><![CDATA[Scheduled tasks are plentiful in most environments. Managing them is typically a nightmare. You have some running to truncate and copy off logs someplace, or others to run a proprietary backup utility to dump a copy of your Quickbooks data; whatever the reason, over time there are more and they are everywhere. Typically, you want [...]]]></description>
			<content:encoded><![CDATA[<p>Scheduled tasks are plentiful in most environments. Managing them is typically a nightmare. You have some running to truncate and copy off logs someplace, or others to run a proprietary backup utility to dump a copy of your Quickbooks data; whatever the reason, over time there are more and they are everywhere. Typically, you want to know that they exist, when they are scheduled to run, and most importantly who they are going to run as. (Look our for password expirations!)</p>

<p>Unless you have invested in an enterprise solution for tasks, you are using Windows Task Scheduler and have the tools included with the Windows OS to do the trick. This article is to point out two major snafus you may come across when attempting to manage scheduled tasks across your environment:</p>

<ol>
<li><p>Using WMI class versus the task scheduler API and what effects it has.</p></li>
<li><p>New versions in Vista / Windows 7 / Windows 2008 that do not work with XP / 2003.</p></li>
</ol>

<p>The first item is more for those who attempt scripting and programming to manage the tasks across machines in the environment. WMI has a class called Win32_Scheduledjob which does quite a bit for managing tasks. However, any tasks created with or modified by the task scheduler API  (such as through the task scheduler GUI or schtasks.exe) will cause the tasks to no longer be managed by WMI. For example, if you create a task using schtasks.exe, this tasks will not be returned in a WMI query; or, if you create a task using WMI, but then modify it with the task scheduler GUI, it will also no longer turn up in WMI. </p>

<p>So, Win32_Schedulejob is not a great option and we go about our business using the GUI and schdtasks.exe. We move on to our second issue, which is the backwards incompatibility for those using Vista, Windows 7 or Windows 2008. For example, from my Windows 7 workstation, if I use schtasks.exe or the Task Schedule MMC snap-in, I can query, manipulate, create tasks on Vista, Windows 7 or Windows 2008. When I attempt to reach a Windows XP or Windows 2003 machine, I get Access Denied. Running the older XP version of schtasks.exe did not return errors when run against any version OS. This is painful. The solution is to run the management commands from an XP or 2003 machine, or to copy the schtasks.exe and schedsvc.dll files from those version into a directory on your Vista / Win7 machine and run it from there. See this screenshot using both versions of the tool from my  Windows 7 workstation, querying a Windows XP machine. I printed the file version each time to show the newer copy fails with Access is Denied.</p>

<p><a href="http://praetorianprefect.com/wp-content/uploads/2009/10/ScreenHunter_03Oct.0221.452.gif"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="ScreenHunter_03 Oct. 02 21.45" src="http://praetorianprefect.com/wp-content/uploads/2009/10/ScreenHunter_03Oct.0221.45_thumb2.gif" border="0" alt="ScreenHunter_03 Oct. 02 21.45" width="244" height="158" align="left" /></a></p>

<blockquote> 

You may very well have proper access, but this Access Denied means you have a newer version of the tool.</blockquote>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p> </p>

<p>This <a href="http://msdn.microsoft.com/en-us/library/bb756979.aspx" target="_blank">Technet article</a> explains what is new in Task Scheduler 2.0 (Vista and above) compared to 1.0. There are many new features, but I would have liked to have a schtasks.exe and a MMC snap-in that was backwards compatible to manage older versions.</p>

<p>One last note is that .job files from XP/2003 are not compatible with the newer Task Scheduler 2.0 (xml format). I’ve seen that folks used the older schtasks.exe to dump the task information in table format, than use Excel to properly edit it to the valid xml format.</p>

<p><strong>Related Posts:</strong></p>
<ul>
<li><a href="http://praetorianprefect.com/archives/2010/03/3473/">March&#8217;s Patch Tuesday</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/12/regular-or-decaf-tool-launched-to-combat-cofee/">Regular or Decaf? Tool launched to combat COFEE</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/12/six-bulletins-in-last-patch-tuesday-of-2009/">Six Bulletins in Last Patch Tuesday of 2009</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/11/ossec-agentless-its-good-but-not-good-enough/">OSSEC: Agentless&#8230;It&#8217;s good, but not good enough</a></li>
<li><a href="http://praetorianprefect.com/archives/2009/11/ossec-agentless-scripts/">OSSEC: Agentless scripts</a></li>
</ul><br />
]]></content:encoded>
			<wfw:commentRss>http://praetorianprefect.com/archives/2009/09/windows-task-scheduler-backwards-incompatibility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
