Difference between pages "Ddrescue" and "Rekall"

From Forensics Wiki
(Difference between pages)
Jump to: navigation, search
(Partition recovery)
 
 
Line 1: Line 1:
 
{{Infobox_Software |
 
{{Infobox_Software |
   name = ddrescure |
+
   name = Rekall |
   maintainer = [[Antonio Diaz Diaz]]|
+
   maintainer = [[Michael Cohen]] |
   os = {{Linux}}|
+
   os = {{Cross-platform}} |
   genre = {{Disk imaging}} |
+
   genre = {{Memory analysis}}, {{Memory imaging}} |
 
   license = {{GPL}} |
 
   license = {{GPL}} |
   website = [http://www.gnu.org/software/ddrescue/ddrescue.html ddrescue.html] |
+
   website = [https://code.google.com/p/rekall/ code.google.com/p/rekall/] |
 
}}
 
}}
  
'''ddrescue''' is a raw disk imaging tool that "copies data from one file or block device to another, trying hard to rescue data in case of read errors."  The application is developed as part of the GNU project and has written with UNIX/Linux in mind.
+
Rekall is the stand-alone continuation of the [[Volatility]] Technology Preview (TP) version, aka the scudette branch.
  
'''ddrescue''' and '''[[dd_rescue]]''' are completely different programs which share no development between them.  The two projects are not related in any way except that they both attempt to enhance the standard [[dd]] tool and coincidentally chose similar names for their new programs.
+
== Memory acquisition drivers ==
  
From the [[ddrescue]] info pages:
+
The drivers can be found under:
<blockquote>
+
<pre>
GNU ddrescue is a data recovery tool. It copies data from one file or block device (hard disc, cdrom, etc) to another, trying hard to rescue data in case of read errors.<br><br>
+
rekall/tools/linux
 +
rekall/tools/osx
 +
rekall/tools/windows
 +
</pre>
  
Ddrescue does not truncate the output file if not asked to. So, every time you run it on the same output file, it tries to fill in the gaps.<br><br>
+
=== Linux ===
  
The basic operation of ddrescue is fully automatic. That is, you don't have to wait for an error, stop the program, read the log, run it in reverse mode, etc.<br><br>
+
To build the kernel module for the current kernel version, make sure you have a working build environment and the kernel headers installed. Change into this directory and run make:
 +
<pre>
 +
cd rekall/tools/linux/
 +
make
 +
</pre>
  
If you use the logfile feature of ddrescue, the data is rescued very efficiently (only the needed blocks are read). Also you can interrupt the rescue at any time and resume it later at the same point.<br><br>
+
The acquisition driver is named pmem.ko.
  
Automatic merging of backups: If you have two or more damaged copies of a file, cdrom, etc, and run ddrescue on all of them, one at a time, with the same output file, you will probably obtain a complete and error-free file. This is so because the probability of having damaged areas at the same places on different input files is very low. Using
+
To load the driver:
the logfile, only the needed blocks are read from the second and successive copies.
+
<pre>
</blockquote>
+
sudo insmod pmem.ko
 +
</pre>
  
== Installation ==
+
To check if the driver is running:
=== Debian ===
+
<pre>
The package 'ddrescue' actually is [[dd_rescue]], another dd-like program which does not maintain a recovery log.
+
sudo lsmod
<blockquote>
+
</pre>
aptitude install gddrescue
+
</blockquote>
+
  
== Partition recovery ==
+
The driver create a device file named:
 +
<pre>
 +
/dev/pmem
 +
</pre>
  
First you copy as much data as possible, without retrying or splitting sectors:
+
To unload the driver:
<blockquote>
+
<pre>
ddrescue --no-split /dev/hda1 imagefile logfile
+
sudo rmmod pmem
</blockquote>
+
</pre>
  
Now change over to raw device access. Let it retry previous errors 3 times, don't read past last block in logfile:
+
To read acquire the memory just read from the device file. e.g.
<blockquote>
+
<pre>
modprobe raw<br>
+
dd if=/dev/pmem of=image.raw
raw /dev/raw/raw1 /dev/hda1<br>
+
</pre>
ddrescue --max-retries=3 --complete-only /dev/raw/raw1 imagefile logfile
+
</blockquote>
+
  
If that fails you can try again (still using raw) but retrimmed, so it tries to reread full sectors:
+
For more information see:
<blockquote>
+
<pre>
ddrescue --retrim --max-retries=3 --complete-only /dev/raw/raw1 imagefile logfile
+
rekall/tools/linux/README
</blockquote>
+
</pre>
  
You can now use ddrescue (or normal dd) to copy the imagefile to a new partition on a new disk. Use the appropriate filesystem checkers (fsck) to try to fix errors caused by the bad blocks. Be sure to keep the imagefile around. Just in case the filesystem is severely broken, and datacarving tools like testdisk need to to be used on the original image.
+
=== Mac OS X ===
  
== Examples ==
+
For more information see:
 +
<pre>
 +
rekall/tools/osx/OSXPMem/README
 +
</pre>
  
These two examples are taken directly from the [[ddrescue]] info pages.
+
=== Windows ===
 +
Since recent versions of Windows require a signed driver rekall comes with both pre-built (signed binary) and source versions of the driver.
  
Example 1: Rescue an ext2 partition in /dev/hda2 to /dev/hdb2
+
Both the i386 and amd64 binary version of the driver can be found in the directory:
<blockquote>
+
<pre>
ddrescue -r3 /dev/hda2 /dev/hdb2 logfile<br>
+
rekall/tools/windows/winpmem/binaries
e2fsck -v -f /dev/hdb2<br>
+
</pre>
mount -t ext2 -o ro /dev/hdb2 /mnt<br>
+
</blockquote>
+
  
Example 2: Rescue a CD-ROM in /dev/cdrom
+
E.g.
<blockquote>
+
<pre>
ddrescue -b 2048 /dev/cdrom cdimage logfile
+
rekall/tools/winpmem/binaries/amd64/winpmem.sys
</blockquote>
+
</pre>
write cdimage to a blank CD-ROM
+
  
== Cygwin ==
+
A standalone tool for imaging memory that uses an embedded copy of the pmem driver can be found as winpmem.exe in:
 +
<pre>
 +
rekall/tools/winpmem/executables/Release/
 +
</pre>
  
As of release 1.4-rc1, it can be compiled directly in [[Cygwin]] [http://en.wikipedia.org/wiki/Out_of_the_box Out of the Box]. Precompiled packages are available in the [http://cygwin.com/packages/ Cygwin distribution]. This makes it usable natively on [[Windows]] systems.
+
To load the driver:
 +
<pre>
 +
winpmem.exe -l
 +
</pre>
  
== See also ==
+
The device filename is (This can not be changed without recompiling):
 +
<pre>
 +
\\.\pmem
 +
</pre>
  
* [[aimage]]
+
Note that running dd directly on this device file can crash the machine.
* [[Blackbag]]
+
Use the winpmem.exe tool instead because it handles protected memory regions.
* [[dcfldd]]
+
 
* [[dd]]
+
To read and acquire the physical memory and write it to image.raw:
* [[dd_rescue]]
+
<pre>
* [[sdd]]
+
winpmem.exe image.raw
 +
</pre>
 +
 
 +
To unload the driver:
 +
<pre>
 +
winpmem.exe -u
 +
</pre>
 +
 
 +
For more information see:
 +
<pre>
 +
rekall/tools/windows/README
 +
</pre>
 +
 
 +
== See Also ==
 +
* [[Volatility]]
 +
 
 +
== External Links ==
 +
* [https://code.google.com/p/rekall/ Project site]
 +
* [http://docs.rekall.googlecode.com/git/index.html Project documentation]

Revision as of 13:59, 12 January 2014

Rekall
Maintainer: Michael Cohen
OS: Cross-platform
Genre: Memory Analysis,Memory Imaging
License: GPL
Website: code.google.com/p/rekall/

Rekall is the stand-alone continuation of the Volatility Technology Preview (TP) version, aka the scudette branch.

Contents

Memory acquisition drivers

The drivers can be found under:

rekall/tools/linux
rekall/tools/osx
rekall/tools/windows

Linux

To build the kernel module for the current kernel version, make sure you have a working build environment and the kernel headers installed. Change into this directory and run make:

cd rekall/tools/linux/
make

The acquisition driver is named pmem.ko.

To load the driver:

sudo insmod pmem.ko

To check if the driver is running:

sudo lsmod

The driver create a device file named:

/dev/pmem

To unload the driver:

sudo rmmod pmem

To read acquire the memory just read from the device file. e.g.

dd if=/dev/pmem of=image.raw

For more information see:

rekall/tools/linux/README

Mac OS X

For more information see:

rekall/tools/osx/OSXPMem/README

Windows

Since recent versions of Windows require a signed driver rekall comes with both pre-built (signed binary) and source versions of the driver.

Both the i386 and amd64 binary version of the driver can be found in the directory:

rekall/tools/windows/winpmem/binaries

E.g.

rekall/tools/winpmem/binaries/amd64/winpmem.sys

A standalone tool for imaging memory that uses an embedded copy of the pmem driver can be found as winpmem.exe in:

rekall/tools/winpmem/executables/Release/

To load the driver:

winpmem.exe -l

The device filename is (This can not be changed without recompiling):

\\.\pmem

Note that running dd directly on this device file can crash the machine. Use the winpmem.exe tool instead because it handles protected memory regions.

To read and acquire the physical memory and write it to image.raw:

winpmem.exe image.raw

To unload the driver:

winpmem.exe -u 

For more information see:

rekall/tools/windows/README

See Also

External Links