Pages

Wednesday, March 28, 2007

Mounting a DD image

One of the things I mentioned in my new book was an alternative analysis method for performing computer forensic analysis. I specifically mentioned the use of Mount Image Pro for mounting a dd image as a read-only file structure, which opens up some areas of analysis that many may benefit from using. For example, during an intrusion case, one thing you may want to do is scan the image with AV software. This may save you a great deal of time trying to locate hacker tools by hand. Also, this is something you may want to do when you may be faced with the "Trojan Defense".

Another thought/useful option is this - we all have things that we look for everytime we open an acquired image of a Windows system, and there are other things that we look for on a case-by-case basis. Most often we do this through our forensic analysis software package, such as ProDiscover or EnCase. However, even though these packages ship with scripts to do some initial data collection and parsing for us, sometimes, they aren't as complete as they could be, or we'd like them to be, and it takes forever to get scripts updated because the few folks that actually write their own scripts are busy with other things. Sometimes you may be in a rush or under pressure, and may forget something that you would normally look for. So what if we had a script or a tool that would run through an image, pulling things out for us each time...all automated so that we wouldn't have to remember all of the different places could look, but at the same time, its all documented? Say, the tool would check to see if the Recycle Bin had been disabled, and then move on to parsing the INFO2 file for one user, or all users. Or, the tool would collect the audit policy from the system, check the Registry entries for the Event Logs, and then collect statistics from the Event Log files themselves, or automatically parse the Event Log files to .csv format (or both). Would that be useful?

Another use of something like this is for forensic analysis training. Mounting the image as a drive letter lets you dig into aspects of forensic analysis that while accessible via commercial forensic analysis applications, may be somewhat easier to grasp and work with, particularly for new students, or junior members of an IR/CF team or CSIRT.

Okay, so now, how do we do this? How do we start with just a dd image, and get to a read-only drive letter (ie., F:\, G:\) so that we can point an AV scanner or some other tool at it?

To get the dd image to begin with, you can use ProDiscover, Helix, straight dd, or even FTK Imager Lite. If you're using ProDiscover, you can use the Tools -> Image Conversion Tools -> VMWare Support for DD Images... option to create the necessary .vmdk file.

Another option for creating the .vmdk file is to use LiveView. Point LiveView at the dd image, choose "Generate Config Only" in the GUI (maybe even designate the OS rather than having LiveView guess it) and you'll end up with several files, to include two .vmdk files and a snapshot. LiveView makes use of the VMWare DiskMount utility (don't forget the free VMPlayer), and even though this does not mount the image as a read-only file structure, you can set the read attribute on the image file itself (attrib +r imagefile) as a precaution. Use the vmware-mount.exe to mount the snapshot (imagefile-000001.vmdk)and all of the writes will end up in the snapshot.

Another option is to look at FileDisk. From the screenshot, FileDisk appears to have a read-only (/ro) option. I haven't tried this one yet...installation requires a reboot for the driver to be installed. However, FileDisk will also let you mount ISOs as CDs using the "/cd" switch.

Once you have your .vmdk file, take a look at VDK and VDKWin (scroll down to VDKWin). VDK gives you the .exe and .sys file for mounting image files as read-only file structures (according to the credits, VDK owes a great deal to FileDisk), and VDKWin gives you a GUI for managing it all. A nice thing I noticed about VDKWin is that it's simply a GUI for managing all of the command line switches in VDK. For example, let's say you image a Dell system that wasn't reformatted before being installed, and it has one of those Dell maintenance partitions at the beginning of the physical drive. VDK lets you list available partitions, and then select the one you want to mount. Rememer, when you grab VDKWin, don't forget to also get the core files from the top of the page.

I did test this out using a sample image. I started with the ProDiscover solution, and launched the .vmdk file via VDKWin with no problems. I tried LiveView, and though the DiskMount (vmware-mount.exe) approach worked fine, VDKWin balked at an "unknown extent type". The extent description section of the LiveView .vmdk file had two lines...simply deleting the second one caused VDKWin to hang. So, I removed the second line, and added the size entry to the first line, in essence replicating what I found in the .vmdk file produced by ProDiscover, and then everything worked just fine.

One caveat: I already have VMWare installed on my system...I read in a Google News post somewhere that in order to use some of these tools, you may need to have VMPlayer or one of the VMWare products installed, as the tools may use some of the DLLs. Just be aware of this if this is an avenue you're going to take.

So, what we're left with is a Windows-based solution, using freeware tools, to obtain an image, and then mount that image as a read-only file structure, for analysis. Many of the tools on the DVD that comes with my book, such as SAMParse, are designed to be run against raw Registry files and are perfect for use with this methodology. Sweet!

Addendum: I have an image that was created using FTK Imager Lite, broken into 2GB chunks. I opened the image in ProDiscover using the PDS file format, and started my analysis. Last night, I used the ProDiscover capability for creating .vmdk files ("VMWare support for DD images...") to create the .vmdk file by pointing the tool at the .pds file. Then, I installed VDK and VDKWin, but not any of the other VMWare tools. After setting the read-only bit on all of the image files (attrib +h), I ran VDKWin and successfully mounted the image as the K:\ drive, in read-only mode.

Even though I use a fully licensed version of ProDiscover IR, ProDiscover Basic is free (as in beer) and includes the ability to create the .vmdk files.

10 comments:

  1. Harlan,
    I'm glad to see this has come together in to something that looks very very useful.

    ReplyDelete
  2. Anonymous2:38 PM

    Waow, now windows user can do the same as Linux investigators but in a more complicated manner and having a lot of software to install.

    Hey, wake up, Linux can do that for years, for free and with everything bundled in the OS !

    Even better : with no OS crash !

    ReplyDelete
  3. Thanks for the input, but sometimes "use Linux" just isn't the answer.

    ReplyDelete
  4. Anonymous6:57 AM

    BTW - In order to use Live View, one needs to have VMWare Workstation, not just the player.

    ReplyDelete
  5. It actually works just fine with the free vmware server.

    ReplyDelete
  6. BTW - In order to use Live View, one needs to have VMWare Workstation, not just the player.

    I've seen others do this with just the VMPlayer.

    I have an opportunity to try this very soon, so I'll let you know how it works.

    ReplyDelete
  7. Anonymous7:07 AM

    Hallo,
    I am the author of the everyday increasingly outdated small pseudo-GUI for VDK.EXE you can find here:
    http://home.graffiti.net/jaclaz:graffiti.net/Projects/VDM/vdm.html

    I just want to let you know that a handy way to mount "dd-like" images is to use VMWare 2.00 .pln descriptor files, see this:
    http://www.msfn.org/board/index.php?showtopic=80281&st=1
    This way the "dd-like" image can be mounted with the "correct" geometry, as VDK defaults normally to a 64/32 one.

    To automatically create a .pln file descriptor for the image you have, you are free to "borrow" code from this other small batch of mines (MBRbatch/Mkimg):
    http://www.boot-land.net/forums/MBRBatch-001-ALPHA-t3191.html

    Moreover, there is a new Filesystem driver, IMDISK:
    http://www.ltr-data.se/opencode.html
    http://www.boot-land.net/forums/ImDisk-f59.html
    (you will need to specify a "hidden sectors" offset to mount "full" HD images)

    Here is a thread where I try to collect all links I can find to Ramdisk/Filedisk drivers:
    http://www.boot-land.net/forums/index.php?showtopic=1507

    Finally, there are a number of absolutely FREEWARE "dd-like" tools for Windows, I use a lot dsfo/dsfi from the DSFOK toolkit:
    http://members.ozemail.com.au/~nulifetv/freezip/freeware/

    But in this thread there are a few other options:
    http://www.911cd.net/forums//index.php?showtopic=16534

    jaclaz

    ReplyDelete
  8. jaclaz,

    Thanks for the comment!

    Do you have a solid, end-to-end, complete description of how to go from a dd image to a live file system?

    Thanks!

    ReplyDelete
  9. Anonymous11:09 AM

    @Keydet89

    I am not sure I understand correctly what you mean by "live" filesystem.
    If you mean a filesystem mounted and accessible as a drive letter under 2K/Xp, all you have to do is to mount the image with either VDK or IMDISK.
    Unless you need to perform "filesystem level" chores (such as formatting the image) the given geometry won't affect operation in any way (2K and XP use LBA to access sectors).
    Or you mean something else?

    jaclaz

    ReplyDelete
  10. jaclaz,

    If you mean a filesystem mounted and accessible as a drive letter under 2K/Xp, all you have to do is to mount the image with either VDK or IMDISK.

    That's exactly what I was asking...thanks!

    ReplyDelete