<?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>0x90</title>
	<atom:link href="http://blog.intninety.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.intninety.co.uk</link>
	<description>Blog of intninety</description>
	<lastBuildDate>Sun, 10 Mar 2013 13:04:51 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Fixing Windows Installer Coordinator Bug in Server 2008 R2</title>
		<link>http://blog.intninety.co.uk/2013/01/fixing-windows-installer-coordinator-bug-in-server-2008-r2/</link>
		<comments>http://blog.intninety.co.uk/2013/01/fixing-windows-installer-coordinator-bug-in-server-2008-r2/#comments</comments>
		<pubDate>Thu, 17 Jan 2013 23:15:21 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[2008]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[hang]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jdk]]></category>
		<category><![CDATA[r2]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows installer coordinator]]></category>

		<guid isPermaLink="false">http://blog.intninety.co.uk/?p=934</guid>
		<description><![CDATA[Today I had to install the Java SE Development Kit 7u11 on a Windows Server 2008 R2 x64 box to get Eclipse working and ran into a rather frustrating problem in which a Windows Installer Coordinator dialog box popped up and stayed there indefinitely with the message &#8220;Please wait while the application is preparing for [...]]]></description>
				<content:encoded><![CDATA[<p>Today I had to install the Java SE Development Kit 7u11 on a Windows Server 2008 R2 x64 box to get Eclipse working and ran into a rather frustrating problem in which a Windows Installer Coordinator dialog box popped up and stayed there indefinitely with the message &#8220;Please wait while the application is preparing for the first use&#8221; and a marquee progress bar.</p>
<p>If you want to get past this, first thing&#8217;s first: cancel it, as it&#8217;s not going to go anywhere.</p>
<p>After stopping the install open up your registry and find the following DWORD value:</p>
<p><strong>HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows NT\Terminal Services\TSAppSrv\TSMSI\Enable</strong></p>
<p>Some of the keys in the path may not exist, if you run into any that don&#8217;t exist just create them. Once you have found the <strong>Enable</strong> DWORD value, make sure it is set to <strong>0</strong>.</p>
<p>Now start the JDK installer up again and you should be able to install with no problems!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2013/01/fixing-windows-installer-coordinator-bug-in-server-2008-r2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing Crash After Cut Scene in Hitman Absolution</title>
		<link>http://blog.intninety.co.uk/2012/12/fixing-crash-after-cut-scene-in-hitman-absolution/</link>
		<comments>http://blog.intninety.co.uk/2012/12/fixing-crash-after-cut-scene-in-hitman-absolution/#comments</comments>
		<pubDate>Sun, 02 Dec 2012 12:09:37 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[580]]></category>
		<category><![CDATA[64bit]]></category>
		<category><![CDATA[7]]></category>
		<category><![CDATA[absolution]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[display]]></category>
		<category><![CDATA[driver]]></category>
		<category><![CDATA[gtx]]></category>
		<category><![CDATA[hitman]]></category>
		<category><![CDATA[nvidia]]></category>
		<category><![CDATA[responding]]></category>
		<category><![CDATA[sli]]></category>
		<category><![CDATA[steam]]></category>
		<category><![CDATA[stopped]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://blog.intninety.co.uk/?p=924</guid>
		<description><![CDATA[While playing through Hitman: Absolution I ran into a bug which was occurring at the start of the Birdie&#8217;s Gift chapter, in which the game would crash and return to the desktop after the first of two cut scenes. To fix this try running the game in windowed mode instead of full screen mode until [...]]]></description>
				<content:encoded><![CDATA[<p>While playing through Hitman: Absolution I ran into a bug which was occurring at the start of the Birdie&#8217;s Gift chapter, in which the game would crash and return to the desktop after the first of two cut scenes.</p>
<p>To fix this try running the game in windowed mode instead of full screen mode until the cut scenes has finished and then switch back to full screen mode to continue playing as normal.</p>
<p>If this doesn&#8217;t work for you some people have suggested the following (though this did not work for me):</p>
<ol>
<li>Exit the game</li>
<li>Right click Hitman: Absolution in Steam and click properties.</li>
<li>In the window that appears click the Local Files tab</li>
<li>In the Local Files tab click on the third button down, labelled &#8220;Verify Integirty of Game Cache&#8230;&#8221; (see below).</li>
</ol>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/12/steam-hitman-properties.png" rel="lightbox[924]"><img class="alignnone size-medium wp-image-927" title="Hitman: Absolution Properties Window" src="http://blog.intninety.co.uk/wp-content/uploads/2012/12/steam-hitman-properties-300x194.png" alt="Hitman: Absolution Properties Window" width="300" height="194" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2012/12/fixing-crash-after-cut-scene-in-hitman-absolution/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding Both Undo and Redo Functionality to the .NET TextBox</title>
		<link>http://blog.intninety.co.uk/2012/11/adding-both-undo-and-redo-functionality-to-the-net-textbox/</link>
		<comments>http://blog.intninety.co.uk/2012/11/adding-both-undo-and-redo-functionality-to-the-net-textbox/#comments</comments>
		<pubDate>Fri, 09 Nov 2012 22:20:12 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[forms]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[redo]]></category>
		<category><![CDATA[studio]]></category>
		<category><![CDATA[textbox]]></category>
		<category><![CDATA[undo]]></category>
		<category><![CDATA[visual]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[winforms]]></category>

		<guid isPermaLink="false">http://blog.intninety.co.uk/?p=895</guid>
		<description><![CDATA[If you are working on a project that requires the ability to support undo and redo operations with the standard TextBox control, you are soon to run into the very annoying surprise that Microsoft didn&#8217;t add a redo method to the TextBox control to coincide with the Undo Method. You may also find out that [...]]]></description>
				<content:encoded><![CDATA[<p>If you are working on a project that requires the ability to support undo and redo operations with the standard TextBox control, you are soon to run into the very annoying surprise that Microsoft didn&#8217;t add a redo method to the TextBox control to coincide with the <a href="http://msdn.microsoft.com/en-us/library/system.windows.forms.textboxbase.undo(v=vs.90).aspx" target="_blank">Undo Method</a>. You may also find out that the undo method they did implement is not too great, and only supports undoing one change.</p>
<p>As I had to add this functionality, I have created an extension of the TextBox control for everyone to freely use, the source code of which you can find at <a href="https://github.com/intninety/temporaltextbox" target="_blank">https://github.com/intninety/temporaltextbox</a>. This post is essentially just giving an overview of it and an example of how to implement it.</p>
<p>For anyone not interested in the summary and implementation explanation that just wants to skip straight to the actual code of the extended class, you can find it here: <a href="https://github.com/intninety/temporaltextbox/blob/master/TemporalTextBox/TemporalTextBox.cs" target="_blank">https://github.com/intninety/temporaltextbox/blob/master/TemporalTextBox/TemporalTextBox.cs</a></p>
<h2>What version of .NET is this compatible with?</h2>
<p>As of the time of writing this, it requires 3.5 or later. It is possible to rewrite it to work with 2.0 if you do want to, you&#8217;d just have to replace the use of LINQ in the Transform method.</p>
<h2>What is better about the undo functionality in TemporalTextBox?</h2>
<p>Unlike the standard TextBox, TemporalTextBox will allow you to undo every operation as far back as it being initialised as opposed to only being able to undo the very last operation.</p>
<h2>How do I implement it?</h2>
<p>The first thing you&#8217;ll need to do is grab a copy of the source code from <a href="https://github.com/intninety/temporaltextbox" target="_blank">https://github.com/intninety/temporaltextbox</a>.</p>
<p>If you decide to build the DLL from the project then add a reference to it into your own project. Alternatively if you want to include the source code directly in your project, then make sure you add a reference to LINQ.</p>
<p>Once you&#8217;ve got the TemporalTextBox reference or class in your project we can get started on implementing it!</p>
<p>To use the control you can either add it via the Toolbox as you normally would in the designer, or you can use the <strong>Transform</strong> method. The <strong>Transform</strong> method will consume a standard TextBox and set all the properties of your TemporalTextBox to be the same, allowing it to seemlessly take the place of the one you have already designed your form with.</p>
<p>If you want to try out the transform method then add a standard TextBox control onto your form and tweak it as you want. Now switch to the code view and add a new instance member of type TemporalTextBox. Once in the code view add the following code in the Shown event of your form, replacing temporalTextBox with the name of your TemporalTextBox instance, and textBox1 with the name of your standard TextBox.</p>
<p></p><pre class="crayon-plain-tag">this.temporalTextBox = new TemporalTextBox();
this.temporalTextBox.Transform(this.textBox1, true);
this.Controls.Add(this.temporalTextBox);</pre><p></p>
<p>And voila, you now have your TemporalTextBox on your form and are now ready to utilise the undo and redo methods!</p>
<p>Using these doesn&#8217;t really require much explanation, simply call the <strong>Undo</strong> method to undo an operation, and call <strong>Redo</strong> to redo a previous undo operation; it&#8217;s that simple&#8230;</p>
<p>If you don&#8217;t want to use the improved undo functionality I mentioned previously that is in TemporalTextBox you&#8217;ll just have to make sure you set the <strong>UseCustomUndoMethod</strong> property to false. This will have no effect on the redo functionality  you&#8217;ll still be able to use the redo method even if using the standard undo method.</p>
<h2>How are strings pushed to the undo and redo stacks?</h2>
<p>Unless you&#8217;re interested in how the undo and redo methods are implemented behind the scenes, you may want to skip this section!</p>
<p>The current text (prior to the key press) is pushed onto the undo stack every time the user presses one of the following keys:</p>
<ul>
<li>Backspace</li>
<li>Delete</li>
<li>Enter</li>
<li>Space</li>
</ul>
<p>In addition to this, when the text is changed it checks to see if the difference between the previous text and the new text is more than a character long, if it is then we push to the stack again (as this would imply a paste operation). If we only have one character then we don&#8217;t push to the stack as we don&#8217;t want undo operations to be on a per-character basis. If the length of the two strings are equal, then this would imply that we have had a paste operation over an existing piece of text, so we check to see if the strings are also equal, and if they aren&#8217;t we push to the stack.</p>
<p>The redo stack is simply pushed to every time we make a call to the undo method.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2012/11/adding-both-undo-and-redo-functionality-to-the-net-textbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Default CurrentCulture in all Versions of .NET</title>
		<link>http://blog.intninety.co.uk/2012/09/setting-default-currentculture-in-all-versions-of-net/</link>
		<comments>http://blog.intninety.co.uk/2012/09/setting-default-currentculture-in-all-versions-of-net/#comments</comments>
		<pubDate>Wed, 12 Sep 2012 21:24:42 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[c-sharp]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[culture]]></category>
		<category><![CDATA[cultureinfo]]></category>
		<category><![CDATA[CurrentCulture]]></category>
		<category><![CDATA[CurrentUICulture]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[globalisation]]></category>
		<category><![CDATA[globalization]]></category>
		<category><![CDATA[localisation]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[thread]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://blog.intninety.co.uk/?p=829</guid>
		<description><![CDATA[If you are using any version of .NET prior to 4.5, you will not have access to the handy property that is DefaultThreadCurrentCulture (or if you are using .NET 4.5 just stop reading here and use that property!). However, that does not mean you can&#8217;t set the default CultureInfo to be used across the current thread and [...]]]></description>
				<content:encoded><![CDATA[<p>If you are using any version of .NET prior to 4.5, you will not have access to the handy property that is <a href="http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo.defaultthreadcurrentculture.aspx" target="_blank">DefaultThreadCurrentCulture</a> (or if you are using .NET 4.5 just stop reading here and use that property!). However, that does not mean you can&#8217;t set the default <a href="http://msdn.microsoft.com/en-us/library/kx54z3k7" target="_blank">CultureInfo</a> to be used across the current thread <strong>and</strong> all threads spawned afterwards in the one place.</p>
<p>The CultureInfo class has two private static members named <strong>m_userDefaultCulture</strong> and <strong>m_userDefaultUICulture</strong> in versions prior to .NET 4.0; in 4.0 they are named <strong>s_userDefaultCulture</strong> and <strong>s_userDefaultUICulture</strong>.</p>
<p>These two members are used when calling <strong>Thread.CurrentThread.CurrentCulture</strong> and <strong>Thread.CurrentThread.CurrentUICulture</strong>, and with some simple reflection we can set these members, and all calls from there on to these two properties will return our newly set default.</p>
<p>Copy and paste the method below into your project wherever you see fit, ensuring that you are using both <strong>System.Globalization</strong> and <strong>System.Reflection</strong> at the top of the file:</p>
<p></p><pre class="crayon-plain-tag">public void SetDefaultCulture(CultureInfo culture)
{
    Type type = typeof(CultureInfo);

    try
    {
        type.InvokeMember(&quot;s_userDefaultCulture&quot;,
                            BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Static,
                            null,
                            culture,
                            new object[] { culture });

        type.InvokeMember(&quot;s_userDefaultUICulture&quot;,
                            BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Static,
                            null,
                            culture,
                            new object[] { culture });
    }
    catch { }

    try
    {
        type.InvokeMember(&quot;m_userDefaultCulture&quot;,
                            BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Static,
                            null,
                            culture,
                            new object[] { culture });

        type.InvokeMember(&quot;m_userDefaultUICulture&quot;,
                            BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Static,
                            null,
                            culture,
                            new object[] { culture });
    }
    catch { }
}</pre><p></p>
<p>Just to give a slight overview of what is happening in that method re. the try catch blocks &#8211; as mentioned previously, the names of these static members differs between .NET 4.0 and versions prior, so this will attempt to set both and fall back to whichever one it needs.</p>
<p>Once you&#8217;ve added the method, simply call it and pass through the CultureInfo you wish to be the default and you&#8217;re done!</p>
<p>Below is a full example of how it can be used, or alternatively you can <a href="http://blog.intninety.co.uk/wp-content/uploads/2012/09/DefaultCultureInfoExample.zip">Download This Sample Project</a>.</p>
<p>Enjoy!</p>
<p></p><pre class="crayon-plain-tag">using System;
using System.Globalization;
using System.Reflection;
using System.Threading;

namespace DefaultCultureInfoExample
{
    class Program
    {
        static void SetDefaultCulture(CultureInfo culture)
        {
            Type type = typeof(CultureInfo);

            try
            {
                type.InvokeMember(&quot;s_userDefaultCulture&quot;,
                                    BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Static,
                                    null,
                                    culture,
                                    new object[] { culture });

                type.InvokeMember(&quot;s_userDefaultUICulture&quot;,
                                    BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Static,
                                    null,
                                    culture,
                                    new object[] { culture });
            }
            catch { }

            try
            {
                type.InvokeMember(&quot;m_userDefaultCulture&quot;,
                                    BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Static,
                                    null,
                                    culture,
                                    new object[] { culture });

                type.InvokeMember(&quot;m_userDefaultUICulture&quot;,
                                    BindingFlags.SetField | BindingFlags.NonPublic | BindingFlags.Static,
                                    null,
                                    culture,
                                    new object[] { culture });
            }
            catch { }
        }

        static void Main(string[] args)
        {
            Console.WriteLine(&quot;Culture name before update: {0}&quot;, 
                              Thread.CurrentThread.CurrentCulture.Name);

            SetDefaultCulture(new CultureInfo(&quot;fr-fr&quot;));
            Console.WriteLine(&quot;Culture name after update: {0}&quot;, 
                              Thread.CurrentThread.CurrentCulture.Name);

            Console.ReadLine();
        }
    }
}</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2012/09/setting-default-currentculture-in-all-versions-of-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capturing Network Traffic using the WiFi Pineapple, tcpdump and Android</title>
		<link>http://blog.intninety.co.uk/2012/08/capturing-network-traffic-using-the-wifi-pineapple-tcpdump-and-android/</link>
		<comments>http://blog.intninety.co.uk/2012/08/capturing-network-traffic-using-the-wifi-pineapple-tcpdump-and-android/#comments</comments>
		<pubDate>Sun, 26 Aug 2012 21:18:36 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[3g]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[hak5]]></category>
		<category><![CDATA[honeypot]]></category>
		<category><![CDATA[jasager]]></category>
		<category><![CDATA[mark iv]]></category>
		<category><![CDATA[mk4]]></category>
		<category><![CDATA[mkiv]]></category>
		<category><![CDATA[pcap]]></category>
		<category><![CDATA[pineapple]]></category>
		<category><![CDATA[rooted]]></category>
		<category><![CDATA[shark for root]]></category>
		<category><![CDATA[sniff]]></category>
		<category><![CDATA[tcpdump]]></category>
		<category><![CDATA[tethering]]></category>
		<category><![CDATA[wifi]]></category>
		<category><![CDATA[wireshark]]></category>

		<guid isPermaLink="false">http://blog.intninety.co.uk/?p=751</guid>
		<description><![CDATA[First off I&#8217;d just like to say props to Robin Wood, Darren Kitchen, Sebastian Kinne, Rob Fuller and everyone else who has contributed to the WiFi Pineapple project, you&#8217;ve done a great job! There are a few things in this guide that I&#8217;m not going to cover (such as rooting your device, the ins and outs of [...]]]></description>
				<content:encoded><![CDATA[<p>First off I&#8217;d just like to say props to <a href="http://www.digininja.org/">Robin Wood</a>, <a href="http://hak5.org/">Darren Kitchen</a>, <a href="http://sebkinne.com/">Sebastian Kinne</a>, <a href="http://www.room362.com/">Rob Fuller</a> and everyone else who has contributed to the WiFi Pineapple project, you&#8217;ve done a great job!</p>
<p>There are a few things in this guide that I&#8217;m not going to cover (such as rooting your device, the ins and outs of WireShark etc.), however I&#8217;ll add links to appropriate reading material for these things where I can! And if you&#8217;re still stuck feel free to ask for help in the comments.</p>
<h2>Why not just use tcpdump on the pineapple itself?</h2>
<p>The reason I ended up trying to do this is due to the fact that the pineapple only has the one USB port, and I don&#8217;t have a powered USB hub, so I thought &#8211; &#8220;Hey, why not just capture the traffic on my phone seeing as it&#8217;s tethering to the pineapple anyway?&#8221;.</p>
<p>In addition to not requiring a USB hub, it also has the benefit of not soaking up more battery power from the pineapple itself as it doesn&#8217;t have to power a pen drive and write data to it constantly.</p>
<h2>What do we need to get started?</h2>
<ul>
<li>A WiFi Pineapple MKIV, available from <a href="http://hakshop.myshopify.com/collections/gadgets/products/wifi-pineapple" target="_blank">The HakShop</a><br />
<em>I&#8217;d recommend the elite bundle for the extra goodies and as a means of helping support the project!</em></li>
<li>A rooted Android device with the <a href="https://play.google.com/store/apps/details?id=lv.n3o.shark&amp;hl=en" target="_blank">Shark for Root</a> app installed</li>
<li>A program capable of viewing pcap files. For this example I&#8217;ll be using <a href="http://www.wireshark.org/" target="_blank">WireShark</a></li>
</ul>
<p><em>N.B. I should point out, at this point in time I am using version 2.6.1 of the firmware, which supports Android tethering without much extra configuration. If you are using an earlier version you may need to follow <a href="http://forums.hak5.org/index.php?/topic/26601-mk4-android-tethering-how-to/" target="_blank">This Guide</a> by wiregr.</em></p>
<h2>Setting up the Pineapple</h2>
<p>First thing&#8217;s first, power up your pineapple and give it a few minutes to finish booting. After it&#8217;s booted and ready to go, plug in your Android device via USB as in the picture below and enable USB tethering from your settings menu. The location of the tethering option can vary from device to device, but on my Samsung Galaxy S2 it can be found in Settings &gt; Wireless and networks &gt; Tethering and portable hotspot &gt; USB tethering.</p>
<p><a href='http://blog.intninety.co.uk/2012/08/capturing-network-traffic-using-the-wifi-pineapple-tcpdump-and-android/dsc_0026/' title='The WiFi Pineapple and an Android device setup for tethering'><img width="150" height="150" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/DSC_0026-150x150.jpg" class="attachment-thumbnail" alt="The WiFi Pineapple and an Android device setup for tethering" /></a><br />
<a href='http://blog.intninety.co.uk/2012/08/capturing-network-traffic-using-the-wifi-pineapple-tcpdump-and-android/tethering/' title='The tethering settings in ICS on a Galaxy S2'><img width="150" height="150" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/tethering-150x150.jpg" class="attachment-thumbnail" alt="The tethering settings in ICS on a Galaxy S2" /></a></p>
<p>Give this a moment to begin tethering and then connect to the pineapple, either by Ethernet or by WiFi. Once connected to the pineapple network, SSH into the device (default credentials are root:pineapplesareyummy) and attempt to ping Google or any other external address to ensure that the Android device is indeed tethering to the pineapple.</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/connectivity-test.jpg" rel="lightbox[751]"><img class="alignnone size-medium wp-image-797" title="Testing connectivity from the pineapple" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/connectivity-test-300x200.jpg" alt="Testing connectivity from the pineapple" width="300" height="200" /></a></p>
<p>Once we know the Internet connection from the Android device is definitely tethered to the pineapple, we need to configure iptables to route the traffic from the connected clients via the usb0 interface. You can either do this via the SSH session we have open, or by logging in to the pineapple&#8217;s web control panel and copying and pasting the commands into the &#8220;Execute Commands&#8221; box in the advanced tab.</p>
<p>The commands you need to execute are:</p>
<p></p><pre class="crayon-plain-tag">iptables -t nat -A POSTROUTING -s 172.16.42.0/24 -o usb0 -j MASQUERADE
iptables -A FORWARD -s 172.16.42.0/24 -o usb0 -j ACCEPT
iptables -A FORWARD -d 172.16.42.0/24 -m state --state ESTABLISHED,RELATED -i usb0 -j ACCEPT</pre><p></p>
<p>This will have to be done every time you restart the pineapple, however you could throw it in a script if you wanted and make it run automatically on startup if you so wish.</p>
<p><em>N.B. At the time of writing this, the iptables configuration is necessary, however I believe that the Jasager team have plans to make this automatic in the future.</em></p>
<h2>Setting up the Android Device</h2>
<p>Now that our pineapple is setup and ready to go, we need to setup the Android device to capture traffic (this is much simpler than you may think).</p>
<p>As mentioned in the first section, your Android device <strong>must</strong> be rooted in order to run the app we need to capture traffic. As rooting devices is a topic (and in some cases challenge) of its own, I&#8217;m not going to go over it here. If you do need to root your device though, I&#8217;d recommend checking out <a href="http://forum.xda-developers.com/showthread.php?t=1746794">This Guide</a> at XDA-Developers. I have tested it, it works, and is about the fastest way you could root your device!</p>
<p>Now, the only thing we need for this step is an app available from the Google Play Store which is called Shark for Root, developed by <a href="https://play.google.com/store/apps/developer?id=Elviss+Ku%C5%A1tans">Elviss Kuštans</a>. You can download Shark for Root free from the following page: <a href="https://play.google.com/store/apps/details?id=lv.n3o.shark&amp;hl=en">https://play.google.com/store/apps/details?id=lv.n3o.shark&amp;hl=en</a></p>
<h2>Capturing the Traffic</h2>
<p>Once you&#8217;ve installed it, open it up and if presented with a screen asking your permission for it to use root access go ahead and accept it. The screen you&#8217;ll be presented with is pretty straight forward, there is a parameters input field which will let you specify the parameters you want to pass through to tcpdump (leave this as it is if you&#8217;re not familiar with it).</p>
<p>When you&#8217;re ready to begin monitoring the traffic hit the button labelled &#8220;Start&#8221; and the status should change to &#8220;Running&#8221;, with some information about the data it is capturing.</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/Screenshot_2012-08-26-21-03-04.png" rel="lightbox[751]"><img class="alignnone size-thumbnail wp-image-799" title="Shark capturing traffic on the network" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/Screenshot_2012-08-26-21-03-04-150x150.png" alt="Shark capturing traffic on the network" width="150" height="150" /></a></p>
<p>Now head over to another device that is connected to the pineapple and navigate to Google and search for something (for this example I&#8217;m going to search for &#8220;herpy derp derp&#8221;). Once the page has loaded you can go back to your Android device and click the stop button. After stopping Shark, make sure to take note of the filename so you know which file you are going to be working with.</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/Screenshot_2012-08-26-21-04-47.png" rel="lightbox[751]"><img class="alignnone size-thumbnail wp-image-807" title="The Shark monitor screen after stopping the process" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/Screenshot_2012-08-26-21-04-47-150x150.png" alt="The Shark monitor screen after stopping the process" width="150" height="150" /></a></p>
<h2>Examining the Captured Data</h2>
<p>I&#8217;m not going to go into much depth here as again examining network captures is a topic of its own, and if you&#8217;re up to this point you probably know what to be doing with a pcap file anyway.</p>
<p>Plug your Android device into your computer and copy over the pcap file that Shark exported to in the previous step, and open it up in WireShark.</p>
<p>What you see now is all the data that passed through the pineapple to the Android device, and anything else that the phone was doing on the network it was connected to.</p>
<p>If you want to filter this down to HTTP traffic, type &#8220;http&#8221; in the filter field and hit enter. As you can see in the screenshot below, the Google search for &#8220;herpy derp derp&#8221; was successfully captured.</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/wireshark.jpg" rel="lightbox[751]"><img class="alignnone size-medium wp-image-811" title="The pcap file being viewed in WireShark" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/wireshark-300x168.jpg" alt="The pcap file being viewed in WireShark" width="300" height="168" /></a></p>
<h2>The Covering My Ass Section</h2>
<p>It goes without saying that to be doing this on a public network without the users&#8217; permission is <strong>illegal </strong>due to the fact you can capture sensitive data via these means such as login credentials. If you&#8217;re going to do this and don&#8217;t want to have your hands slapped in the process, do it with your own devices or seek permission from people first who&#8217;s data you&#8217;ll be capturing.</p>
<p>If you are going to insist on doing this in public (which again, I am not encouraging!), at least don&#8217;t be an ass hat about it by screwing around with any personal data you may find; play nice!</p>
<p>Any questions or problems encountered? Feel free to post them!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2012/08/capturing-network-traffic-using-the-wifi-pineapple-tcpdump-and-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable Shortcuts in WebBrowser Control and keep Copy and Paste</title>
		<link>http://blog.intninety.co.uk/2012/08/disable-shortcuts-in-webbrowser-control-and-keep-copy-and-paste/</link>
		<comments>http://blog.intninety.co.uk/2012/08/disable-shortcuts-in-webbrowser-control-and-keep-copy-and-paste/#comments</comments>
		<pubDate>Sun, 19 Aug 2012 22:06:34 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[disable]]></category>
		<category><![CDATA[f5]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[refresh]]></category>
		<category><![CDATA[shortcuts]]></category>
		<category><![CDATA[webbrowser]]></category>
		<category><![CDATA[WebBrowserShortcutsEnabled]]></category>

		<guid isPermaLink="false">http://blog.intninety.co.uk/?p=733</guid>
		<description><![CDATA[It took me a while to figure this one out (admittedly it shouldn&#8217;t have taken as long as it did!), so hopefully this will save someone else banging their head against the desk if they run into the same issue. The Problem I have a WebBrowser control which navigates to about:blank and then loads HTML [...]]]></description>
				<content:encoded><![CDATA[<p>It took me a while to figure this one out (admittedly it shouldn&#8217;t have taken as long as it did!), so hopefully this will save someone else banging their head against the desk if they run into the same issue.</p>
<h2>The Problem</h2>
<p>I have a WebBrowser control which navigates to about:blank and then loads HTML into the document from an embedded resource and then is altered afterwards to show incoming data. As this document is being built in real time, it causes issues when the user hits the F5 key, as it refreshes about:blank and shows them a blank screen again.</p>
<p>My initial solution to this was to just set the WebBrowserShortcutsEnabled property to false, gave it a test, it stopped it refreshing, all was good with the world again! Or not&#8230;</p>
<p>The WebBrowserShortcutsEnabled property will also disable CTRL+C and CTRL+V, although I don&#8217;t need the paste shortcut, I do need the copy shortcut.</p>
<h2>The Solution</h2>
<p>The solution is actually very simple, and I&#8217;m not sure why it took so long to come to the conclusion (I blame lack of Red Bull flowing through my veins!). But again &#8211; in case anyone is banging their heads against their desk, this is what you need to do:</p>
<p>Set the WebBrowserShortcutsEnabled property to false as previously mentioned and create an event handler for the PreviewKeyDown event of the WebBrowser control and add the code below to it</p>
<p></p><pre class="crayon-plain-tag">if ((e.Modifiers == Keys.Control) &amp;&amp; (e.KeyCode == Keys.C))
{
    webBrowser1.Document.ExecCommand(&quot;Copy&quot;, false, null);
}</pre><p></p>
<p>If you need to add more functionality back (i.e. cut and paste), the ExecCommand method also accepts <strong>Cut</strong> and <strong>Paste</strong> as commands, so just repeat the code above to pick up the X and V keys too and execute the appropriate command.</p>
<h2>Additional Step</h2>
<p>If also like me, you need to stop the user from navigating to another page from within your WebBrowser control, add an event handler for the Navigating event of your WebBrowser control and add the following:</p>
<p></p><pre class="crayon-plain-tag">if (!e.Url.ToString().Equals(&quot;about:blank&quot;))
{
	System.Diagnostics.Process.Start(e.Url.ToString());
	e.Cancel = true;
}

if ((webBrowser1.Tag != null) &amp;&amp; (webBrowser1.Tag.Equals(true)))
{
	e.Cancel = true;
}</pre><p></p>
<p>This will force all pages to open in a new window, and if you set the Tag property to be true after you have loaded your initial content into the page, will prevent a link to about:blank sending the user back to a blank page!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2012/08/disable-shortcuts-in-webbrowser-control-and-keep-copy-and-paste/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cracking PPTP / MS-CHAPv2 with Chapcrack &amp; CloudCracker</title>
		<link>http://blog.intninety.co.uk/2012/08/cracking-pptp-ms-chapv2-with-chapcrack-cloudcracker/</link>
		<comments>http://blog.intninety.co.uk/2012/08/cracking-pptp-ms-chapv2-with-chapcrack-cloudcracker/#comments</comments>
		<pubDate>Fri, 10 Aug 2012 23:50:40 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Networking]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[backtrack]]></category>
		<category><![CDATA[chapcrack]]></category>
		<category><![CDATA[cloudcracker]]></category>
		<category><![CDATA[crack]]></category>
		<category><![CDATA[dc20]]></category>
		<category><![CDATA[defcon]]></category>
		<category><![CDATA[des]]></category>
		<category><![CDATA[ms-chapv2]]></category>
		<category><![CDATA[pptp]]></category>
		<category><![CDATA[vpn]]></category>

		<guid isPermaLink="false">http://blog.intninety.co.uk/?p=650</guid>
		<description><![CDATA[After a long trip to the United States to return to Defcon, I am back and thought I&#8217;d share some information on a talk I checked out by Moxie Marlinspike which was of particular interest to me as this year I decided to use a PPTP tunnel instead of an SSH tunnel; not the best of [...]]]></description>
				<content:encoded><![CDATA[<p>After a long trip to the United States to return to Defcon, I am back and thought I&#8217;d share some information on a talk I checked out by <a href="https://twitter.com/moxie" target="_blank">Moxie Marlinspike</a> which was of particular interest to me as this year I decided to use a PPTP tunnel instead of an SSH tunnel; not the best of ideas it turns out!</p>
<p><em>If you happen to be reading this Moxie, kudos on your research and work on chapcrack! The story about the boat guards at the dock that you mentioned at the beginning of your talk at Defcon this year was also very amusing!</em></p>
<h2>What is Chapcrack and CloudCracker?</h2>
<p><a href="https://github.com/moxie0/chapcrack" target="_blank">Chapcrack</a> is a tool you can use to take network packet captures and extract from them a string which can be submitted to <a href="http://www.cloudcracker.com/" target="_blank">CloudCracker </a>which can finish a brute force against it in a worst case scenario of 24 hours and return to you via e-mail the cracked key.</p>
<p>CloudCracker does come at a cost (that being $200 per key), however if you really need to crack the key the money isn&#8217;t much to part with when you take into consideration the amount of time that will be saved if a strong key has been chosen.</p>
<h2>Some Background on the Protocol and its Flaws</h2>
<p><em>Just want to start off pointing out this research of the protocol is not my own, I am not taking credit for it, it was done by Moxie, I am just reposting it for the sake of keeping this post as informative as possible!</em></p>
<p>Let&#8217;s take a look at the protocol itself, in order to see what we&#8217;re dealing with:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/protocol-frame1-e1344632468334.png" rel="lightbox[650]"><img class="aligncenter size-full wp-image-668" title="protocol-frame[1]" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/protocol-frame1-e1344632468334.png" alt="" width="640" height="487" /></a></p>
<p>At first glance, one is initially struck by the unnecessary complexity of the protocol. It almost feels like the digital equivalent of hand-waving — as if throwing in one more hash, random nonce, or unusual digest construction will somehow dazzle any would-be adversaries into submission. The literal strings &#8220;Pad to make it do more than one iteration&#8221; and &#8220;Magic server to client signing constant&#8221; are particularly amusing.</p>
<p>If we look carefully, however, there is really only one unknown in the entire protocol — the MD4 hash of the user&#8217;s passphrase, which is used to construct three separate DES keys. Every other element of the protocol is either sent in the clear, or can be easily derived from something sent in the clear:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/protocol-highlighted-frame1-e1344632704875.png" rel="lightbox[650]"><img class="aligncenter size-full wp-image-673" title="protocol-highlighted-frame[1]" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/protocol-highlighted-frame1-e1344632704875.png" alt="" width="640" height="487" /></a></p>
<p>Given that everything else is known, we can try ignoring everything but the core unknown, and seeing if there are any possibilities available to us:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/protocol-core-highlighted-frame1-e1344633500703.png" rel="lightbox[650]"><img class="aligncenter size-full wp-image-675" title="protocol-core-highlighted-frame[1]" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/protocol-core-highlighted-frame1-e1344633500703.png" alt="" width="640" height="238" /></a></p>
<p>We have an unknown password, an unknown MD4 hash of that password, a known plaintext, and a known ciphertext. Looking back at the larger scope, we can see that the MD4 hash of the user&#8217;s password serves as a password-equivalent — meaning that the MD4 hash of the user&#8217;s password is enough to authenticate as them, as well as to decrypt any of their traffic. So our objective is to recover the MD4 hash of the user&#8217;s password.</p>
<p>Typically, given a packet capture, this is where a network adversary would attempt to employ a dictionary attack. Using a tool such as <a href="http://www.willhackforsushi.com/Asleap.html" target="_blank">asleap</a>, it&#8217;s possible to rapidly attempt a series of password guesses offline. The attacker can simply calculate MD4(password_guess), split that hash up into three DES keys, encrypt the known plaintext three times, and see if the concatenated output from those DES operations matches the known ciphertext.</p>
<p>The problem with this approach is that it won&#8217;t give the attacker a 100% success rate, and relies on the user&#8217;s propensity for selecting a predictable password. In the case of the riseup.net PPTP VPN service, for instance, the attacker would need to attempt guesses across the full 96 key character set for all 21 characters of the generated password. That&#8217;s a total complexity of 96<sup>21</sup> — slightly larger than 2<sup>138</sup>, or what you could think of as a 138 bit key.</p>
<p>In a situation with an unbounded password length across a large character set, it would make more sense to brute force the output of the MD4 hash directly. But that&#8217;s still 128bits, making the total keyspace for a brute force approach on that value 2<sup>128</sup> — which will likely be forever computationally infeasible.</p>
<p>The hash we&#8217;re after, however, is used as the key material for three DES operations. DES keys are 7 bytes long, so each DES operation uses a 7 byte chunk of the MD4 hash output. This gives us an opportunity for a classic divide and conquer attack. Instead of brute forcing the MD4 hash output directly (a complexity of 2<sup>128</sup>), we can incrementally brute force 7 bytes of it at a time.</p>
<p>Since there are three DES operations, and each DES operation is completely independent of the others, that gives us an additive complexity of 2<sup>56</sup> + 2<sup>56</sup> + 2<sup>56</sup>, a total keyspace of 2<sup>57.59</sup></p>
<p>This is certainly better than 2<sup>138</sup> or 2<sup>128</sup>, but still quite a large number. There&#8217;s something wrong with our calculations though. We need three DES keys, each 7 bytes long, for a total of 21 bytes:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/keys-frame1-e1344634103227.png" rel="lightbox[650]"><img class="aligncenter size-full wp-image-680" title="keys-frame[1]" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/keys-frame1-e1344634103227.png" alt="" width="640" height="112" /></a></p>
<p>Those keys are drawn from the output of MD4(password), though, which is only 16 bytes:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/keys-hash-frame1-e1344634185156.png" rel="lightbox[650]"><img class="aligncenter size-full wp-image-682" title="keys-hash-frame[1]" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/keys-hash-frame1-e1344634185156.png" alt="" width="640" height="230" /></a></p>
<p>We&#8217;re missing five bytes of key material for the third DES key. Microsoft&#8217;s solution was to simply pad those last five bytes out as zero, effectively making the third DES key two bytes long:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/keys-padding-frame1-e1344634335619.png" rel="lightbox[650]"><img class="aligncenter size-full wp-image-685" title="keys-padding-frame[1]" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/keys-padding-frame1-e1344634335619.png" alt="" width="640" height="116" /></a></p>
<p>Since the third DES key is only two bytes long, a keyspace of 2<sup>16</sup>, we can immediately see the effectiveness of divide-and-conquer approach by brute forcing the third key in a matter of seconds, giving us the last two bytes of the MD4 hash. We&#8217;re left trying to find the remaining 14 bytes of the MD4 hash, but can divide-and-conquer those in two 7 byte chunks, for a total complexity of 2<sup>57</sup>.</p>
<p>Again, still a big number, but considerably better. We&#8217;re left with, essentially, this core problem:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/protocol-core-reduced-frame1-e1344634500121.png" rel="lightbox[650]"><img class="aligncenter size-full wp-image-687" title="protocol-core-reduced-frame[1]" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/protocol-core-reduced-frame1-e1344634500121.png" alt="" width="640" height="116" /></a></p>
<p>The next interesting thing about the remaining unknowns is that both of the remaining DES operations are over the <em>same</em> plaintext, only with different keys. The naive approach to cracking these DES operations would look like:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/code-naieve-frame1-e1344634640493.png" rel="lightbox[650]"><img class="aligncenter size-full wp-image-689" title="code-naieve-frame[1]" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/code-naieve-frame1-e1344634640493.png" alt="" width="640" height="391" /></a></p>
<p>&#8230;iterate over every key in the keyspace, and use each key to encrypt our known plaintext and compare it to our first known ciphertext. When we find a match, we start over and iterate through every key in the keyspace, encrypt our known plaintext, and compare it to our second known ciphertext.</p>
<p>The expensive part of these loops are the DES operations. But since it&#8217;s the same plaintext for both loops, we can consolidate them into a <em>single</em> iteration through the keyspace, with one encrypt for each key, and two compares:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/code-consolidated-frame1-e1344634964853.png" rel="lightbox[650]"><img class="aligncenter size-full wp-image-691" title="code-consolidated-frame[1]" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/code-consolidated-frame1-e1344634964853.png" alt="" width="640" height="292" /></a></p>
<p>This brings us down to a total complexity of 2<sup>56</sup>!</p>
<p>This means that, effectively, the security of MS-CHAPv2 can be reduced to the strength of a <em>single</em>DES encryption.</p>
<h2>So Let&#8217;s Crack this Key Already!</h2>
<p>The first thing you&#8217;re going to have to do is download the latest copy of the chapcrack source files from <a href="https://github.com/moxie0/chapcrack/zipball/master" target="_blank">Here</a> or visit the <a href="https://github.com/moxie0/chapcrack" target="_blank">Github Page</a> if you need a specific revision (I am using commit b2f5cf8 as of the time of writing this).</p>
<p>As this is a <a href="http://www.python.org/" target="_blank">Python</a> program, it goes without saying you&#8217;ll have to install Python! I won&#8217;t go into this here as there are plenty of tutorials around the web on setting it up in the environment of your choice.</p>
<p>Before you install chapcrack you may require a few prerequisites first. I installed chapcrack on a fresh install of <a href="http://www.backtrack-linux.org/" target="_blank">BackTrack5</a>, and these were the steps I had to take:</p>
<h3>Installing Passlib</h3>
<blockquote><p><em>Passlib is a password hashing library for Python 2 &amp; 3, which provides cross-platform implementations of over 30 password hashing algorithms, as well as a framework for managing existing password hashes. It&#8217;s designed to be useful for a wide range of tasks, from verifying a hash found in /etc/shadow, to providing full-strength password hashing for multi-user applications.</em></p></blockquote>
<p>To install passlib, head over to the <a href="http://pypi.python.org/pypi/passlib/#downloads" target="_blank">Downloads Page</a> and grab the latest version, extract it and then open a terminal in the same directory and run the following command:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/python.setup_.py_.install.png" rel="lightbox[650]"><img class="size-full wp-image-698 alignnone" title="python.setup.py.install" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/python.setup_.py_.install.png" alt="" width="458" height="20" /></a></p>
<p>Once it&#8217;s done its thing the installation has finished and we can move on!</p>
<h3>Installing python-m2crypto</h3>
<blockquote><p><em>M2Crypto is the most complete OpenSSL wrapper for Python. M2Crypto makes it relatively easy to add cryptographic support and security to your Python applications.</em></p></blockquote>
<p>Again, just one small command to run and we&#8217;re done!</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/apt-get.install.python-m2crypto.png" rel="lightbox[650]"><img class="alignnone size-full wp-image-700" title="apt-get.install.python-m2crypto" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/apt-get.install.python-m2crypto.png" alt="" width="517" height="19" /></a></p>
<p>Now that we have the prerequisites we can install chapcrack! Change your working directory in your terminal to the directory in which you extracted the chapcrack ZIP file and then run the following command to install chapcrack:</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/python.setup_.py_.install.chapcrack.png" rel="lightbox[650]"><img class="alignnone size-full wp-image-703" title="python.setup.py.install.chapcrack" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/python.setup_.py_.install.chapcrack.png" alt="" width="420" height="19" /></a></p>
<p>Now that we have chapcrack installed we can give it a test whirl!</p>
<p>I&#8217;m not going to explain here how to capture packets over a network, as again there are lots of guides and information on this available and I&#8217;d just be reiterating them, and chances are if you&#8217;re reading this you probably know how to anyway. If you do need a push in the right direction however, have a look around for some guides on how to use <a href="http://www.wireshark.org/" target="_blank">Wireshark</a>.</p>
<p>If you don&#8217;t have a capture file already that contains an MS-CHAPv2 handshake, throw one together or alternatively you can use the sample file (pptp.cap) in the tests directory of the chapcrack download (see below) like I will be doing to demonstrate.</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/ls.l.tests_.png" rel="lightbox[650]"><img class="alignnone size-full wp-image-706" title="ls.l.tests" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/ls.l.tests_.png" alt="" width="500" height="120" /></a></p>
<p>To use chapcrack we just have to execute it with the parse -i command, passing through to it the path to our capture file. It should finish relatively quickly and give you back a few bits of data; the one we are interested in is the CloudCracker Submission.</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/chapcrack.png" rel="lightbox[650]"><img class="alignnone size-full wp-image-709" title="chapcrack" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/chapcrack.png" alt="" width="535" height="173" /></a></p>
<p>Copy and paste the CloudCracker Submission string into a file and then head over to <a href="http://www.cloudcracker.com/" target="_blank">http://www.cloudcracker.com/</a>.</p>
<p>Choose the MS-CHAPv2 option on the first page you arrive at, and then select the file you just created as the Chapcrack Output file to submit. From here just follow the instructions on the website, and when the crack is finished you&#8217;ll get an e-mail with the results; it&#8217;s that simple!</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2012/08/cloudcracker.png" rel="lightbox[650]"><img class="alignnone size-full wp-image-713" title="cloudcracker" src="http://blog.intninety.co.uk/wp-content/uploads/2012/08/cloudcracker.png" alt="" width="383" height="154" /></a></p>
<p>Apologies if I missed out any prerequisites that are not pre installed on other operating systems to BackTrack5 as this is the only system I have tested on. If you do find yourself missing any though please post a comment with your distribution and what you had to install so I can update this post!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2012/08/cracking-pptp-ms-chapv2-with-chapcrack-cloudcracker/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>C# XNA &#8211; Per Pixel Collision Detection on Rotated Objects</title>
		<link>http://blog.intninety.co.uk/2011/12/c-xna-per-pixel-collision-detection-on-rotated-objects/</link>
		<comments>http://blog.intninety.co.uk/2011/12/c-xna-per-pixel-collision-detection-on-rotated-objects/#comments</comments>
		<pubDate>Mon, 19 Dec 2011 22:18:11 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[collision]]></category>
		<category><![CDATA[detection]]></category>
		<category><![CDATA[per]]></category>
		<category><![CDATA[pixel]]></category>
		<category><![CDATA[rotation]]></category>
		<category><![CDATA[texture]]></category>
		<category><![CDATA[transformation]]></category>
		<category><![CDATA[xna]]></category>

		<guid isPermaLink="false">http://www.etftw.co.uk/blog/?p=578</guid>
		<description><![CDATA[I&#8217;ve been working on a new project this week which requires per pixel collision detection, however all the game objects that I need to detect the collisions on need to be rotated dynamically which introduced a lot of trouble when trying to detect collisions. To save anyone else from having to jump through hoops trying [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working on a new project this week which requires per pixel collision detection, however all the game objects that I need to detect the collisions on need to be rotated dynamically which introduced a lot of trouble when trying to detect collisions.</p>
<p>To save anyone else from having to jump through hoops trying to figure this out I&#8217;ve put together a class called CollidableObject which will store a texture, position in world space and rotation factor and allow you to detect collisions between them by calling the IsColliding method.</p>
<p>In order for this class to work properly, you will also have to draw your textures using the rotation values (even if you aren&#8217;t rotating your sprite) like so:</p><pre class="crayon-plain-tag">// If the player is coliding with the enemy turn the screen red
if (this.player.IsColliding(this.enemy))
{
	GraphicsDevice.Clear(Color.Red);
}

// Draw the player to the screen
spriteBatch.Draw(this.player.Texture, 
			this.player.Position, 
			null, Color.White, 
			this.player.Rotation, 
			this.player.Origin, 
			1.0f, 
			SpriteEffects.None, 
			0.0f);</pre><p>It doesn&#8217;t support the use of sprite sheets or animation, however you should be able to modify it easily to suit your needs.</p>
<p><a href="http://pastebin.com/rjKtBaNM" target="_blank">Click Here to View the Code on Pastebin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2011/12/c-xna-per-pixel-collision-detection-on-rotated-objects/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Displaying World of Warcraft Achievements in .NET</title>
		<link>http://blog.intninety.co.uk/2011/10/displaying-world-of-warcraft-achievements/</link>
		<comments>http://blog.intninety.co.uk/2011/10/displaying-world-of-warcraft-achievements/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 16:50:58 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Gaming]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[achievement]]></category>
		<category><![CDATA[battle.net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[dot]]></category>
		<category><![CDATA[dotnet]]></category>
		<category><![CDATA[how]]></category>
		<category><![CDATA[net]]></category>
		<category><![CDATA[of]]></category>
		<category><![CDATA[sharp]]></category>
		<category><![CDATA[to]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[vb]]></category>
		<category><![CDATA[vb.net]]></category>
		<category><![CDATA[warcraft]]></category>
		<category><![CDATA[world]]></category>

		<guid isPermaLink="false">http://www.etftw.co.uk/blog/?p=550</guid>
		<description><![CDATA[Setup To fetch the achievement data of the World of Warcraft character we are going to make use of armoryapi, the armoryapi library currently requires that the project&#8217;s target framework be 3.5 or higher so set your project up to use 3.5 or higher in the project properties. After creating your project and setting up [...]]]></description>
				<content:encoded><![CDATA[<h2>Setup</h2>
<p>To fetch the achievement data of the World of Warcraft character we are going to make use of <a href="http://code.google.com/p/armoryapi/">armoryapi</a>, the <a href="http://code.google.com/p/armoryapi/">armoryapi</a> library currently requires that the project&#8217;s target framework be 3.5 or higher so set your project up to use 3.5 or higher in the project properties.</p>
<p>After creating your project and setting up the target framework the next step is to add the reference to the <a href="http://code.google.com/p/armoryapi/">armoryapi</a> library. Download and extract the latest <a href="http://code.google.com/p/armoryapi/">armoryapi</a> package and you will find a DLL and an XML file inside, make note of where you have extracted these files and head back to Visual Studio. Open the &#8220;Add Reference&#8221; dialog (see <a href="http://msdn.microsoft.com/en-us/library/wkze6zky%28v=vs.80%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/wkze6zky(v=vs.80).aspx</a>) and click the tab labelled &#8220;Browse&#8221; and navigate to the <a href="http://code.google.com/p/armoryapi/">armoryapi</a> DLL that you extracted.</p>
<p><strong>Note: in order for the intellisense documentation to work you must also extract the XML file to the same directory as the DLL</strong></p>
<h2>Code</h2>
<p>Now that your project is setup let&#8217;s get started with some code, first thing&#8217;s first let&#8217;s create a very simple form that we can use to fetch and display the data. Create a form and add the following controls:</p>
<p>characterNameTextBox &#8211; TextBox<br />
realmTextBox &#8211; TextBox<br />
achievementList &#8211; ListBox<br />
fetchButton &#8211; Button</p>
<p>You should now have something similar to this (I have added a few labels and a groupbox, but you obviously don&#8217;t have to do this to get started):</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2011/10/1.png" rel="lightbox[550]"><img class="alignnone size-thumbnail wp-image-555" title="The main form" src="http://blog.intninety.co.uk/wp-content/uploads/2011/10/1-150x150.png" alt="The main form" width="150" height="150" /></a></p>
<p>Now that we have our GUI sorted double click on fetchButton to create the click event handler for the button. Once you are in the code view we need to add an import to the ArmoryAPI namespace, to do this add the following line at the top of the file:</p>
<p><strong>VB.Net</strong></p><pre class="crayon-plain-tag">Imports ArmoryAPI</pre><p><strong>C#</strong></p><pre class="crayon-plain-tag">using ArmoryAPI;</pre><p>Once you&#8217;ve added the namespace import go back to the event handler for the button click and add the following code:</p>
<p><strong>VB.Net</strong></p><pre class="crayon-plain-tag">Dim armory As Armory = New Armory(BattleNetRegion.Europe, BattleNetLocale.en_GB)
Dim character As Character = armory.GetCharacter(characterNameTextBox.Text, realmTextBox.Text)

For Each a As UnlockedAchievement In character.Achievements
    If (DateTime.Now.AddDays(-14) &amp;amp;lt; a.Unlocked) Then
        achievementList.Items.Add(String.Format(&amp;quot;{0} ({1} points)&amp;quot;, a.Title, a.Points))
    End If
Next</pre><p><strong>C#</strong></p><pre class="crayon-plain-tag">Armory armory = new Armory(BattleNetRegion.Europe, BattleNetLocale.en_GB);
Character character = armory.GetCharacter(characterNameTextBox.Text, realmTextBox.Text);

foreach (UnlockedAchievement a in character.Achievements)
{
    if (DateTime.Now.AddDays(-14) &amp;amp;lt; a.Unlocked)
    {
        achievementList.Items.Add(String.Format(&amp;quot;{0} ({1} points)&amp;quot;, a.Title, a.Points));
    }
}</pre><p>If you debug the project now you will be able to fetch the achievements the character entered has unlocked within the last two weeks as can be seen below.</p>
<p><a href="http://blog.intninety.co.uk/wp-content/uploads/2011/10/2.png" rel="lightbox[550]"><img class="alignnone size-thumbnail wp-image-570" title="Main screen with achievement data" src="http://blog.intninety.co.uk/wp-content/uploads/2011/10/2-150x150.png" alt="Main screen with achievement data" width="150" height="150" /></a></p>
<p>This code queries the European servers and returns the data in English, if you need a different configuration simply change the line that creates the Armory object, the following regions and locales are supported:</p>
<p><strong>Regions</strong></p>
<ul>
<li>America</li>
<li>China</li>
<li>Europe</li>
<li>Korea</li>
<li>Taiwan</li>
</ul>
<p><strong>Locales</strong></p>
<ul>
<li>de_DE</li>
<li>en_GB</li>
<li>en_US</li>
<li>es_ES</li>
<li>es_MX</li>
<li>fr_FR</li>
<li>ko_KR</li>
<li>ru_RU</li>
<li>zh_CN</li>
<li>zh_TW</li>
</ul>
<h2>Extra Steps</h2>
<p>In order to improve upon this project, you can utiilise the caching functionality of <a href="http://code.google.com/p/armoryapi/">armoryapi</a>, to do this you&#8217;ll have to setup a database (see <a href="http://code.google.com/p/armoryapi/wiki/GettingStarted#Setting_up_a_Database">http://code.google.com/p/armoryapi/wiki/GettingStarted#Setting_up_a_Database</a>) and simply pass the connection string to the Armory object and the time in minutes that the data should be cached for as shown in the example below.</p><pre class="crayon-plain-tag">armory.ConnectionString = &amp;quot;Data Source=(local)SQLEXPRESS;Initial Catalog=armoryapi;User ID=username;Password=password&amp;quot;
armory.RefreshInterval = 120</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2011/10/displaying-world-of-warcraft-achievements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Run Scripts in Separate Threads in PHP</title>
		<link>http://blog.intninety.co.uk/2011/09/run-scripts-in-seperate-threads-in-php/</link>
		<comments>http://blog.intninety.co.uk/2011/09/run-scripts-in-seperate-threads-in-php/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 19:01:31 +0000</pubDate>
		<dc:creator>int0x90</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[multi]]></category>
		<category><![CDATA[nix]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[run]]></category>
		<category><![CDATA[seperate]]></category>
		<category><![CDATA[thread]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://www.etftw.co.uk/blog/?p=509</guid>
		<description><![CDATA[I&#8217;ve been working on a new project over the past few weeks and one of the requirements of the system was to update a number of records in the database based off the data stored in a large quantity of XML files that would be stored on an external CDN. While initially this didn&#8217;t seem [...]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been working on a new project over the past few weeks and one of the requirements of the system was to update a number of records in the database based off the data stored in a large quantity of XML files that would be stored on an external CDN. While initially this didn&#8217;t seem a problem, once the number of records grew that were required to be updated it became obvious that doing the updates sequentially wasn&#8217;t going to work, and as I didn&#8217;t have the required extensions to use <a href="http://php.net/manual/en/function.pcntl-fork.php" target="_blank">pcntl-fork</a> I had to come up with another way to launch multiple updates simulatenously, which turned out to be much simpler than I had thought but took a bit of searching to find:</p><pre class="crayon-plain-tag">&amp;lt;?php
	exec(&amp;quot;nohup /usr/local/bin/php -f /path/to/script/file.php parameterValue &amp;amp;gt; /dev/null &amp;amp;amp;&amp;quot;);
?&amp;gt;</pre><p></p>
<p>This will execute the PHP script stored in file.php in its own thread but the PHP script calling it will not have to wait on it finishing execution as it would be if you called the script without the nohup and &gt; /dev/null &amp;. This solution will only work on *nix systems as opposed to Windows, but I imagine there is probably a way to do it in Windows too. The downside to this is that you will not be able to get any return value from the script, therefore it is only of any use if you need to run a task that does not require the calling file to get the results back. You can however pass data to the script as I have done in the example above, the value &#8220;parameterValue&#8221; would be available to file.php via $argv[1], for example:</p>
<p></p><pre class="crayon-plain-tag">&amp;lt;?php

	/* -- file.php -- */
	echo 'The value '.$argv[1].' was passed to me via a CLI command.';

?&amp;gt;</pre><p></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.intninety.co.uk/2011/09/run-scripts-in-seperate-threads-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.320 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2013-05-16 20:56:03 -->
