<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>©атсн²² (in)sесuяitу &#187; Metasploit</title>
	<atom:link href="http://blog.c22.cc/category/metasploit/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.c22.cc</link>
	<description>Because we&#039;re damned if we do, and we&#039;re damned if we don&#039;t!</description>
	<lastBuildDate>Thu, 11 Mar 2010 14:31:33 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='blog.c22.cc' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/1b6c05a022094e3a7342e6b645c9cfce?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>©атсн²² (in)sесuяitу &#187; Metasploit</title>
		<link>http://blog.c22.cc</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.c22.cc/osd.xml" title="©атсн²² (in)sесuяitу" />
	<atom:link rel='hub' href='http://blog.c22.cc/?pushpress=hub'/>
		<item>
		<title>Internet Explorer iepeers.dll use-after-free</title>
		<link>http://blog.c22.cc/2010/03/11/internet-explorer-iepeers-dll-use-after-free/</link>
		<comments>http://blog.c22.cc/2010/03/11/internet-explorer-iepeers-dll-use-after-free/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 14:16:59 +0000</pubDate>
		<dc:creator>ChrisJohnRiley</dc:creator>
				<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[0-day]]></category>
		<category><![CDATA[cve-2010-0806]]></category>
		<category><![CDATA[Exploit]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[iepeer]]></category>
		<category><![CDATA[iepeer.dll]]></category>
		<category><![CDATA[internet explorer]]></category>

		<guid isPermaLink="false">http://blog.c22.cc/?p=1265</guid>
		<description><![CDATA[A few days back (9th March 2010), Microsoft confirmed the presence of an (as yet) un-patched vulnerability in Internet Explorer 6 and 7. McAffee also released information regarding targeted attacks discovered in the wild actively using this exploit. Since then, full information about the vulnerability and proof of concept code has been publicly released. As [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=1265&subd=c22blog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>A few days back <em>(9th March 2010)</em>, Microsoft <a title="KB981374" href="http://www.microsoft.com/technet/security/advisory/981374.mspx" target="_blank">confirmed</a> the presence of an <em>(as yet)</em> un-patched vulnerability in Internet Explorer 6 and 7. McAffee also released<a title="McAffee" href="http://www.avertlabs.com/research/blog/index.php/2010/03/09/targeted-internet-explorer-0day-attack-announced-cve-2010-0806/" target="_blank"> information</a> regarding targeted attacks discovered in the wild actively using this exploit. Since then, full information about the vulnerability and proof of concept code has been publicly released. As usual, the great guys behind <a title="Metasploit" href="http://www.metasploit.com" target="_blank">Metasploit </a>have a working <a title="ie_iepeers_pointer.rb" href="http://www.rec-sec.com/exploits/msf/ie_iepeers_pointer.rb" target="_blank">exploit</a> courtesy of Trancer at www.rec-sec.com.</p>
<p>After fighting with my VMWare install under Ubuntu 10.04<em> (yes, I know&#8230;. it&#8217;s Alpha, why is that on your main box!!!)</em> last night after the release, I finally got a chance to play a little with the exploit today in a test environment. As you can imagine the exploit is simple to use and works like a charm<em> (at least in the testing I&#8217;ve done)</em>. I&#8217;ve put together a quick video of the exploit for those that want to show their management types why this is such a serious issue.</p>
<p style="text-align:center;"><span style='text-align:center; display: block;'>
<object type="application/x-shockwave-flash" width="400" height="300" data="http://www.vimeo.com/moogaloop.swf?clip_id=10087463&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA">
	<param name="quality" value="best" />
	<param name="allowfullscreen" value="true" />
	<param name="scale" value="showAll" />
	<param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=10087463&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA" />
	<param name="wmode" value="opaque" />
</object>
</span></p>
<p>I particularly like the addition of the <em>migrate -f</em> automatically into the exploit<em> (see &#8217;show advanced&#8217;)</em>. This spawns a new notepad process and migrates to it so that if the victim closes/kills IE, the meterpreter session won&#8217;t be automatically killed along with the process. You learn something new everyday!</p>
<p>Microsoft have now posted a number of workarounds <em>(most centered around disabling or limiting access to the peer class)</em>. For more information checkout <a title="KB981374" href="http://www.microsoft.com/technet/security/advisory/981374.mspx" target="_blank">KB981374</a> and <a title="CVE-2010-0806" href="http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2010-0806" target="_blank">CVE-2010-0806</a></p>
<p style="text-align:center;"><em><span style="color:#888888;">All credit for the exploit goes to Tracer, All credit to HD Moore and the Metasploit team for producing such a great tool, for people like me (another tool), to rely on so much. </span></em></p>
<p style="text-align:center;"><em><span style="color:#888888;">Keep up the good work.</span></em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/c22blog.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/c22blog.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/c22blog.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/c22blog.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/c22blog.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/c22blog.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/c22blog.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/c22blog.wordpress.com/1265/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/c22blog.wordpress.com/1265/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/c22blog.wordpress.com/1265/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=1265&subd=c22blog&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.c22.cc/2010/03/11/internet-explorer-iepeers-dll-use-after-free/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">ChrisJohnRiley</media:title>
		</media:content>
	</item>
		<item>
		<title>adduser_wmic</title>
		<link>http://blog.c22.cc/2009/09/10/adduser_wmic/</link>
		<comments>http://blog.c22.cc/2009/09/10/adduser_wmic/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 07:27:34 +0000</pubDate>
		<dc:creator>ChrisJohnRiley</dc:creator>
				<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[adduser]]></category>
		<category><![CDATA[payload]]></category>
		<category><![CDATA[wmic]]></category>

		<guid isPermaLink="false">http://c22blog.wordpress.com/?p=812</guid>
		<description><![CDATA[After taking input from a few interested sources I&#8217;ve done some tweaking on the adduser_wmic.rb script. These are only minor changes to the selection process to give the user 3 options on how the payload functions .:

Standard mode &#8211; The account is created and added to the hardcoded &#8216;Administrators&#8217; local group
Custome mode &#8211; The account [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=812&subd=c22blog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>After taking input from a few interested sources I&#8217;ve done some tweaking on the <a title="adduser_wmic.rb" href="https://sites.google.com/a/c22.cc/storage/home/metasploit/adduser_wmic.rb?attredirects=0" target="_blank">adduser_wmic.rb</a> script. These are only minor changes to the selection process to give the user 3 options on how the payload functions .:</p>
<ol>
<li>Standard mode &#8211; The account is created and added to the hardcoded &#8216;Administrators&#8217; local group</li>
<li>Custome mode &#8211; The account is created and added to the local group specified by the cust parameter</li>
<li>WMIC mode &#8211; The account is created and added to the local administrators group regardless of name, based on the SID.</li>
</ol>
<p>This last option is, as HD pointed out, supported only on Windows XP / 2003 and later systems. However it does offer a larger degree of flexibility by discovering the local administrators account without relying on the name. This can help bypass the language issue, as well as the issue of renamed local groups. I&#8217;ll leave it up to you if you find it useful.</p>
<p><span style='text-align:center; display: block;'>
<object type="application/x-shockwave-flash" width="400" height="300" data="http://www.vimeo.com/moogaloop.swf?clip_id=6512781&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA">
	<param name="quality" value="best" />
	<param name="allowfullscreen" value="true" />
	<param name="scale" value="showAll" />
	<param name="movie" value="http://www.vimeo.com/moogaloop.swf?clip_id=6512781&amp;server=www.vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=0&amp;show_portrait=0&amp;color=01AAEA" />
	<param name="wmode" value="opaque" />
</object>
</span></p>
<p>Some of the commands I used on the video are below for your reference .:</p>
<blockquote><p>./msfpayload windows/adduser_wmic pass=Re@llyStr0nG X &gt; adduser_std.exe</p>
<p>./msfpayload windows/adduser_wmic pass=Re@llyStr0nG cust=Admingroup X &gt; adduser_cust_admingroup.exe</p>
<p>./msfpayload windows/adduser_wmic pass=Re@llyStr0nG X wmic=true &gt; adduser_wmic.exe</p></blockquote>
<p>A number of small issues did appear in testing. The issue of a password greater than 14 chars prompting the target user to accept<em> (due to backwards compatability reasons)</em>. As well as the issue of password complexity<em> (the payload will fail if complexity rules on the target system aren&#8217;t met)</em>. I&#8217;ll be looking at those issues to see what can be done within the payload when I have a chance. Until then please feel free to download the current version of <a title="adduser_wmic.rb" href="https://sites.google.com/a/c22.cc/storage/home/metasploit/adduser_wmic.rb?attredirects=0" target="_blank">adduser_wmic.rb</a> and give it a whirl.</p>
<p>As always, feel free to leave any comments if you encounter problems or would like to suggest any possible changes.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/c22blog.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/c22blog.wordpress.com/812/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/c22blog.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/c22blog.wordpress.com/812/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/c22blog.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/c22blog.wordpress.com/812/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/c22blog.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/c22blog.wordpress.com/812/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/c22blog.wordpress.com/812/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/c22blog.wordpress.com/812/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=812&subd=c22blog&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.c22.cc/2009/09/10/adduser_wmic/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">ChrisJohnRiley</media:title>
		</media:content>
	</item>
		<item>
		<title>Metasploit: Does it talk your language ?</title>
		<link>http://blog.c22.cc/2009/09/07/metasploit-does-it-talk-your-language/</link>
		<comments>http://blog.c22.cc/2009/09/07/metasploit-does-it-talk-your-language/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 19:05:17 +0000</pubDate>
		<dc:creator>ChrisJohnRiley</dc:creator>
				<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://c22blog.wordpress.com/?p=796</guid>
		<description><![CDATA[
After many (many) months of procrastination, I&#8217;ve finally put the first couple of pieces together for an idea I&#8217;ve had going round in my head since the beginning of the year. What finally made me get things rolling ? well, it&#8217;s a number of things really. I managed to sit and chat with Carlos &#8220;Darkoperator&#8221; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=796&subd=c22blog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p style="text-align:center;"><img class="size-full wp-image-799 aligncenter" style="margin-top:5px;margin-bottom:5px;" title="logo" src="http://c22blog.files.wordpress.com/2009/09/logo1.png?w=335&#038;h=128" alt="logo" width="335" height="128" /></p>
<p>After many <em>(many)</em> months of <a title="I need this T-Shirt !!!" href="http://typetees.threadless.com/product/487/Procrastinators_Leaders_of_Tomorrow" target="_blank">procrastination</a>, I&#8217;ve finally put the first couple of pieces together for an idea I&#8217;ve had going round in my head since the beginning of the year. What finally made me get things rolling ? well, it&#8217;s a number of things really. I managed to sit and chat with <a href="http://www.darkoperator.com/" target="_blank">Carlos &#8220;Darkoperator&#8221; Perez</a> before his talk at Defcon, and his enthusiasm for <a title="Metasploit Project" href="http://www.metasploit.com/" target="_blank">Metasploit</a> and what the project was trying to achieve really made me want to be a bigger part of that. Still, I&#8217;m rambling and not getting to the point. So what is this idea I had, and why is it important enough to write about it.</p>
<p>To most people who read my blog, this isn&#8217;t going to be something that effects your everyday life, but you have to remember that not everybody using Metasploit comes from the US/UK. There&#8217;s a whole world of people out their using Metasploit on machines that are installed  in different languages. Most people wouldn&#8217;t think twice about it. After all it&#8217;s just the system language, why would that have an effect on anything we want to exploit. Well here&#8217;s the problem. Different language versions of Windows have a range of differences that might break, or limit your use of Metasploit. That&#8217;s bad right ? Nobody wants to have to say they could exploit an unpatched system just because it&#8217;s running an Italian version of Windows 2003.</p>
<p>Coming from the UK, and speaking English, I never considered this could be a problem. That is, until I started preparing for a class on Metasploit last year. None of the testing I was doing on my Windows 2003 VM was working, even though I&#8217;d not patched it against MS08-067, I couldn&#8217;t exploit the box. It was just crashing, every time. Sure 1 or 2 crashes can happen, but every time without fail. Something was wrong. Why was this happening ? Because the memory offsets are different between the language versions of Windows. It&#8217;s not only that&#8230; when looking through the payloads the <a title="adduser.rb" href="http://trac.metasploit.com/browser/framework3/trunk/modules/payloads/singles/windows/adduser.rb" target="_blank">ad</a><a title="adduser.rb" href="http://trac.metasploit.com/browser/framework3/trunk/modules/payloads/singles/windows/adduser.rb" target="_blank">duser.rb</a><a href="http://c22blog.files.wordpress.com/2009/09/adduser_scrn.png"><img class="alignleft size-full wp-image-800" style="margin:5px;" title="adduser_scrn" src="http://c22blog.files.wordpress.com/2009/09/adduser_scrn.png?w=307&#038;h=180" alt="adduser_scrn" width="307" height="180" /></a> payload defaults to a hard-coded net localgroup command, which although it&#8217;ll work on 75% of systems <em>(lots of languages use the Administrators group after all)</em> there were specific languages that would just fail <em>(German being one of them)</em>.</p>
<p>After looking a little further I came up with a few other scripts<em> (mostly <a title="Meterpreter Scripts" href="http://trac.metasploit.com/browser/framework3/trunk/scripts/meterpreter" target="_blank">meterpreter POST exploitation scripts</a>)</em> that used hard-coded group names, service names, and screen scraping to do their magic <em>(and yes, some of them are real magic)</em>. They served the purpose and they did the job great, but not for me.</p>
<p>So where to start. First off I took at at the <a title="ms08_067_netapi.rb" href="http://trac.metasploit.com/browser/framework3/trunk/modules/exploits/windows/smb/ms08_067_netapi.rb" target="_blank">MS08-067</a> exploit. I wanted to get a feel for how the exploits were written in Ruby <em>(a new language for me)</em> and wanted to see if I could replicate the exploit and get it working on a German version of Windows 2003 <em>(language support for Windows XP is much better owing to the widespread use of it, and ease of finding testers)</em>. After some testing with <a title="msfpescan" href="http://trac.metasploit.com/browser/framework3/trunk/msfpescan" target="_blank">msfpscan</a> I found some alternative memory addresses that worked for the German version of 2003 sp1/sp2 <em>(without NX enabled)</em>. After playing about a little more I even managed to find addresses that worked for both the English and the German versions. That however was the easy part. Finding the NO-NX memory addresses was pretty simple <em>(child&#8217;s play for most probably)</em>. The challenge of the NX exploits is something I need to work more on. My Fu is weak in that area.</p>
<p>This last weekend I finally had some time to sit down and concentrate on understanding the way that the adduser.rb payload works. Once you look at the code things are pretty straight forward. I&#8217;m surprised more people don&#8217;t read the code, as it&#8217;s pretty simple once you get started. I guess some people are scared of coding. After some thoughts on how to proceed, I came to the realization that whatever I did should be language neutral, after all whats the point in me adding in 5 language options into the payload and letting the user pick the one they want. That&#8217;s not much of a move towards being language neutral is it. I also realized that the command for finding the language<em> (and the name of the local Administrators group)</em> needs to run on the client-side. After all, it needs to work with msfpayload and that runs a command completely on the client. For maximum effect it needs to adapt to the language used on the fly.</p>
<p>After spending some time mulling over the possible solutions, I zoned in on the use of <a title="WMIC" href="http://technet.microsoft.com/en-us/library/bb742610.aspx" target="_blank">WMIC</a> to output the information. I know this is going to cut-off Windows NT/2000 systems, but this was the most elegant solution available. With a little help from trust Google <em>(and <a title="commandline kungfu" href="http://blog.commandlinekungfu.com/" target="_blank">Ed Skoudis</a>)</em> and a lot of trial and error, I managed to output the information I needed in a format that was usable based on the common local Administrators group SID number. The good thing about this solution is that it will not only be language neutral, but will also allow me to still add a user to the Administrators group even if the crafty Admin has renamed it to something else. After all the SID remains the same <em>(S-1-5-32-544)</em>. The wmic command for people who want to play is .:</p>
<blockquote>
<p style="text-align:center;">wmic group where sid=&#8221;S-1-5-32-544&#8243; get name</p>
</blockquote>
<p>The adduser_wmic.rb payload is still in testing, but for those that want to take a look, you can grab a copy <a title="Metasploit Files" href="https://sites.google.com/a/c22.cc/storage/home/metasploit" target="_blank">here</a>. Just let me know if you encounter any problems. I know there are currently some issues with the windows/adduser/bind_tcp payload, but once these are fixed in the SVN, I&#8217;ll resume testing with the wmic version.</p>
<p>Hopefully I&#8217;ll be working more in this project in the coming months <em>(maybe even talk about it briefly at a conference)</em>. Let me know if you want to help with testing, as I could always use testers with access to Windows systems of different languages.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/c22blog.wordpress.com/796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/c22blog.wordpress.com/796/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/c22blog.wordpress.com/796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/c22blog.wordpress.com/796/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/c22blog.wordpress.com/796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/c22blog.wordpress.com/796/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/c22blog.wordpress.com/796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/c22blog.wordpress.com/796/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/c22blog.wordpress.com/796/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/c22blog.wordpress.com/796/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=796&subd=c22blog&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.c22.cc/2009/09/07/metasploit-does-it-talk-your-language/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">ChrisJohnRiley</media:title>
		</media:content>

		<media:content url="http://c22blog.files.wordpress.com/2009/09/logo1.png" medium="image">
			<media:title type="html">logo</media:title>
		</media:content>

		<media:content url="http://c22blog.files.wordpress.com/2009/09/adduser_scrn.png" medium="image">
			<media:title type="html">adduser_scrn</media:title>
		</media:content>
	</item>
		<item>
		<title>Cracking HALFLM</title>
		<link>http://blog.c22.cc/2009/06/02/cracking-halflm/</link>
		<comments>http://blog.c22.cc/2009/06/02/cracking-halflm/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 11:26:53 +0000</pubDate>
		<dc:creator>ChrisJohnRiley</dc:creator>
				<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[Penetration Test]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[cracking]]></category>
		<category><![CDATA[hash]]></category>

		<guid isPermaLink="false">http://c22blog.wordpress.com/?p=522</guid>
		<description><![CDATA[I was recently reading through Chris Gates post on capturing and cracking HALFLM hashes with Metasploit and thought I&#8217;d give it a quick run through. (I won&#8217;t be rehashing what Chris already covered here, so I suggest you pop over to his blog for a quick coverage of HALFLM and the rainbowtable cracking method).
Until I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=522&subd=c22blog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I was recently reading through Chris Gates post on <a title="Carnal0wnage Blog" href="http://carnal0wnage.blogspot.com/2009/04/using-metasploit-smb-sniffer-module.html" target="_blank">capturing and cracking HALFLM hashes with Metasploit</a> and thought I&#8217;d give it a quick run through. (I won&#8217;t be rehashing what Chris already covered here, so I suggest you pop over to his blog for a quick coverage of HALFLM and the rainbowtable cracking method).</p>
<p>Until I read the post I&#8217;d been using the SMB_relay attack to load up a meterpreter shell onto the remote target, but seeing as Microsoft have finally decided this is a bug worth patching, it&#8217;s time to move on to other attack vectors. SMB_relay will still be a good attack vector for some attacks, but the patch against reflective relays means it&#8217;s not going to always be available.</p>
<p><a href="http://c22blog.files.wordpress.com/2009/06/msf.png"><img class="size-medium wp-image-523 alignleft" style="border:6px;margin:6px;" title="msf" src="http://c22blog.files.wordpress.com/2009/06/msf.png?w=300&#038;h=184" alt="msf" width="300" height="184" /></a>All was going well with the walkthrough, I&#8217;d captured the hash from the target machine and had the HALFLM tables downloaded (halflmchall _alphanumeric #1-7_<em>x</em>_2400_ 1122334455667788). So after running the rcracki_mt_0.5.exe *.rti -h &lt;First16Chars&gt; was depressed to see that the first half wasn&#8217;t found (the tables are only alpha numeric after all). Not a problem I thought, and went back to Chris&#8217; walkthrough to see the next step. That&#8217;s where it all went wrong. If you can&#8217;t find the first part of the hash, then the rest of the walkthrough isn&#8217;t going to help. I had a little hunt around the big WWW and like any good Googler I found some hints on what other tools could do a brute force or password guessing attack aginst the HALFLM format. I picked CAIN and set about trying to manually tell it what the username, LM hash and challenge were, without much luck. Cain can sometimes be stubborn on the input formats and you can&#8217;t manually tell it what should go where. I went back to the Metasploit smb capture module and had a closer look at the set options to see what I could do. Here I found the option to output captured the hashes straight into a format readable by Cain&amp;Able (set PWFILE cain_hashdump.txt) instead of to the screen in a generic format.</p>
<p>After performing the SMB capture again, the file cain_hashdump.txt was created, allowing me to directly import it into CAIN (along with the challenge this time).</p>
<p>For those that may have already captured the HALFLM hash and need to import this into CAIN, the format of the dump output from Metasploit is as follows .:</p>
<p>USERNAME:DOMAIN:1122334455667788:LMHASH:NTHASH</p>
<p><a href="http://c22blog.files.wordpress.com/2009/06/clipboard021.png"><img class="size-full wp-image-530 aligncenter" style="border:3px none;margin-top:3px;margin-bottom:3px;" title="Clipboard02" src="http://c22blog.files.wordpress.com/2009/06/clipboard021.png?w=552&#038;h=41" alt="Clipboard02" width="552" height="41" /></a></p>
<p>The 1122334455667788 in the middle tells Cain what challenge was used by the Metasploit module. In this case Metasploit is hard coded to use \x11\x22\x33\x44\x55\x66\x77\x88 as the challenge string.</p>
<p>Hope you find this useful, and remember to checkout the Carnal0wnage blog for the RainbowTable method, as well as lots of other Metasploit hints, tips and examples.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/c22blog.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/c22blog.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/c22blog.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/c22blog.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/c22blog.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/c22blog.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/c22blog.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/c22blog.wordpress.com/522/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/c22blog.wordpress.com/522/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/c22blog.wordpress.com/522/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=522&subd=c22blog&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.c22.cc/2009/06/02/cracking-halflm/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">ChrisJohnRiley</media:title>
		</media:content>

		<media:content url="http://c22blog.files.wordpress.com/2009/06/msf.png?w=300" medium="image">
			<media:title type="html">msf</media:title>
		</media:content>

		<media:content url="http://c22blog.files.wordpress.com/2009/06/clipboard021.png" medium="image">
			<media:title type="html">Clipboard02</media:title>
		</media:content>
	</item>
		<item>
		<title>MS09-012: Fixing “Token Kidnapping”</title>
		<link>http://blog.c22.cc/2009/04/15/ms09-012-fixing-%e2%80%9ctoken-kidnapping%e2%80%9d/</link>
		<comments>http://blog.c22.cc/2009/04/15/ms09-012-fixing-%e2%80%9ctoken-kidnapping%e2%80%9d/#comments</comments>
		<pubDate>Wed, 15 Apr 2009 06:58:20 +0000</pubDate>
		<dc:creator>ChrisJohnRiley</dc:creator>
				<category><![CDATA[Metasploit]]></category>
		<category><![CDATA[Penetration Test]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Patches]]></category>

		<guid isPermaLink="false">http://c22blog.wordpress.com/?p=468</guid>
		<description><![CDATA[This was the headline that grabbed my attention this morning on the Microsoft Security &#38; Defence Blog. Had Microsoft finally patched the token impersonation flaw (or feature as Microsoft regard it) that is used by the Incognito tool to allow a compromised system level account to impersonate local or domain users. In short no, and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=468&subd=c22blog&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>This was the headline that grabbed my attention this morning on the <a title="Microsoft Blog" href="http://blogs.technet.com/srd/archive/2009/04/14/ms09-012-fixing-token-kidnapping.aspx">Microsoft Security &amp; Defence Blog</a>. Had Microsoft finally patched the token impersonation flaw (or feature as Microsoft regard it) that is used by the <a title="Incognito" href="http://sourceforge.net/projects/incognito">Incognito</a> tool to allow a compromised system level account to impersonate local or domain users. In short no, and I say that with mixed feelings.</p>
<p>As a penetration tester, I can breath a sigh of relief and know that this attack vector is still open. As a defender, the chance that Microsoft had changed the way this functionality works to block the attack was a welcome update to protect our systems. Still, you can&#8217;t expect Microsoft to repair something they see as a feature and the way things should work. Some things aren&#8217;t meant to be repaired I guess.</p>
<h3>Testing</h3>
<p>Just to make sure that Microsoft hadn&#8217;t broken the Incognito functionality while messing with the way tokens work, I ran a couple of tests against a Windows XP service pack 2 machine.</p>
<p>I started off with an unpatched version and ran the trusty MS08-067 exploit to get a meterpreter shell.</p>
<blockquote><p>./msfcli exploit/windows/smb/ms08_067_netapi payload=windows/meterpreter/bind_tcp LHOST=192.168.0.104 RHOST=192.168.0.103 E</p>
</blockquote>
<p>This functioned as you&#8217;d expect and resulted in a meterpreter shell running under the Local System Account. After running the &#8220;use incognito&#8221; command I listed the tokens using &#8220;list_tokens -u&#8221;.</p>
<p><a href="http://c22blog.files.wordpress.com/2009/04/incognito1.png"><img class="aligncenter size-medium wp-image-469" title="incognito1" src="http://c22blog.files.wordpress.com/2009/04/incognito1.png?w=300&#038;h=226" alt="incognito1" width="300" height="226" /></a></p>
<p>Taking the local account &#8220;pentestuser&#8221; as the token to impersonate, I ran &#8220;impersonate_token PENTEST-3C73D9Cpentestuser&#8221;</p>
<p><a href="http://c22blog.files.wordpress.com/2009/04/incognito2.png"><img class="aligncenter size-medium wp-image-470" title="incognito2" src="http://c22blog.files.wordpress.com/2009/04/incognito2.png?w=300&#038;h=48" alt="incognito2" width="300" height="48" /></a></p>
<p>Success, as expected on the unpatched system. Next up, I patched the system, rebooted and repeated the same msfcli exploit (MS08-067). This time however the exploit failed on the first run as it couldn&#8217;t isolate the exact service pack version. Metasploit listed it as Service Pack 2+ (which is technically correct). Re-running the command completed the exploit however.</p>
<p><a href="http://c22blog.files.wordpress.com/2009/04/incognito3_after-patch.png"><img class="aligncenter size-medium wp-image-471" title="incognito3_after-patch" src="http://c22blog.files.wordpress.com/2009/04/incognito3_after-patch.png?w=300&#038;h=223" alt="incognito3_after-patch" width="300" height="223" /></a></p>
<p>Even after the patch everything seems fine in the token list.</p>
<p><a href="http://c22blog.files.wordpress.com/2009/04/incognito4_after-patch.png"><img class="aligncenter size-medium wp-image-472" title="incognito4_after-patch" src="http://c22blog.files.wordpress.com/2009/04/incognito4_after-patch.png?w=300&#038;h=57" alt="incognito4_after-patch" width="300" height="57" /></a></p>
<p>The final test, impersonation of the PENTEST-3C73D9Cpentestuser user. As before this went off without a hitch, giving us access to the local user without error.</p>
<h3>Conclusion</h3>
<p>Microsoft have patched the flaws listed in <a title="MS09-012" href="http://www.microsoft.com/technet/security/bulletin/MS09-012.mspx">KB952004</a> without effecting the Incognito tool (or the implementation of the tool within Metasploit). Good for attackers, bad for defenders. But you can&#8217;t always have it both ways can you. I doubt that we&#8217;ll be seeing a patch against the token impersonation flaw used in incognito anytime soon, if at all.</p>
<p>I&#8217;m heading to Blackhat Europe in a few hours (courtesy of a last minute press registration). If you&#8217;re there feel free to drop me a line and buy me a drink <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  &#8212; &gt; contact <span style="color:#888888;">[at]</span> c22 <span style="color:#888888;">[dot]</span> cc</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/c22blog.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/c22blog.wordpress.com/468/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/c22blog.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/c22blog.wordpress.com/468/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/c22blog.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/c22blog.wordpress.com/468/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/c22blog.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/c22blog.wordpress.com/468/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/c22blog.wordpress.com/468/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/c22blog.wordpress.com/468/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.c22.cc&blog=1599597&post=468&subd=c22blog&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.c22.cc/2009/04/15/ms09-012-fixing-%e2%80%9ctoken-kidnapping%e2%80%9d/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">ChrisJohnRiley</media:title>
		</media:content>

		<media:content url="http://c22blog.files.wordpress.com/2009/04/incognito1.png?w=300" medium="image">
			<media:title type="html">incognito1</media:title>
		</media:content>

		<media:content url="http://c22blog.files.wordpress.com/2009/04/incognito2.png?w=300" medium="image">
			<media:title type="html">incognito2</media:title>
		</media:content>

		<media:content url="http://c22blog.files.wordpress.com/2009/04/incognito3_after-patch.png?w=300" medium="image">
			<media:title type="html">incognito3_after-patch</media:title>
		</media:content>

		<media:content url="http://c22blog.files.wordpress.com/2009/04/incognito4_after-patch.png?w=300" medium="image">
			<media:title type="html">incognito4_after-patch</media:title>
		</media:content>
	</item>
	</channel>
</rss>