Difference between pages "SIMCon" and "Ddrescue"

From Forensics Wiki
(Difference between pages)
Jump to: navigation, search
(Features)
 
(Other Resources)
 
Line 1: Line 1:
 
{{Infobox_Software |
 
{{Infobox_Software |
   name = SIMCon |
+
   name = ddrescure |
   maintainer = [[InsideOut Forensics]] |
+
   maintainer = [[Antonio Diaz Diaz]]|
   os = {{Windows}} |
+
   os = {{Linux}}|
   genre = ??? |
+
   genre = {{Disk imaging}} |
   license = {{Commercial}} |
+
   license = {{GPL}} |
   website = [http://www.simcon.no/ simcon.no] |
+
   website = [http://www.gnu.org/software/ddrescue/ddrescue.html http://www.gnu.org/software/ddrescue/ddrescue.html] |
 
}}
 
}}
  
{{Wikify}}
+
'''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.
  
'''SIMCon''' is a program that securely images all files on a [[GSM]] [[SIM Card]] with a standard PC-SC [[smart card]] reader, either [[serial]] or [[USB]]. After imaging, the forensic investigator can then analyze the contents of the card. Specific information regarding stored numbers, call history, and text messages are available.  
+
'''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.
  
SIMCon is now Paraben's SIM Card Seizure
+
From the [[ddrescue]] info pages:
 +
<blockquote>
 +
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>
  
== Features ==
+
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>
  
* Acquire all available files on a [[SIM Card]] and store in an archive file
+
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>
* Analyze and interpret content of files
+
* Recover deleted text messages stored on the card
+
* Manage PIN and PUK codes
+
* Compatible with [[SIM Cards]] and [[USIM Cards]]
+
* Print reports of evidence
+
* Secure file archive using hashing
+
* Export items to popular spreadsheet programs
+
* Supports international charsets
+
* Contains a "content" view for plain text viewing of data, as well as a hexadecimal view for more specific analysis.
+
  
== Data Acquisition ==
+
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>
  
[http://www.simcon.no SIMCon] is also capable of aquiring the following data from a [[SIM Card]]:
+
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
 +
the logfile, only the needed blocks are read from the second and successive copies.
 +
</blockquote>
  
* Abbreviated Dialing Numbers (ADN),
+
== Installation ==
* Last Dialed Numbers (LDN)
+
* Short Message Service (SMS)
+
* Public Land Mobile Network (PLMN) selector
+
* Forbidden PLMNs, Location Information (LOCI)
+
* General Packet Radio Service (GPRS) location
+
* International Mobile Subscriber Identity (IMSI)
+
* Integrated Circuit Card Identifier (ICCID)
+
* Mobile Subscriber ISDN (MSISDN)
+
* Service Provider Name (SPN)
+
* Phase Identification
+
* SIM Service Table (SST)
+
* Language Preference (LP)
+
* Card Holder Verification (CHV1) and (CHV2)
+
* Broadcast Control Channels (BCCH)
+
* Ciphering Key (Kc)
+
* Ciphering Key Sequence Number
+
* Emergency Call Code
+
* Fixed Dialing Numbers (FDN)
+
* Forbidden PLMNs
+
* Local Area Identitity (LAI)
+
* Own Dialing Number
+
* Temporary Mobile Subscriber Identity (TMSI)
+
* Routing Area Identifier (RIA) netowrk code
+
* Service Dialing Numbers (SDNs)
+
* Service Provider Name
+
* Depersonalizatoin Keys
+
  
All [[GSM]] cell phones today have a subscriber identity module (SIM) to identify the phone onto the network. [http://www.simcon.no SIMCon] is an application to acquire all of the information from the [[SIM Card]].   
+
=== Bootable CD ===
 +
ddrescue is available on bootable rescue cds such as SystemRescueCd http://www.sysresccd.org/Main_Page.
 +
=== Debian and Ubuntu ===
 +
The package 'ddrescue' in Debian and Ubuntu is actually [[dd_rescue]], another dd-like program which does not maintain a recovery logThe correct package is gddrescue.
  
The [[SIM Card]] provides secure storing of the key identifying a mobile phone service subscriber, subscription information, preferences and text messages.  Network state information, such as the current location area identity (LAI), is also stored on the card.  When a handset is turned off and then back on, it will search for the LAI that it was in, rather than having to search all frequencies that the phone operates in.  This saves time when trying to log on to the network. (Subscriber, 2006, para. 1)
+
Debian
 +
<blockquote>
 +
aptitude install gddrescue
 +
</blockquote>
 +
Ubuntu
 +
<blockquote>
 +
sudo apt-get install gddrescue
 +
</blockquote>
 +
=== Gentoo ===
 +
<blockquote>
 +
emerge ddrescue
 +
</blockquote>
 +
== Partition recovery ==
  
By using [http://www.simcon.no SIMCon] and a smart card reader, all of the above information and more can be pulled off of the card without knowing the PIN or the PUK of the card. The PIN and the PUK are ways to keep the information on the card secure. They also can be used as a security feature on the phone, not allowing anyone to use a phone to access the [[SIM Card]] without knowing the codes.
+
=== Kernel 2.6.3+ & ddrescue 1.4+ ===
 +
'ddrescue --direct' will open the input with the O_DIRECT option for uncached reads. 'raw devices' are not needed on newer kernels. For older kernels see below.
  
[http://www.simcon.no SIMCon] is an application developed by Inside Out Forensics in Norway.  It is designed for use by the law enforcement community, and it can be obtained free of charge by emailing [http://www.simcon.no SIMCon] and identifying the officers and unit.  However, for anyone outside the law enforcement community, it is not free. 
+
First you copy as much data as possible, without retrying or splitting sectors:
 +
<blockquote>
 +
ddrescue --no-split /dev/hda1 imagefile logfile
 +
</blockquote>
  
== Review ==
+
Now let it retry previous errors 3 times, using uncached reads:
 +
<blockquote>
 +
ddrescue --direct --max-retries=3 /dev/hda1 imagefile logfile
 +
</blockquote>
  
* [http://www.simcon.no SIMCon] makes the acquisition of data very easy, simply inserting the [[SIM Card]] to the appropriate [[SIM Card]] reader, and clicking acquire is all that is needed to start analyzing evidence.  After the acquisition of the data is complete SimCon will show the user a screen with two halves. 
+
If that fails you can try again but retrimmed, so it tries to reread full sectors:
 +
<blockquote>
 +
ddrescue --direct --retrim  --max-retries=3 /dev/hda1 imagefile logfile
 +
</blockquote>
  
* On the left panel is the different data sectors of the [[SIM Card]] that can either be checked on or off depending on what is needed. After choosing what data sectors are needed, the right panel will be populated with the selected data. Some of the most useful pieces of information that are shown are: the International Mobile Subscriber Identity number, every contacts name and number, and all SMS messages sent and received both stored and deleted.
+
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, CHKDSK) 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.
  
* SIMCon also comes with two more handy features that are key to an investigation and in a court of law. The first is [http://www.simcon.no SIMCon]s' feature that allows the printing of a report. [http://www.simcon.no SIMCon] will format and populate a report with the contents of the users’ choosing.  This can list all the key pieces to an investigation and is an excellent piece of evidence to be used in a court of law.  The second feature is the exportation of the acquired data.  [http://www.simcon.no SIMCon] allows the exportation of all SMS messages and also of all contacts.  When these exported files are opened in a program such as Microsoft Excel the data can be read, sorted, and analyzed in a format of the users design.
+
=== Before linux kernel 2.6.3 / 2.4.x ===
 +
In 2.6.3 the 'raw device' has been marked obsolete. On later kernels ddrescue will use O_DIRECT on the input to do uncached reads.
  
* When SMS messages are exported [http://www.simcon.no SIMCon] automatically adds the following information about every message: file, item, status, service center, message type, number, time stamp, and text.  When the contacts are exported [http://www.simcon.no SIMCon] automatically adds the following information about every contact: file, item, identifier, and number.  For reference a report of an acquired [[SIM Card]] is enclosed as well as a document that tells what information is added into an exported file at the end of this document.
+
First you copy as much data as possible, without retrying or splitting sectors:
 +
<blockquote>
 +
ddrescue --no-split /dev/hda1 imagefile logfile
 +
</blockquote>
  
* [http://www.simcon.no SIMCon] is known to have issues while imaging multiple cards in the same session of the program. These issues include the appearance of random characters in both the contacts list and in the [[SMS]]. These complications are outlined in the paper [[:Image:Huser_Timothy_SIMCon_paper.doc|Running head: SIM CARD FORENSICS WITH SIMCON SOFTWARE]] by [[User:Thuser|Timothy D. Huser]].
+
Now change over to raw device access. Let it retry previous errors 3 times, don't read past last block in logfile:
 +
<blockquote>
 +
modprobe raw<br>
 +
raw /dev/raw/raw1 /dev/hda1<br>
 +
ddrescue --max-retries=3 --complete-only /dev/raw/raw1 imagefile logfile
 +
</blockquote>
  
* Currently there is no "data-dump" mode in which one can simply dump data exactly as it is on the card in order to have a more pure investigation of the contents. This has proven to be a major setback up to version 1.1, as the automatic parsing of information from the card sometimes leaves certain details unseen, especially in the content view.
+
If that fails you can try again (still using raw) but retrimmed, so it tries to reread full sectors:
 +
<blockquote>
 +
ddrescue --retrim --max-retries=3 --complete-only /dev/raw/raw1 imagefile logfile
 +
</blockquote>
  
== External Links ==
+
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, CHKDSK) 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.
  
* [http://en.wikipedia.org/wiki/Subscriber_Identity_Module Wikipedia: Subscriber Identity Module]
+
At the end you may want to unbind the raw device:
* [http://www.simcon.no/ InsideOut Forensics]
+
<blockquote>
 +
raw /dev/raw/raw1 0 0
 +
</blockquote>
 +
 
 +
== Examples ==
 +
 
 +
These two examples are taken directly from the [[ddrescue]] info pages.
 +
 
 +
Example 1: Rescue an ext2 partition in /dev/hda2 to /dev/hdb2
 +
 
 +
'''Please Note:''' This will overwrite ALL data on the partition you are copying to. If you do not want to do that, rather create an image of the partition to be rescued.
 +
<blockquote>
 +
ddrescue -r3 /dev/hda2 /dev/hdb2 logfile<br>
 +
e2fsck -v -f /dev/hdb2<br>
 +
mount -t ext2 -o ro /dev/hdb2 /mnt<br>
 +
</blockquote>
 +
 
 +
Example 2: Rescue a CD-ROM in /dev/cdrom
 +
<blockquote>
 +
ddrescue -b 2048 /dev/cdrom cdimage logfile
 +
</blockquote>
 +
write cdimage to a blank CD-ROM
 +
 
 +
 
 +
This example is derived from the ddrescue manual.
 +
 
 +
Example 3: Rescue an entire hard disk /dev/sda to another disk /dev/sdb
 +
 
 +
copy the error free areas first
 +
ddrescue -n /dev/sda /dev/sdb rescue.log
 +
attempt to recover any bad sectors
 +
ddrescue -r 1 /dev/sda /dev/sdb rescue.log
 +
 
 +
== Options ==
 +
 
 +
-h, --help
 +
    display this help and exit
 +
-V, --version
 +
    output version information and exit
 +
-b, --block-size=<bytes>
 +
    hardware block size of input device [512]
 +
-B, --binary-prefixes
 +
    show binary multipliers in numbers [default SI]
 +
-c, --cluster-size=<blocks>
 +
    hardware blocks to copy at a time [128]
 +
-C, --complete-only
 +
    do not read new data beyond logfile limits
 +
-d, --direct
 +
    use direct disc access for input file
 +
-D, --synchronous
 +
    use synchronous writes for output file
 +
-e, --max-errors=<n>
 +
    maximum number of error areas allowed
 +
-F, --fill=<types>
 +
    fill given type areas with infile data (?*/-+)
 +
-g, --generate-logfile
 +
    generate approximate logfile from partial copy
 +
-i, --input-position=<pos>
 +
    starting position in input file [0]
 +
-n, --no-split
 +
    do not try to split or retry error areas
 +
-o, --output-position=<pos>
 +
    starting position in output file [ipos]
 +
-q, --quiet
 +
    quiet operation
 +
-r, --max-retries=<n>
 +
    exit after given retries (-1=infinity) [0]
 +
-R, --retrim
 +
    mark all error areas as non-trimmed
 +
-s, --max-size=<bytes>
 +
    maximum size of data to be copied
 +
-S, --sparse
 +
    use sparse writes for output file
 +
-t, --truncate
 +
    truncate output file
 +
-v, --verbose
 +
    verbose operation
 +
 
 +
Numbers may be followed by a multiplier: b = blocks, k = kB = 10^3 = 1000, Ki = KiB = 2^10 = 1024, M = 10^6, Mi = 2^20, G = 10^9, Gi = 2^30, etc...
 +
 
 +
 
 +
== Cygwin ==
 +
 
 +
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.
 +
 
 +
== See also ==
 +
 
 +
* [[aimage]]
 +
* [[Blackbag]]
 +
* [[dcfldd]]
 +
* [[dd]]
 +
* [[dd_rescue]]
 +
* [[sdd]]
 +
 
 +
== Other Resources ==
 +
[http://pfuender.net/?p=80| Useful code-snippets for DDrescue]
 +
 
 +
[http://www.myfixlog.com/fix.php?fid=21| Tutorial for beginners that guides through the process of imaging a hard drive with DDrescue and mounting it in Windows, using free software.]

Latest revision as of 11:03, 9 January 2011

ddrescure
Maintainer: Antonio Diaz Diaz
OS: Linux
Genre: Disk imaging
License: GPL
Website: http://www.gnu.org/software/ddrescue/ddrescue.html

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.

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.

From the ddrescue info pages:

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.

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.

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.

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.

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 the logfile, only the needed blocks are read from the second and successive copies.

Contents

Installation

Bootable CD

ddrescue is available on bootable rescue cds such as SystemRescueCd http://www.sysresccd.org/Main_Page.

Debian and Ubuntu

The package 'ddrescue' in Debian and Ubuntu is actually dd_rescue, another dd-like program which does not maintain a recovery log. The correct package is gddrescue.

Debian

aptitude install gddrescue

Ubuntu

sudo apt-get install gddrescue

Gentoo

emerge ddrescue

Partition recovery

Kernel 2.6.3+ & ddrescue 1.4+

'ddrescue --direct' will open the input with the O_DIRECT option for uncached reads. 'raw devices' are not needed on newer kernels. For older kernels see below.

First you copy as much data as possible, without retrying or splitting sectors:

ddrescue --no-split /dev/hda1 imagefile logfile

Now let it retry previous errors 3 times, using uncached reads:

ddrescue --direct --max-retries=3 /dev/hda1 imagefile logfile

If that fails you can try again but retrimmed, so it tries to reread full sectors:

ddrescue --direct --retrim --max-retries=3 /dev/hda1 imagefile logfile

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, CHKDSK) 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.

Before linux kernel 2.6.3 / 2.4.x

In 2.6.3 the 'raw device' has been marked obsolete. On later kernels ddrescue will use O_DIRECT on the input to do uncached reads.

First you copy as much data as possible, without retrying or splitting sectors:

ddrescue --no-split /dev/hda1 imagefile logfile

Now change over to raw device access. Let it retry previous errors 3 times, don't read past last block in logfile:

modprobe raw
raw /dev/raw/raw1 /dev/hda1
ddrescue --max-retries=3 --complete-only /dev/raw/raw1 imagefile logfile

If that fails you can try again (still using raw) but retrimmed, so it tries to reread full sectors:

ddrescue --retrim --max-retries=3 --complete-only /dev/raw/raw1 imagefile logfile

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, CHKDSK) 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.

At the end you may want to unbind the raw device:

raw /dev/raw/raw1 0 0

Examples

These two examples are taken directly from the ddrescue info pages.

Example 1: Rescue an ext2 partition in /dev/hda2 to /dev/hdb2

Please Note: This will overwrite ALL data on the partition you are copying to. If you do not want to do that, rather create an image of the partition to be rescued.

ddrescue -r3 /dev/hda2 /dev/hdb2 logfile
e2fsck -v -f /dev/hdb2
mount -t ext2 -o ro /dev/hdb2 /mnt

Example 2: Rescue a CD-ROM in /dev/cdrom

ddrescue -b 2048 /dev/cdrom cdimage logfile

write cdimage to a blank CD-ROM


This example is derived from the ddrescue manual.

Example 3: Rescue an entire hard disk /dev/sda to another disk /dev/sdb

copy the error free areas first

ddrescue -n /dev/sda /dev/sdb rescue.log

attempt to recover any bad sectors

ddrescue -r 1 /dev/sda /dev/sdb rescue.log

Options

-h, --help
   display this help and exit 
-V, --version
   output version information and exit 
-b, --block-size=<bytes>
   hardware block size of input device [512] 
-B, --binary-prefixes
   show binary multipliers in numbers [default SI] 
-c, --cluster-size=<blocks>
   hardware blocks to copy at a time [128] 
-C, --complete-only
   do not read new data beyond logfile limits 
-d, --direct
   use direct disc access for input file 
-D, --synchronous
   use synchronous writes for output file 
-e, --max-errors=<n>
   maximum number of error areas allowed 
-F, --fill=<types>
   fill given type areas with infile data (?*/-+) 
-g, --generate-logfile
   generate approximate logfile from partial copy 
-i, --input-position=<pos>
   starting position in input file [0] 
-n, --no-split
   do not try to split or retry error areas 
-o, --output-position=<pos>
   starting position in output file [ipos] 
-q, --quiet
   quiet operation 
-r, --max-retries=<n>
   exit after given retries (-1=infinity) [0] 
-R, --retrim
   mark all error areas as non-trimmed 
-s, --max-size=<bytes>
   maximum size of data to be copied 
-S, --sparse
   use sparse writes for output file 
-t, --truncate
   truncate output file 
-v, --verbose
   verbose operation

Numbers may be followed by a multiplier: b = blocks, k = kB = 10^3 = 1000, Ki = KiB = 2^10 = 1024, M = 10^6, Mi = 2^20, G = 10^9, Gi = 2^30, etc...


Cygwin

As of release 1.4-rc1, it can be compiled directly in Cygwin Out of the Box. Precompiled packages are available in the Cygwin distribution. This makes it usable natively on Windows systems.

See also

Other Resources

Useful code-snippets for DDrescue

Tutorial for beginners that guides through the process of imaging a hard drive with DDrescue and mounting it in Windows, using free software.