tool – pasco2

August 2nd, 2006

I am off to the DFRWS 2006 conference in a week or so to present my paper “A correlation method for establishing provenance of timestamps in digital evidence”. In this paper I describe some research I have performed in characterising where the behaviour of computer clocks differs from the ideal.

A second theme of the paper is the identification of methods of correlating commonly found evidence to establish provenance of timestamps. In this case, I have been correlating Internet Explorer Cache and History files with Squid cache logs.

As a part of my work I reimplemented and extended a parsing tool for the IE cache and history index.dat files. This was due to finding bugs in the initial pasco tool (which was missing some error conditions from the read() system call). That and I am more productive using java.

The tool, which I have named pasco2 in honour of Keith Jones’ earlier IE parser, pasco , can be found here: pasco2.

dd2vmdk – dd Image to VMWare Virtual Disk converter

July 16th, 2006

While performing the last set of investigations, I have produced a simple web based application for automating the conversion of dd images into VMWare Virtual Disks. I have called this tool dd2vmdk – it is accessable at http://www.bschatz.org/2006/p2v/index.html

Currently the tool carves up the image into a virtual disk composed of a number of files, where partitions are contained individual files. The next version of the tool will support directly modifying the partition table and NTFS boot record in-situ within the image file.

P2V – Will the 2K MBR boot up a non cylinder aligned partition?

July 16th, 2006

I left my last post unsure whether of not a PC can boot into a partition that is not aligned with the beginning of a cylinder boundary. I devised a quick test, employing the same image that I have been using for the last two posts.

In this case, I left the partition table unmodified, but went into the NTFS boot record and adjusted its conception of the hard drive to reflect the Virtual Drive’s geometry. I got this:

Error Loading Opertating System.

If the bootable partition was the first on the hard drive, there may have been a chance for it to work, but since it is 73440 sectors in, the CHS values will be all wrong.

Recalling the original partition table as taken from fdisk is:

Disk /dev/ida/c0d0: 8711 cylinders, 255 heads, 32 sectors/track
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/ida/c0d0p1 32 73439 73408 12 Compaq diagnostics
/dev/ida/c0d0p2 * 73440 20555039 20481600 42 SFS
/dev/ida/c0d0p3 20555040 71081759 50526720 42 SFS
/dev/ida/c0d0p4 0 – 0 0 Empty

We regenerate the new partition table with sfdisk, setting the correct CHS values for the new virtual disk. (sfdisk recalculates the right CHS values for the start and end of the partitions based on geometry specified on the command line, and the sector offsets and sizes):

sfdisk -uS -C 4436 -H 255 -S 63 -f c0d0.dd << EOF
32,73408,12
73440,20481600,42,*
20555040,50526720,42
EOF

The image now boots correctly.

So, to answer my initial question. Yes, the MBR boot code WILL boot up a non cylinder aligned partition. Inside the OS the dynamic disk shows up as healthy and exactly as it was in the original physical machine.

P2V – hard drive geometry problems

July 1st, 2006

I have been trying to convert a physical Windows 2000 server running on SCSI RAID to run inside a virtual machine. Given my interest in digital evidence, I was interested in achieving the conversion (which is popuarly referred to as Physical To Virtual or P2V conversion) from first principles.

A while ago I came across the Windows Dynamic Disk partitioning scheme (also called Dynamic Disk or LDM). It’s support under linux is slowly gaining momentum, but still remains a bugbear for manipulating disks. So just to complicate things, I decided to convert the physical host’s drive to using Dynamic Disks.

My proposed methodology was as follows:
1. Use a live CD (helix) to acquire the source drive to a external SATA drive. This included recording the partition and disk geometry using the sfdisk program, recording the LDM partition information using the ldminfo tool from the Linux NTFS project, and imaging the drive using dcfldd.
2. Load the image onto the Linux host running VMWare Server.
3. Generate a VMWare Virtual Disk file which works with the image.
4. Create and configure a VM using the new virtual disk.
5. Fixup the drivers inside the VM using the Ultimate P2V method.

In practise this didn’t work as planned. What I was presented with was the following:

A blank screen with a non flashing cursor on boot.

Looking into the problem in more detail it appeared that the boot problem was due to a difference in disk geometry between the SMART2 RAID controller present in the the physical host and VMWare’s emulated SCSI hard drives. As it turns out VMWARE will only emulate a disk with 63 sectors per track, and 255 heads (the number of cylinders from this perspective is irrelevant). My RAID controller however presented a disk with 32 sectors per track, and the 255 heads. Fdisk showed me this:

Disk /dev/ida/c0d0: 8711 cylinders, 255 heads, 32 sectors/track
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/ida/c0d0p1 32 73439 73408 12 Compaq diagnostics
/dev/ida/c0d0p2 * 73440 20555039 20481600 42 SFS
/dev/ida/c0d0p3 20555040 71081759 50526720 42 SFS
/dev/ida/c0d0p4 0 – 0 0 Empty

Running sfdisk inside the virtual machine with this image resulted with a number of warnings about partitions not being aligned on cylinder boundaries.

It appeared that this problem was related to the differences in geometry between the two drives. On boot, the boot code in the MBR of the hard drive is looking inside the image at the wrong point. It appears that the Boot code can only boot partitions that are aligned on cylinder boundaries, ie. the start address of partitions must be fully divisible by heads*sectors. The differences between these means that the boot code is looking in the wrong place inside my image.

[Update: I am not sure about this after researching this some more... it appears that some old versions of DOS required that partitions be cylinder aligned, but the MBR boot code appears like it is independent of cylinder alignment.]

MACtimes oddness on CDROM filesystems

September 15th, 2005

I have been looking at the MACtimes of files stored on CDROM’s recently. One thing that particulary struck me was the access time (the A in MAC) of files on a cdrom…

F:burntest>dir /ta *
Volume in drive F is My Disc
Volume Serial Number is 8181-A540

Directory of F:burntest

01/01/1601 10:00 AM <DIR> .
01/01/1601 10:00 AM <DIR&gt’ ..
01/01/1601 10:00 AM 34,304 LDM.doc
01/01/1601 10:00 AM 1,267 mailheaders.txt
2 File(s) 35,571 bytes
2 Dir(s) 0 bytes free

Did I reset the access time when I burned it?

No. From the quick skim of the ISOFS documentation, it appears that ISOFS contains no field to save the access time of a file in, which i expect makes sense if you are thinking of a filesystem as a read only medium.

I imagine that the windows CDFS implementation is simply returning the number 0 (64bit) to the upper level filesystem layers here for the accessed time. And what you see here, is 12 Midnight, 1/1/1601 (plus 10 hours as I am in Brisbane, GMT+10), which is the starting point of the windows clock.

Too bad if you are wanting it as a backup of a regular filesystem. From a forensic standpoint, you have lost all of those useful accessed times (not to mention the usual suspects like slack space, deleted files…)

Which brings me to validating some CD writing software, in this case, Nero 6. For my experiment, I will compare the mactimes of some files on a NTFS filesystem which have been burned to a ISOFS CDROM with Nero 6.

The creation times on the NTFS FS on C: and the ISOFS on F:

C:burntest>dir /tc *
Volume in drive C has no label.
Volume Serial Number is 8C26-C144

Directory of C:burntest

15/09/2005 07:44 PM <DIR> .
15/09/2005 07:44 PM <DIR> ..
14/08/2005 05:53 PM 34,304 LDM.doc
23/07/2005 08:54 PM 1,267 mailheaders.txt
2 File(s) 35,571 bytes
2 Dir(s) 9,896,013,824 bytes free

F:burntest>dir /tc *
Volume in drive F is My Disc
Volume Serial Number is 8181-A540

Directory of F:burntest

15/09/2005 07:44 PM <DIR> .
15/09/2005 07:52 PM <DIR> ..
14/08/2005 06:16 PM 34,304 LDM.doc
23/07/2005 08:55 PM 1,267 mailheaders.txt
2 File(s) 35,571 bytes
2 Dir(s) 0 bytes free

Huh?

C:burntest>dir /tw *
Volume in drive C has no label.
Volume Serial Number is 8C26-C144

Directory of C:burntest

15/09/2005 07:44 PM <DIR> .
15/09/2005 07:44 PM <DIR> ..
14/08/2005 06:16 PM 34,304 LDM.doc
23/07/2005 08:55 PM 1,267 mailheaders.txt
2 File(s) 35,571 bytes
2 Dir(s) 9,896,013,824 bytes free
F:burntest>dir /tw *
Volume in drive F is My Disc
Volume Serial Number is 8181-A540

Directory of F:burntest

15/09/2005 07:44 PM <DIR> .
15/09/2005 07:52 PM <DIR> ..
14/08/2005 06:16 PM 34,304 LDM.doc
23/07/2005 08:55 PM 1,267 mailheaders.txt
2 File(s) 35,571 bytes
2 Dir(s) 0 bytes free

It looks like Nero 6 likes to throw away the creation time, and replace it with the last modified time. Yet more data lost.

Kowari on Eclipse

April 7th, 2005

It has been a few months since I last looked at Kowari. My motivations currently are in using a persistent OWL implementation, or at least a persistent RDF store. Kowari’s graph traversal ITQL operations are particularly of interest and look promising, and Paul Gearon, one of the core developers, seems to be working hard on the OWL implementation.

Last time I looked at Kowari, which was a few months ago, it was a tedious process getting it to run inside of Eclipse. I have become accustomed to simply pointing the Eclipse source path at the /src directory in any particular source distribution, and importing all of the jars in the /lib directory, and it all simply working. Not in this case.

The Kowari source code is organised over upwards of 30 separate source folders. When I simply imported all of these folders into eclipse there were serious shadowing problems. For some reason, (which I suspect are an artifact of having a couple of copeting implementations in the source tree, which were configured buy the ant build) there were a number of classes with the same name and package in multiple folders.

Happily, things have improved for the better. Digging into the scr/jar and src/war folder heirarchies reveals folders called “java” which can be imported as eclipse source paths without issue. The only real gotcha here is that a number of source files are generated, and not packaged with the source distro. Running the ant build in situ fixes that. At this point one can add obj/jar/config/java and obj/jar/itql/java to the build path.

At this point the eclipse should be able to build all of the most base parts, as long as you import all of the libraries in lib. A number of errors will be visible due to missing 3rd party libraries.

Running Kowari was a little more tricky. Here is how to do it.

Created a reate a run configuration with main class org.kowari.server.EmbeddedKowariServer. For the command line, I appended the following (adjust the path to suit):

-c file:///D:/mysrc/kowari-1.1/conf/kowari-config.xml

The following are needed VM arguments (again, adjust the path to suit):


-Djava.security.policy=file:///D:/mysrc/kowari-1.1/conf/kowari-rmi.policy
-Dorg.kowari.xml.ResourceDocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
-Djava.naming.factory.initial=com.sun.jndi.rmi.registry.RegistryContextFactory
-Djava.naming.provider.url=rmi://localhost
-Dlog4j.configuration=file:///D:/mysrc/kowari-1.1/log4j-conf.xml

The final trick is to copy the conf directory into whatever your eclipse build directory is (my default is kowari-1.1/classes). This is typically the /bin directory.

My next try was to get the org.kowari.itql.ItqlSession unit test to run. Most of it currently runs without issue, although I am getting failures on testSelect7, and all of hte testLoadAPI, testBaskup, testLoadBackup, and testRestore unit tests. I havent looked into the reasons for this in any detail. In order to get this to run, you will need the VM argument


-Dcvs.root=D:/mysrc/kowari-1.1

The ITQL interpreter, org.kowari.itql.ItqlSession seems to run without any commmand line or VM arguments, although I havent yet tested actually using it. I will update this when I have.

Getting the MP3 demo application required me to run the ant build target

>ant demo-mp3-config-generate

And then adding the obj/jar/demo-mp3/java to the source folders. The MP3 applicatoin is run from the class org.kowari.demo.mp3.swing.Mp3Application with the argument the relative path to the config file: conf\mp3-config.xml. This should be in your classes/conf dir.

The mp3-config.xml file needs to be edited as below

type =”http://tucana.org/tucana#Model”>

Finally I had to copy the icons in the images directory of demo-mp3 into the /classes directory.