<?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>Checkmate &#187; Fundamentals</title>
	<atom:link href="http://niiconsulting.com/checkmate/category/fundamentals/feed/" rel="self" type="application/rss+xml" />
	<link>http://niiconsulting.com/checkmate</link>
	<description>An Information Security Blog by NII Consulting</description>
	<lastBuildDate>Fri, 02 Dec 2011 08:26:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>GeoEdge &#8211; IP Address Locator</title>
		<link>http://niiconsulting.com/checkmate/2010/01/06/geoedge-ip-address-locator/</link>
		<comments>http://niiconsulting.com/checkmate/2010/01/06/geoedge-ip-address-locator/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 12:02:28 +0000</pubDate>
		<dc:creator>Nikhil Wagholikar</dc:creator>
				<category><![CDATA[Fundamentals]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[geoedge]]></category>
		<category><![CDATA[geotools]]></category>
		<category><![CDATA[ip locator]]></category>
		<category><![CDATA[MAP-Quest]]></category>
		<category><![CDATA[maxmind]]></category>
		<category><![CDATA[wikimapia]]></category>

		<guid isPermaLink="false">http://niiconsulting.com/checkmate/?p=192</guid>
		<description><![CDATA[From forensics point of view, investigating “which user did what on the application/server that lead to its compromise” is of the most importance. Similar scenario applies to Email investigation. It’s quite simple now to find out the IP Address of the person who is sending out fishy or threatening emails to the victim(s).]]></description>
			<content:encoded><![CDATA[<p><strong>Introduction</strong></p>
<p>Log analysis, is one of the very basic but crucial exercise of any Forensics Analyst. It includes many aspects for analysis; some of the important ones being:</p>
<ul>
<li>Determine actions/requests performed by User/Host/IP Address</li>
<li>The application’s or Server’s reactions towards user’s requests</li>
<li>Finding more information about a particular User/Host/IP Address who may be performing some extra-ordinary transactions with the application/server</li>
<li>Application/Server performance</li>
<li>Application/Server traffic monitoring to calculate business growth etc</li>
</ul>
<p>However from forensics point of view, investigating “which user did what on the application/server that lead to its compromise” is of the most importance. Similar scenario applies to Email investigation. It’s quite simple now to find out the IP Address of the person who is sending out fishy or threatening emails to the victim(s).</p>
<p>Here we are discussing a post investigation aspect of above and similar scenarios i.e. what after once the source IP Address (of the attacker) is identified? In this article we are going to discuss about a simple tool/script, which helps forensic analyst to get the exact location of the source IP Address on this very beautiful earth.<br />
<span id="more-192"></span><br />
<strong>Geo-Edge</strong></p>
<p>“geoedge.py” is a small Python utility/tool/script developed by Laramies from “<a href="http://www.edge-security.com/soft/geoedge.py">edge-security.com</a>” to get the exact location of the target host/IP Address on earth. This directly helps in finding the attacker’s physical location from where he carried out the attack.</p>
<p>However, those who don’t have a Python compiler/interpreter need not to worry, since NII Consulting have put in some more efforts and made this python script available in EXE format.</p>
<p>This tool can be downloaded as:</p>
<p>Original Python Version: Download <a href="http://www.edge-security.com/soft/geoedge.py">here</a></p>
<p>EXE Version: Download <a title="GeoEdge EXE version" href="http://www.niiconsulting.com/tools/geoedge.exe" target="_self">here</a></p>
<p>The beauty of this tool is that it queries two sources – <a href="http://www.maxmind.com/">Maxmind</a> and <a href="http://www.geoiptool.com/">geoiptool</a>, to extract information about given target host or IP Address. Hence possibility of availability and correctness of information about host or IP Address is high.</p>
<p><strong>Example</strong></p>
<p>Let’s first have a look how to use this tool:<br />
<a href="http://niiconsulting.com/checkmate/wp-content/uploads/2010/02/Pic1-Usage.jpg" target="_blank"><img src="http://niiconsulting.com/checkmate/wp-content/uploads/2010/02/Pic1-Usage.jpg" alt="" width="593" height="206" /></a></p>
<p>Now we’ll try to locate physical location of IP Address 64.246.16.151.</p>
<p>So for this, we’ll issue:</p>
<p><a href="http://niiconsulting.com/checkmate/wp-content/uploads/2010/02/Pic2-Sample.jpg" target="_blank"><br />
<img src="http://niiconsulting.com/checkmate/wp-content/uploads/2010/02/Pic2-Sample.jpg" alt="" width="593" height="371" /></a></p>
<p>As we can see, both the sources provided us with correct information about Latitude and Longitude of the target IP Address.</p>
<p>Now what? We have Latitude and Longitude information with us, but which country, which lane, which area this belongs to on earth?</p>
<p>So for this, we’ll refer to online world map available on <a href="http://www.mapquest.com/maps/latlong.adp">MAP-Quest</a> website.</p>
<p>We provide this obtained/derived information about Latitude and Longitude to this website, and find the exact location of this IP Address on earth.</p>
<p><img src="http://niiconsulting.com/checkmate/wp-content/uploads/2010/01/Pic3.jpg" alt="" width="586" height="612" /></p>
<p>The physical location of the target host/IP Address is shown using a red star marked on the map. Two kinds of views are available for getting the Latitude and Longitude information.</p>
<p>First view is the “Street View” in which we get the nearby street information about the target.</p>
<p><a href="http://niiconsulting.com/checkmate/wp-content/uploads/2010/01/Pic4.jpg" target="_blank"><img src="http://niiconsulting.com/checkmate/wp-content/uploads/2010/01/Pic4.jpg" alt="" width="461" height="277" /></a></p>
<p>A little further zoom can help us to get more information about the target host/IP Address.</p>
<p><a href="http://niiconsulting.com/checkmate/wp-content/uploads/2010/01/Pic5.jpg" target="_blank"><img src="http://niiconsulting.com/checkmate/wp-content/uploads/2010/01/Pic5.jpg" alt="" width="461" height="277" /></a></p>
<p>The second view is the “Aeriel view”, in which we get to see the exact satellite view of the target host/IP Address.</p>
<p><a href="http://niiconsulting.com/checkmate/wp-content/uploads/2010/01/Pic6.jpg" target="_blank"><img src="http://niiconsulting.com/checkmate/wp-content/uploads/2010/01/Pic6.jpg" alt="" width="461" height="277" /></a></p>
<p>Further zoom is available subject to the database availability of MapQuest website.</p>
<p><strong>Conclusion</strong></p>
<p>So from this, we learn that it’s not at all difficult for any forensics analyst to find out the exact physical location of the attacker.</p>
<p>Besides this technique, “GeoTools” available at <a href="http://wikimapia.org/">WikiMapia</a> is also very handy and useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2010/01/06/geoedge-ip-address-locator/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Concurrent RDP connections hack &#8211; XP</title>
		<link>http://niiconsulting.com/checkmate/2009/03/26/concurrent-rdp-connections-hack-xp/</link>
		<comments>http://niiconsulting.com/checkmate/2009/03/26/concurrent-rdp-connections-hack-xp/#comments</comments>
		<pubDate>Thu, 26 Mar 2009 16:56:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Fundamentals]]></category>
		<category><![CDATA[Hacks]]></category>
		<category><![CDATA[Network Forensics]]></category>

		<guid isPermaLink="false">http://www.niiconsulting.com/checkmate/2009/03/concurrent-rdp-connections-hack-xp/</guid>
		<description><![CDATA[by Toufiq Ali, NII Consulting Before you read further make sure you back up all the original settings of the registry or set create a restore point of your system. I assume reader know what a windows remote terminal service is. If not please refer to http://en.wikipedia.org/wiki/Terminal_Services In Windows XP when a remote user tries [...]]]></description>
			<content:encoded><![CDATA[<p><strong>by Toufiq Ali, <a href="http://www.niiconsulting.com//">NII Consulting</a></strong><br />
Before you read further make sure you back up all the original settings of the registry or set create a restore point of your system. I assume reader know what a windows remote terminal service is. If not please refer to http://en.wikipedia.org/wiki/Terminal_Services</p>
<p>In Windows XP when a remote user tries to connect using the Remote Desktop Connection (RDC) client in Windows XP, the local user is disconnected from his current session forcefully. RDC, unlike Terminal Server Services in Windows 2000, Server 2003 and Server 2008, is designed for only one session at a time.. This excerpt aims at making terminal services functionality of multiple user login from Windows server 2000, windows server 2003 etc in Windows XP. This would be very useful in environment where the network admin often troubleshoots problem on the network using RDC.</p>
<p>Keep reading as the hack unfolds to enable concurrent remote desktop connection sessions support in Windows XP using the following patched files.<span id="more-52"></span></p>
<ol>
<li>Download files.zip from the link given below on the system where you want to enable concurrent RDC connections.</li>
</ol>
<p><a target="_blank" title="Clikc here to download" href="http://www.niiconsulting.com/checkmate/wp-content/uploads/2009/03/files.zip">Download files.zip</a><br />
Windows XP SP1 and SP2: Windows XP RTM, SP1 and SP2.zip</p>
<p>Windows XP SP2: Windows XP SP2.zip</p>
<p>Windows XP SP3: Windows XP SP3.zip</p>
<p>Before you go ahead further, you should be in the safe mode (Press F8 during boot up). If you don’t want to prolong your wait to see this work,</p>
<p>1. goto &#8216;Start&#8217; > &#8216;Run&#8217; services.msc<br />
2. Right click on Terminal services &#038; goto Properties.<br />
3. From the startup type drop down choose disable or simply stop the services.<br />
4. Click on apply or Ok &#038; exit the services.msc file.</p>
<p>2. Go to %windir%\System32 and &#038; rename the termsrv.dll to anything that you can remember.<br />
3. Go to %windir%\System32\dllcache &#038; rename the termserv.dll.</p>
<p>4. Copy the downloaded termsrv.dll in the following two locations<br />
1. to %windir%\System32<br />
2. %windir%\System32\dllcache.</p>
<p>Note: when you copy the files Windows will pop up the Windows File Protection dialog box. Click the cancel button &#038; then Yes to keep this copy of the patched file.</p>
<p>5. Now, download and run the concurrent_sessions.bat file. Click yes to add these values to the registry or you can run Registry Editor to manually add the following registry value:</p>
<p>[HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\Licensing Core]<br />
“EnableConcurrentSessions”=dword:00000001</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]<br />
“EnableConcurrentSessions”=dword:00000001</p>
<p>[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]<br />
“AllowMultipleTSSessions”=dword:00000001</p>
<p>6. Click on Start Menu -> Run command and type gpedit.msc,</p>
<p>7. Navigate to Computer Configuration -> Administrative Templates -> Windows Components -> Terminal Services.</p>
<p>8. Enable Limit Number of Connections and set the number of connections to number of concurrent sessions you want to allow</p>
<p>9. Restart the terminal services on that system again. Also enable Remote Desktop from the System Properties’ Remote tab &#038; check for Allow users to connect remotely to this computer.</p>
<p>10. Turn on Fast User Switching in Control Panel -> User Accounts -> Change the way users log on or off.</p>
<p>11. Restart the computer normally.</p>
<p>If the Windows XP computer is connected to a domain, every time you restart your computer Windows will set the value of the regkey “AllowMultipleTSSessions” to “0″. To ensure that multiple or unlimited Remote Desktop connection sessions is allowed in AD domain environment, the value data for “AllowMultipleTSSessions” has to be set to “1″ on system startup. To change the value, run the concurrent_sessions.bat every time the computer is started. Instead, put the concurrent_sessions.bat at C:\Documents and Settings\All Users\Start Menu\Programs\Startup folder.</p>
<p>With the release of Service Pack 2 (SP2) for Microsoft Windows XP, SP2 has introduced a feature that limits concurrent TCP connection attempts that are possible to 10 per seconds. In Service Pack 1 or without Service Pack, there is no limit on concurrent TCP connection attempts. So if you have set the value of “Limit Number of Connections” in step 8 greater than 10 and you happen to run a SP2, you need to apply the patch to override the max limit. You can download the file from the following link.</p>
<p>Just for your information on disassembling the original &#038; patched file following HEX code bits have being changed:</p>
<p>00022A17: 74 75<br />
00022A69: 7F 90<br />
00022A6A: 16 90</p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2009/03/26/concurrent-rdp-connections-hack-xp/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>USB Forensics</title>
		<link>http://niiconsulting.com/checkmate/2008/01/01/usb-forensics/</link>
		<comments>http://niiconsulting.com/checkmate/2008/01/01/usb-forensics/#comments</comments>
		<pubDate>Tue, 01 Jan 2008 07:16:26 +0000</pubDate>
		<dc:creator>Kush</dc:creator>
				<category><![CDATA[Compromise Detection]]></category>
		<category><![CDATA[Fundamentals]]></category>

		<guid isPermaLink="false">http://www.niiconsulting.com/checkmate/2008/01/usb-forensics/</guid>
		<description><![CDATA[In this article we will learn on how to do the forensic of USB devices, how to correlate the USB device with the drive letter and how to see at what time the USB device was plugged in and plugged out. This article may be very useful for the military forces as they can easily [...]]]></description>
			<content:encoded><![CDATA[<p>In this article we will learn on how to do the forensic of USB devices, how to correlate the USB device with the drive letter and how to see at what time the USB device was plugged in and plugged out. This article may be very useful for the military forces as they can easily note the time when the particular USB device was plugged in.</p>
<p>Whenever a forensic investigator does the forensic of a USB device, he should look into two important keys of the registry. These are:<span id="more-47"></span></p>
<p>1) HKLM/System/Mounted Devices</p>
<p>2) HKLM/System/CurrentControlSet/Enum/USBSTOR.</p>
<p>First key will show all the mounted &#038; removable devices and will be in the form of “\DosDevices\”. Figure given below will clear the picture.</p>
<p><img align="left" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0108/figure1.JPG" />Figure 1</p>
<p>Each DWORD value (here /DosDevices/) will have a data which is in hex form. For reading the contents of these DWORD, the forensic investigator has to access these values. When the DWORD is accessed and the contents are of the form “\??\STORAGE#Removable Media#”, then this means that the device which was associated with this drive letter was a removable/USB device. Let us understand this point deeper with the help of the figure. Figure given below shows that I have accessed the “/DosDevice/I:” DWORD and it’s a removable/USB device.</p>
<p><img align="left" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0108/figure2.JPG" />Figure 2</p>
<p>Couple of points to notice in this figure: -</p>
<p>1) DWORD accessed is “\DosDevices\I:”</p>
<p>2) Contents of this DWORD value is starting from “\??\STORAGE#RemovableMedia#”. So we can conclude that this drive letter was assigned to removable/USB device.</p>
<p>3) Parent ID prefix in this case is 7&#038;25bb518e&#038;0. This value is very important and we will use this value to get more knowledge about the USB device which was connected on the suspect machine.</p>
<p>Our work related to “HKLM/System/MountedDevices” is over. Now let us move to the other key and get more information out of it. The other key is</p>
<p>HKLM/System/CurrentControlSet/enum/USBSTOR</p>
<p>When USBSTOR key is expanded, there will be sub keys under it. The key will be in the form of Disk&#038;Ven&#038;Prod<br />
&#038;Rev. An example is shown with the help of figure.</p>
<p><img align="left" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0108/figure3.JPG" /></p>
<p>Figure 3</p>
<p>Under these keys will be the sub key which will be with the name of the serial number which the device has. If the device has no serial number, then plug and play manager will assign the serial number to the device. We will now expand the subkey and will find out where the Parent ID prefix is? I expanded the subkey and I found the Parent ID prefix. A screenshot has been given below</p>
<p><img align="left" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0108/figure4.JPG" /></p>
<p><a title="figure 4" href="http://www.niiconsulting.com/checkmate/wp-admin/images/0108/figure%204.JPG">Figure 4</a></p>
<p>We can make sure that this device was connected to the machine and the drive letter which was assigned to this device was I:\.</p>
<p>If we want to find out more information about the device connected and the last plug/unplug time then we can use professional tool like “USBDeview” which can be found here. A screenshot has been given below</p>
<p><img align="left" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0108/figure5.JPG" /></p>
<p><a title="figure 5" href="http://www.niiconsulting.com/checkmate/wp-admin/images/0108/figure%205.JPG">Figure 5</a></p>
<p>Hope this article will help lot of forensic investigators in investigating cases. Enjoy experimenting</p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2008/01/01/usb-forensics/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Indian IT Act 2000 &#8211; An Insight</title>
		<link>http://niiconsulting.com/checkmate/2007/08/21/it-act-2000-2/</link>
		<comments>http://niiconsulting.com/checkmate/2007/08/21/it-act-2000-2/#comments</comments>
		<pubDate>Tue, 21 Aug 2007 11:39:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Case Studies]]></category>
		<category><![CDATA[Fundamentals]]></category>

		<guid isPermaLink="false">http://www.niiconsulting.com/checkmate/2007/08/it-act-2000-2/</guid>
		<description><![CDATA[from NII Consulting The IT Act 2000 is a large repository of fine print fraught with judicial jargon and varying legal implications. To quote from the preamble of the Act, &#8220;An Act to provide legal recognition for the transactions carried our by means of electronic data interchange and other means of electronic communication, commonly referred [...]]]></description>
			<content:encoded><![CDATA[<p>from <a href="http://www.niiconsulting.com"><strong>NII Consulting</strong> </a></p>
<p>The IT Act 2000 is a large repository of fine print fraught with judicial jargon and varying legal implications.</p>
<p>To quote from the preamble of the Act,</p>
<p><em>&#8220;An Act to provide legal recognition for the transactions carried our by means of electronic data interchange and other means of electronic communication, commonly referred to as &#8220;Electronic Commerce&#8221;, which involve the use of alternatives to paper based methods of communication and storage of information , to facilitate electronic filings of documents with the Government agencies and further to amend the Indian Penal Code, Indian Evidence Act, 1872,, The Bankers&#8217; Books Evidence Act, 1891, and the Reserve Bank of India Act, 1934 and for matters connected therewith or incidental thereto.&#8221; </em></p>
<p>The full Act is available online in a neatly organized HTML format at <a target="_blank" title="IT Act 2000" href="http://www.naavi.org/importantlaws/itbill2000/index.htm">http://www.naavi.org/importantlaws/itbill2000/index.htm </a></p>
<p>To make it more comprehensible, our principal consultant, K. K. Mookhey, recently drew up a presentation to provide an overview and quick understanding of all the chapters of the IT Act.</p>
<p>This presentation is available for download at <a target="_blank" title="IT_Act_2000_NIIConsulting.ppt" href="http://www.niiconsulting.com/services/IT_Act_2000_NIIConsulting.ppt">http://www.niiconsulting.com/services/IT_Act_2000_NIIConsulting.ppt </a></p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2007/08/21/it-act-2000-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dare to delete my files!</title>
		<link>http://niiconsulting.com/checkmate/2007/05/16/dare-to-delete-my-files/</link>
		<comments>http://niiconsulting.com/checkmate/2007/05/16/dare-to-delete-my-files/#comments</comments>
		<pubDate>Wed, 16 May 2007 07:45:30 +0000</pubDate>
		<dc:creator>Nikhil Wagholikar</dc:creator>
				<category><![CDATA[Fundamentals]]></category>

		<guid isPermaLink="false">http://www.niiconsulting.com/checkmate/2007/05/dare-to-delete-my-files/</guid>
		<description><![CDATA[by Nikhil Wagholikar, NII Consulting Introduction One of the recommended file-system for Linux is Ext-3. Ext-3 file-system might not be as robust and powerful as compared to the Microsoft NTFS file-system but it has some built-in features that makes Linux a power performer. Here we will explore one such feature of Ext-3 file-system here. This [...]]]></description>
			<content:encoded><![CDATA[<p><strong>by <a href="mailto:nikhil@niiconsulting.com">Nikhil Wagholikar</a>, <a href="http://www.niiconsulting.com//">NII Consulting</a></strong><br />
<strong>Introduction</strong></p>
<p>One of the recommended file-system for Linux is Ext-3. Ext-3 file-system might not be as robust and powerful as compared to the Microsoft NTFS file-system but it has some built-in features that makes Linux a power performer.</p>
<p>Here we will explore one such feature of Ext-3 file-system here. This feature is actually an attribute, which if set on a file/folder, will not even allow “root” user to delete, modify or rename it.<span id="more-42"></span> This attribute is set using command “chattr”.</p>
<p><strong><em>chattr</em></strong></p>
<p>According to the Linux man page, “chattr” is defined as:</p>
<p>“chattr” changes the file attributes on a Linux second extended file-system.</p>
<p>Here second extended file-system is nothing but “Ext-2” file-system. Since “Ext-3” file-system is an upgraded version of “Ext-2” file-system, all discussions related to Ext-2 are easily applicable for Ext-3 file-system.</p>
<p>Let’s quickly go through some important switches available with “chattr” command.</p>
<p>-R: Recursively changes attributes of a directory and its contents. Sym-links are ignored straight-away.</p>
<p>-V: Output to be verbose along with program version.</p>
<p>-i: If this attribute is set on a file, it will not allow any user (including root) to either delete, modify, rename, link it to other file, or add any contents to this file.</p>
<p>s: If this attribute is set on a file, the file is deleted, and the blocks in which the file contained are shredded with series of multiple zeros on the disk.</p>
<p>u: With this attribute set on a file, this file is deleted however it’s contents are saved for future un-deletion and recovery options.</p>
<p>So while doing a forensics investigation of a Linux based machine, the forensics analyst must take care of all these files, since they might prove useful for them during forensics investigation of the disk.</p>
<p><strong><em>lsattr</em></strong></p>
<p>The attributes set by “chattr” command cannot be previewed with our normal “ls –l” or “dir –l” command.</p>
<p>“lsattr” is a command to preview the attributes set by “chattr” command.</p>
<p>It lists the file attributes on a Second extended and third extended file system.</p>
<p>Let’s quickly look at the available switches for “lsattr” command:</p>
<p>-R: Recursively lists attributes of a directory and its contents</p>
<p>-a: Lists attributes of all files within the directory including hidden ones (starting with ‘.’)</p>
<p><strong><em>Example</em></strong></p>
<p>Let’s create 6 files named sequentially from Test1 till Test6.</p>
<p><img align="middle" alt="Files present in our directory" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0507/image002.jpg" /></p>
<p>Let’s see the normal directory permission of all these files.</p>
<p><img align="middle" alt="Normal permissions on files" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0507/image004.jpg" /></p>
<p>Now let’s set non-deletion attribute on file “Test4” file.</p>
<p><img align="middle" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0507/image006.jpg" /></p>
<p>Now again let’s see the normal permission of all these files.</p>
<p><img align="middle" alt="Normal permissions on all files after setting non-deletion attribute" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0507/image007.jpg" /></p>
<p>As we can see, nothing about the attribute set on file “Test4” can be seen through normal “ls –l” command.</p>
<p>However now let’s see the hidden attributes set on file “Test4” through “lsattr” command.</p>
<p><img align="middle" alt="Listing attributes set on files" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0507/image009.jpg" /></p>
<p>So now we can see the attribute set on this file “Test4”.</p>
<p>Now lets try to delete this file using command “rm –rf” command.</p>
<p><img align="middle" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0507/image011.jpg" /></p>
<p>So as we can see, though we have root privileges it’s impossible for us to delete this file.</p>
<p>The only way this file could be deleted is to remove the “i” switch set on this file using command &#8220;chattr -i Test4&#8243;.</p>
<p><img align="middle" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0507/image013.jpg" /></p>
<p>Now if we try to delete this file, it’s possible.</p>
<p><strong>Conclusion</strong></p>
<p>Its very important for a forensics analyst to not only look for files which have SUID or GUID set on them, but also for files which have these kind of attributes set on them.</p>
<p>A typical scenario may include an inclusion of a Trojan (hidden) with this attribute set on it. Hence even when anti-virus programs detect these kind of Trojan files, still they may not be able to delete them, just because “+i” attribute is set on them.</p>
<p>A note must be taken that, attributes on the file can only be changed who had set the attribute on it. Moreover, for security purpose, Linux doesn’t allow any non-root user to set the “i” attribute on any file or directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2007/05/16/dare-to-delete-my-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Understanding NTFS file system</title>
		<link>http://niiconsulting.com/checkmate/2007/01/29/ntfs/</link>
		<comments>http://niiconsulting.com/checkmate/2007/01/29/ntfs/#comments</comments>
		<pubDate>Mon, 29 Jan 2007 04:21:53 +0000</pubDate>
		<dc:creator>Kush</dc:creator>
				<category><![CDATA[Fundamentals]]></category>

		<guid isPermaLink="false">http://www.niiconsulting.com/checkmate/2007/01/ntfs/</guid>
		<description><![CDATA[by Kush Wadhwa, NII Consulting In this article I will cover the basic concepts of NTFS file system. In NTFS (New Technologies File System) all important data like the basic file system administrative data are stored in a file and these files can be stored anywhere in a particular volume. These files don&#8217;t have reserved [...]]]></description>
			<content:encoded><![CDATA[<p>by <a href="mailto:kush.wadhwa@niiconsulting.com"><strong>Kush Wadhwa</strong></a>, <a href="http://www.niiconsulting.com"><strong>NII Consulting</strong></a></p>
<p>In this article I will cover the basic concepts of NTFS file system. In NTFS (<strong>N</strong>ew <strong>T</strong>echnologies <strong>F</strong>ile <strong>S</strong>ystem) all important data like the basic file system administrative data are stored in a file and these files can be stored anywhere in a particular volume. These files don&#8217;t have reserved space as other file systems (FAT) have. Only thing which is consistent in NTFS is that the first sector of disk volume contains the boot sector and boot code.<span id="more-39"></span></p>
<p>Another important concept to be considered while understanding NTFS file system is MFT. <strong>M</strong>aster <strong>F</strong>ile <strong>T</strong>able (MFT) is important to understand because it contains information about files and directories present on NTFS volume. Each file/directory will take defined space of 1 KB in the MFT.  This 1 KB will contain lot of information like for MFT entry header, file&#8217;s name and file&#8217;s content. The first 42 bytes contains 12 fields. Remaining bytes are unstructured and can be filled with different attributes. Microsoft reserves first 16 MFT entries for file system metadata files.These 16 MFT entries are explained below.</p>
<p>0   <strong>$MFT</strong>            The entry for the MFT itself</p>
<p>1   <strong>$MFTMirr</strong>        Contains a backup of $MFT</p>
<p>2   <strong>$Logfile</strong>        Information about metadata transaction</p>
<p>3   <strong>$Volume</strong>         Volume information &#8211; for label</p>
<p>4   <strong>$AttrDef</strong>        Attribute information such as size, identifier name</p>
<p>5<strong> .   </strong>Contains root directory of file system (Root directory is the name of file and its linked with the file content).</p>
<p>6 <strong>$BITMAP</strong>  Information of allocation of each cluster on file system.</p>
<p>7 <strong>$BOOT</strong>      Contains boot sector and boot code of file system.</p>
<p>8 <strong>$BadClust</strong>  Contains bad clusters for the volume.</p>
<p>9 <strong>$Secure</strong>    Information about security and access control for the files.</p>
<p>10 <strong>$Upcase</strong>    Converts lowercase characters to matching Unicode uppercase      characters.</p>
<p>11 <strong>$Extend</strong>   Used for various optional extensions such as quotas, reparse point        data,  and object identifiers<br />
12-15 reserved for future use.</p>
<p>To understand NTFS more in detail open up your NTFS drive in hex editor. I use Winhex as it is a very flexible tool. By using this tool we can directly jump to the MFT entries and can move further to see all the entries which are mentioned above.</p>
<p>In case your MFT entry is corrupted then the mirror of MFT i.e $MFTMirr is used. We can retrieve deleted files using the hex editor if we have enough knowledge of the location of file. We will discuss more on NTFS in coming articles. Till then happy experimenting</p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2007/01/29/ntfs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Carving Issues</title>
		<link>http://niiconsulting.com/checkmate/2006/12/07/data-carving-issues/</link>
		<comments>http://niiconsulting.com/checkmate/2006/12/07/data-carving-issues/#comments</comments>
		<pubDate>Thu, 07 Dec 2006 16:15:46 +0000</pubDate>
		<dc:creator>Chetan Gupta</dc:creator>
				<category><![CDATA[Disk Forensics]]></category>
		<category><![CDATA[Fundamentals]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.niiconsulting.com/checkmate/2006/12/data-carving-issues/</guid>
		<description><![CDATA[by Chetan Gupta, NII Consulting Many a times as an investigator, I have to deal with the issue of carving data from unallocated spaces in a partition. There are many commercial data carving tools such as Encase, Winhex, Accessdata FTK, DataLifter, ILookInvestigator. Well, I have tried most of these and must say most of them [...]]]></description>
			<content:encoded><![CDATA[<p>by <strong>Chetan Gupta, <a href="http://www.niiconsulting.com//">NII Consulting</a></strong></p>
<p>Many a times as an investigator, I have to deal with the issue of carving data from<br />
unallocated spaces in a partition. There are many commercial data carving tools such as Encase, Winhex, Accessdata FTK, DataLifter, ILookInvestigator. Well, I have tried most of these and must say most of them have their share of pros and cons.<span id="more-38"></span> Encase has the widest  range of file types supported and also gives the ability to add more file types (you need to   know the header and footer for sure). But if the file system is heavily fragmented, then data carving becomes less effective.<br />
There are three main issues with data carving:</p>
<p>1. Most of the tools would be able to find the header but the footer may not be found in the same or the consecutive cluster. Then, the file would be carved with the minimum file size  specified by the investigator. Thus, the carved files may contain some gibberish at the end or may be incomplete and therefore unviewable.</p>
<p>2. The names of the carved files cannot be ascertained as the Master File Table or Superblock (in Linux) are not used during data carving process.<br />
3. As data carving is based on guess work, results may include many false hits and thus data carving may not be as reliable as required. Footer analysis and discarding overlapping file signatures may help reduce this problem.</p>
<p>Depending upon the situation, the investigator can choose his tool for carving. However, he  must understand the capabilities of the tool and the file signatures supported by it. in my experience, Encase  V5 has the most extensive signature database for carving among all tools. Foremost, Scalpel  and Winhex allow you to add custom signatures to the tool which is extremely useful. Sadly, FTKv1.50 doesn&#8217;t support adding additional signatures. Not sure, if they have added this capability in the coming versions.</p>
<p>Running foremost is pretty easy under Linux:</p>
<p># foremost -T -t all -o Output_directory  -i input_file<br />
-T &#8212; Put unique timestamp in the output directory name<br />
-t &#8212; File types to be carved. The file types supported can be tweaked by using the -c option and specifying the configuration file</p>
<p>The syntax of Scalpel is almost similar to that of foremost with minor changes. However, it   makes two passes over the unallocated data &#8211; the first pass in which it tries to identify the   files and the second pass in which it actually carves out the file. My experience with scalpel  hasn&#8217;t been great as with large files it would stop midway in the second phase throwing up some error.</p>
<p>Two interesting tools of note are <em>filesig </em>and <em>headergrab</em> which are both available <a target="_blank" href="http://www.filesig.co.uk">here</a>.<br />
From the horse&#8217;s mouth:<br />
Filesig Manager is a file signature and keyword management tool, acting as an examiners central repository of File Indentification information.<br />
The information within can be readily exported to the majority of mainstream forensic examination tools. Some of the features to date include:</p>
<p>* Export to Datalifter (Standard and Adv Signatures).<br />
* Export to DiskCat.<br />
* Export to File Extractor Pro.<br />
* Export to Encase version 3 and 4.<br />
* Export to iLook.<br />
* Export to ProDiscover.<br />
* Export to Simple Carver.<br />
* Export to WinHex Forensic.</p>
<p>Header Grab:<br />
Header Grab is a research tool, which allows the user to quickly extract the first eight bytes and last four bytes from every file within the specified folder.<br />
This is interesting as by generating few starting and ending bytes from multiple files of same type, we can identify the actual header and footer for the file type and is very useful in creating your own signature database!</p>
<p>They are available for free download at http://www.filesig.co.uk</p>
<p>For efficient data carving, the tools need to have built-in intelligence to identify the boundaries of a file. If the file is fragmented then it needs to have a mechanism to find the remaining fragment either by a hit and trial method (checking all the remaining clusters for the fragments of the file which may be highly time consuming) or by making intelligent guesses ( Eg checking the next 10 clusters for the remaining fragments of the file first and looking for the specific type of data associated with the file type for eg different segment headers of the file as in a Word Document) and then testing the resultant file.</p>
<p>A significant step towards solving these issues was taken by Digital Forensic Research Workshop (DFRWS) when they organized a data carving challenge available <a target="_blank" href="http://www.dfrws.org/2006/challenge/">here</a>. The challenge threw up some interesting results and some new tools by various researchers.</p>
<p>Happy data carving!</p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2006/12/07/data-carving-issues/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bad Superblock, corrupt inode tables and loads of bad luck!</title>
		<link>http://niiconsulting.com/checkmate/2006/12/07/bad-superblock-corrupt-inode-tables-and-loads-of-bad-luck/</link>
		<comments>http://niiconsulting.com/checkmate/2006/12/07/bad-superblock-corrupt-inode-tables-and-loads-of-bad-luck/#comments</comments>
		<pubDate>Thu, 07 Dec 2006 15:58:06 +0000</pubDate>
		<dc:creator>Chetan Gupta</dc:creator>
				<category><![CDATA[Case Studies]]></category>
		<category><![CDATA[Disk Forensics]]></category>
		<category><![CDATA[Fundamentals]]></category>

		<guid isPermaLink="false">http://www.niiconsulting.com/checkmate/2006/12/bad-superblock-corrupt-inode-tables-and-loads-of-bad-luck/</guid>
		<description><![CDATA[by Chetan Gupta, NII Consulting Well, last week was abuzz with activity when we had to recover data from a corrupt Linux hard disk. Thought it would be pretty easy but as soon as I loaded the hard disk, I knew something was amiss. I was in for a shock as the disk had severe [...]]]></description>
			<content:encoded><![CDATA[<p>by <strong>Chetan Gupta, <a href="http://www.niiconsulting.com//">NII Consulting</a></strong></p>
<p>Well, last week was abuzz with activity when we had to recover data from a corrupt Linux hard disk. Thought it would be pretty easy but as soon as I loaded the hard disk, I knew something was amiss.<span id="more-37"></span> I was in for a shock as the disk had severe damage in the beginning sectors. Still, encase was able to load the disk but could not show the file structure! Atleast it was showing the three partitions!<br />
What do we do?<br />
Well, the first step was to image the hard disk so that If I do mess up the hard disk, I can restore it to what was there originally. So, loaded FTK imager and used it to image it the hard disk into split raw files (since raw files are easier to use with Sleuthkit and other open source tools..)<br />
I had in my mind that encase will allow me to load raw files and anlayze so I thought I was on safe grounds! Well, the raw files filled up most of my forensic disk since they amounted to about 120 Gb of space! Neways, the idea was to run disk repairing tools on the conked hard disk and side-by-side run data recovery tools on the image. Well, not all plans execute to perfection&#8230;. this one sure didn&#8217;t! As soon as I loaded the split raw image into Encase, it crashed! Sure, it has problems with large split files. Then, I said to myself, &#8220;No problem, There&#8217;s sleuth kit for me&#8221;. What was not expected was that sleuthkit did not recognise the file system on the three partitions.</p>
<p>A simple strings on the first split image showed up interesting results &#8211; most of the files were quite intact although their beginning and end hardly recognizable from the big junk of words&#8230;and I saw the last fsck log which clearly stated that both primary and secondary superblocks were corrupt! WoW!</p>
<p>Anyways I tried rebuilding the superblock and inode table but to no avail. However, after the repair operation, I could run fsstat on the third partition but again it showed up 99% of the inodes to be free! I tried using fsck and using one of the secondary superblocks but it did not help. I guess the secondary superblock structures had got corrupted too!<br />
Then I said to myself,&#8221; May be data carving is the best option in this situaton&#8221;. I concatenated the split files, and created a huge raw file so as to feed my open source data carving monsters (read foremost and scalpel)! Foremost did carve out some data but largely false hits and scalpel never got going. It would stop midway during the all-important second pass! Next step was to use all available file carving tools (from winhex to encase to FTK) and collating valid files obtained from them. It was tedious but nevertheless, I could recover a lot of files (read gif, bmp, jpeg html, and mail files).</p>
<p>Data carving could be quite frustrating if the filesystem is hugely fragmented. I would discuss data carving in some more detail in my forthcoming article.</p>
<p>Hope you enjoyed reading this one though!</p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2006/12/07/bad-superblock-corrupt-inode-tables-and-loads-of-bad-luck/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hiding data with Host Protected Area (HPA) in Linux</title>
		<link>http://niiconsulting.com/checkmate/2006/09/15/hiding-data-with-hpahost-protected-area-in-linux/</link>
		<comments>http://niiconsulting.com/checkmate/2006/09/15/hiding-data-with-hpahost-protected-area-in-linux/#comments</comments>
		<pubDate>Fri, 15 Sep 2006 10:49:35 +0000</pubDate>
		<dc:creator>Kush</dc:creator>
				<category><![CDATA[Disk Forensics]]></category>
		<category><![CDATA[Fundamentals]]></category>

		<guid isPermaLink="false">http://www.niiconsulting.com/checkmate/2006/09/hiding-data-with-hpahost-protected-area-in-linux/</guid>
		<description><![CDATA[By Kush Wadhwa, NII Consulting Have you ever thought of hiding data in such a manner that it cannot be deleted even after the hard disk is formatted? Well, in this this article , we&#8217;ll look at just that; we will see how you can hide and unhide crucial data on your hard disk. The [...]]]></description>
			<content:encoded><![CDATA[<p>By <strong>Kush Wadhwa</strong>, <a href="http://www.niiconsulting.com">NII Consulting</a></p>
<p>Have you ever thought of hiding data in such a manner that it cannot be deleted even after the hard disk is formatted? Well, in this this article , we&#8217;ll look at just that; we will see how you can hide and unhide crucial data on your hard disk. The technique which is used to hide the data is known as HPA which stands for Host Protected Area. Let us first discuss HPA&#8230;</p>
<p><strong>HPA</strong> &#8211; The Hidden Protected Area (also known as the Host Protected Area and as the Predesktop Area) is a special area (usually a few gigabytes in size) located at the end of a hard disk.</p>
<p>Since we have to calculate the hard disk space which is to be put in HPA, heres a little about hard disks sectors.</p>
<p><strong>Sectors -</strong> A sector is the smallest unit that can be accessed on a hard disk. Each platter, or circular disk of a hard disk is divided into tracks, which run around the disk. These tracks get longer as they move from the middle towards the outside of the disk, so there are more sectors along the tracks near the outside of the disk than the ones towards the center of disk.</p>
<p>1 Sector=512 bytes</p>
<p>Let us first see how many sectors are there in my hard disk which can be easily done using hdparm command.</p>
<p><img align="middle" alt="hpdarm command" src="http://www.niiconsulting.com/checkmate/wp-admin/images/0906/figure-1.jpg" /></p>
<p>From the above figure we can see that the total number of sectors present in the hard disk is  78165359 sectors. Converting given number of sectors in Gigabytes, we get 37.27214766 GB. To hide the data make separate partition (<strong>Note: This partition should be the last partition</strong>). HPA cannot be made in the beginning or in the middle of hard disk. Using sfdisk -luS  note the starting sector of the last partition. Let the starting sector of last partion be 64776751.Now I just want 64776751 sectors to be accessible and rest of the sectors should be in HPA mode. For putting the sectors in HPA mode I will use a small C code with a name <strong>setmax.c</strong> which can be downloaded from the link below.</p>
<p>http://www.win.tue.nl/~aeb/linux/setmax.c</p>
<p>To compile this program I will use gcc</p>
<p>[root@hack3rs root]#gcc -o setmax setmax.c</p>
<p>To  compile it in statically,<br />
[root@hack3rs root]#gcc -static -o setmax setmax.c</p>
<p>Since  64776751 sectors have to be made accessible we will do as follows:<br />
[root@hack3rs root]#./setmax &#8211;delta 64776751 /dev/hdc (depending on your device name).</p>
<p>&#8211;delta option will make temporary HPA. If you want to make permanent HPA then use &#8211;max option with setmax.<br />
Congratulations! you have hidden your last 8388608 sectors which is equivalent to 4GB. You can make sure if your hard disk is in HPA mode or not by using <strong>disk_stat</strong> which comes with sleuthkit. Sleuthkit can be downloaded from its official site http://www.sleuthkit.org. The general syntax of disk_stat is disk_stat . Here device name can be /dev/{hda,hdb,hdc,sda,sdb,sdc}. Be sure not to write the partition name.<br />
<strong>Unhiding your host protected area(Specially written for digital forensics team)</strong></p>
<p>When digital forensics team is inspecting the machine, they  should make sure if the hard disk is in HPA mode or not. If the hard disk is in HPA mode, then its quite possible that data is stored in that area and that data could help them solve the case. So let us first detect the hard disk is in HPA or not. As said earlier this can be easily done using disk_stat. This will show you <strong>Maximum Disk Sector</strong> and<strong> Maximum User Sector.</strong></p>
<p><strong>Maximum Disk Sector: </strong>This gives the total number of sectors present in hard disk.</p>
<p><strong>Maximum User Sector: </strong>This gives the total number of sectors which user can access.</p>
<p>As per example above I got the followin result</p>
<p><strong>Maximum Disk Sector</strong>:  78165359<br />
<strong>Maximum User Sector</strong>:<strong>  </strong>64776751</p>
<p>** HPA Detected (Sectors 64776751 &#8211; 78165359) **</p>
<p>This means that sectors from 64776751 to 78165359 are in HPA mode. Now again use setmax to unhide HPA.</p>
<p>[root@hack3rs root]#./setmax &#8211;delta 78165359 /dev/hdc</p>
<p>This will make all your hard disk accessible. I hope you all enjoyed reading the article.</p>
<p>Happy Experimenting!</p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2006/09/15/hiding-data-with-hpahost-protected-area-in-linux/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Computer Forensics Volunteer Project</title>
		<link>http://niiconsulting.com/checkmate/2006/08/28/computer-forensic-volunteer-project/</link>
		<comments>http://niiconsulting.com/checkmate/2006/08/28/computer-forensic-volunteer-project/#comments</comments>
		<pubDate>Mon, 28 Aug 2006 08:38:46 +0000</pubDate>
		<dc:creator>Bhushan Shah</dc:creator>
				<category><![CDATA[Compromise Detection]]></category>
		<category><![CDATA[Disk Forensics]]></category>
		<category><![CDATA[Fundamentals]]></category>
		<category><![CDATA[Incident Response]]></category>
		<category><![CDATA[Network Forensics]]></category>

		<guid isPermaLink="false">http://www.niiconsulting.com/checkmate/2006/08/computer-forensic-volunteer-project/</guid>
		<description><![CDATA[by Bhushan Shah, NII Consulting Mrs Carol L. Stimmel has taken upon her to start a Computer Forensic Volunteer Project to provide low-cost services to those who cannot assert advantage from our skills. Here is a bit taken from the press release:- “As expert members of the international computer forensics community which provides unique and [...]]]></description>
			<content:encoded><![CDATA[<p>by <strong><a href="mailto:bhushan@niiconsulting.com">Bhushan Shah</a>, </strong><a href="http://www.niiconsulting.com">NII Consulting </a></p>
<p>Mrs Carol L. Stimmel has taken upon her to start a Computer Forensic Volunteer Project to provide low-cost services to those who cannot assert advantage from our skills.</p>
<p>Here is a bit taken from <a href="http://www.prweb.com/releases/2006/8/prweb426937.htm">the press release:-</a></p>
<p>“As expert members of the international computer forensics community which provides unique and highly desirable services to the legal system, we assume a responsibility to provide services to those in need yet unable to pay. As a result, the Computer Forensics Volunteer Project (CFVP) provides pro bono and low-cost forensic services to individuals and organizations who normally would not be able to take advantage of the distinct litigation advantage provided by these techniques.”</p>
<p>On behalf of <a href="http://www.niiconsulting.com/">NII Consulting</a> I have volunteered to take part in the project and would like to help people who cannot afford such services.</p>
]]></content:encoded>
			<wfw:commentRss>http://niiconsulting.com/checkmate/2006/08/28/computer-forensic-volunteer-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

