Topic04 - Recovering Graphics File
Topic04 - Recovering Graphics File
GRAPHICS FILES
Dr. Abu Sayed Md. Mostafizur Rahaman
Professor
Department of Computer Science and Engineering
Jahangirnagar University
OUTCOME
After reading this chapter and completing the exercises, you
will be able to:
Describe types of graphics file formats
Explain types of data compression
Explain how to locate and recover graphics files
Describe how to identify unknown file formats
Explain copyright issues with graphics
3
UNDERSTANDING BITMAP AND RASTER IMAGES
Bitmap images
• Grids of individual pixels
Raster images - also collections of pixels
• Pixels are stored in rows
• Better for printing
• Image quality
• Screen resolution - determines amount of
detail that is displayed.
• Resolution is related to the density of
pixels onscreen and depends on a
combination of hardware and software.
• Number of color bits used per pixel
4
UNDERSTANDING VECTOR GRAPHICS
Characteristics of vector graphics
• Uses lines instead of dots
• Vector file store only the calculations for drawing lines and shapes
5
UNDERSTANDING METAFILE GRAPHICS
Metafile graphics combine raster and vector graphics
Example
• Scanned photo (bitmap) with text (vector)
Share advantages and disadvantages of both types
• When enlarged, bitmap part loses quality
6
UNDERSTANDING GRAPHICS FILE FORMATS
Standard bitmap file formats
• Portable Network Graphic (.png)
• Graphic Interchange Format (.gif)
• Joint Photographic Experts Group (.jpeg, .jpg)
• Tagged Image File Format (.tiff, .tif)
• Window Bitmap (.bmp)
Standard vector file formats
• Hewlett Packard Graphics Language (.hpgl)
• Autocad (.dxf)
• EPS, WMF, EMF
Go to this site to know more about file format: www.
garykessler.net/library/file_sigs.html
8
UNDERSTANDING DIGITAL PHOTOGRAPH FILE FORMATS
Most, if not all, digital cameras produce digital photos in raw or Exif
format
Forensics investigator might need to examine a digital photo created
by a witness to an accident,
• For example. Crimes such as child pornography might involve hundreds of digital
photos of alleged victims, and knowing how to analyze the data structures of
graphics files can give you additional evidence for a case
Examining the raw file format
• Raw file format
• Referred to as a digital negative
• Typically found on many higher-end digital cameras
• Sensors in the digital camera simply record pixels on the camera’s memory card
• Raw format maintains the best picture quality
9
UNDERSTANDING DIGITAL PHOTOGRAPH FILE FORMATS
10
UNDERSTANDING DIGITAL PHOTOGRAPH FILE FORMATS
11
UNDERSTANDING DIGITAL PHOTOGRAPH FILE FORMATS
12
UNDERSTANDING DIGITAL PHOTOGRAPH FILE FORMATS
13
UNDERSTANDING DIGITAL PHOTOGRAPH FILE FORMATS
14
AUTOPSY SHOWS EXIF INFORMATION
16
UNDERSTANDING DATA COMPRESSION
Some image formats compress their data
• GIF and JPEG
Others, like BMP, do not compress their data
• Use data compression tools for those formats
Data compression
• Coding data from a larger to a smaller form
• Types
• Lossless compression and lossy compression
17
LOSSLESS AND LOSSY COMPRESSION
Lossless compression
• Reduces file size without removing data
• Based on Huffman or Lempel-Ziv-Welch coding
• For redundant bits of data
• Utilities: WinZip, PKZip, StuffIt, and FreeZip
Lossy compression
• Permanently discards bits of information
• Vector quantization (VQ)
• Determines what data to discard based on vectors in the graphics file
• Utility: Lzip
18
LOSSLESS ENCODING: LEMPEL-ZIV
21
IDENTIFYING GRAPHICS FILE FRAGMENTS
If a graphics file is fragmented across areas on a disk, you
must recover all the fragments before re-creating the file.
Recovering any type of file fragments is called carving, also
known as salvaging outside North America.
Digital forensics tools
• Can carve from file slack and free space
• Help identify image files fragments and put them together
22
REPAIRING DAMAGED HEADERS
When examining recovered fragments from files in slack or free space
• You might find data that appears to be a header
If header data is partially overwritten, you must reconstruct the header to make it readable
• By comparing the hexadecimal values of known graphics file formats with the pattern of the file header you
found
Example:
• A JPEG file has the hexadecimal header value FFD8, followed by the label JFIF for a standard JPEG or Exif file
at offset 6
Exercise:
• Investigate a possible intellectual property theft by a contract employee of Exotic Mountain Tour Service
(EMTS)
23
SEARCHING FOR AND CARVING DATA FROM
UNALLOCATED SPACE
Steps
• Planning your examination
• Searching for and recovering digital photograph evidence
• Use Prodiscover Basic to search for and extract (recover) possible evidence
of JPEG files
• False hits are referred to as false positives
24
CASE STUDY
Suppose you’re investigating a possible intellectual property theft by a contract employee of Exotic Mountain Tour
Service (EMTS). EMTS has just finished an expensive marketing and customer service analysis with Superior Bicycles,
LLC.
Based on this analysis, EMTS plans to release advertising for its latest tour service with a joint product marketing
campaign with Superior Bicycles.
Unfortunately, EMTS suspects that a contract travel consultant, Bob Aspen, might have given sensitive marketing data to
another bicycle competitor. EMTS is under a nondisclosure agreement with Superior Bicycles and must protect this
advertising campaign material.
An EMTS manager found a USB drive on the desk Bob Aspen was assigned to.
Your task is to determine whether the drive contains proprietary EMTS or Superior Bicycles data. The EMTS manager also
gives you some interesting information he gathered from the Web server administrator.
EMTS filters all Web-based e-mail traffic traveling through its network and detects suspicious attachments.
When a Web-based e-mail with attachments is received, the Web filter is triggered. The EMTS manager gives you two
screen captures, shown in Figures 8-5 and 8-6, of partial e-mails intercepted by the Web filter that lead him to believe Bob
Aspen might have engaged in questionable activities.
To do this, in the next section you use ProDiscover’s cluster search function
with hexadecimal search strings to look for known data.
The first message from [email protected] is addressed to [email protected], which matches the contract
employee’s name, Bob Aspen. Next, look at the time and date stamps in this message. The first is 4 Feb 2015 9:21 PM,
and the second, farther down, is a header from Jim Shu with a time and date stamp of February 5, 2015, 5:17 AM -08:00.
Therefore, it seems Jim Shu sent the original message, which was forwarded to the [email protected] account.
Because the timestamp for Jim Shu is later than the time-stamp for [email protected], Terry Sadler’s location
might be in a different time zone, somewhere west of Jim Shu, or one of the two e-mail server’s time values is off
because e-mail servers, not users, provide timestamps.
Continuing with the first message, note that Jim is telling Terry to have Bob alter the file extensions from .txt to .jpg, and
the files are about new kayaks. The last line appears to be a previous response from [email protected]
commenting that Bob (assuming it’s Bob Aspen) can’t receive this message.
The search string to use for this examination is “FIF.” Because it’s part of the label
name of the JFIF JPEG format, you might have several false hits if the USB drive
contains several other JPEG files. These false hits, referred to as false positives,
require examining each search hit to verify whether it’s what you are looking for.
Next to practical
32
REBUILDING FILE HEADERS
Before attempting to edit a recovered graphics file
• Try to open the file with an image viewer first
If the image isn’t displayed, you have to inspect and correct
the header values manually
Steps
• Recover more pieces of file if needed
• Examine file header
• Compare with a good header sample
• Manually insert correct hexadecimal values
• Test corrected file
• Next to practical
33
RECONSTRUCTING FILE FRAGMENTS
Locate the noncontiguous clusters that make up a deleted file
Steps
• Locate and export all clusters of the fragmented file
• Determine the starting and ending cluster numbers for each
fragmented group of clusters
• Copy each fragmented group of clusters in their correct sequence to a
recovery file
• Rebuild the file’s header to make it readable in a graphics viewer
34
RECONSTRUCTING FILE FRAGMENTS
Go to practical part
35
IDENTIFYING UNKNOWN FILE FORMATS
Knowing the purpose of each format and how it stores data is
part of the investigation process
The Internet is the best source
• Search engines like Google
• Find explanations and viewers
Popular Web sites
• www.fileformat.info/format/all.htm
• http://extension.informer.com
• www.martinreddy.net/gfxl
36
ANALYZING GRAPHICS FILE HEADERS
Necessary when you find files your tools do not recognize
Use a hexadecimal editor such as WinHex
• Record hexadecimal values in the header and use them to define a file
type
Example:
• XIF file format is old, little information is available
• The first 3 bytes of an XIF file are the same as a TIF file
• Build your own header search string
37
UNDERSTANDING STEGANOGRAPHY IN GRAPHICS FILES
Steganography hides information inside image files
• An ancient technique
Two major forms: insertion and substitution
Insertion
• Hidden data is not displayed when viewing host file in its associated
program
• You need to analyze the data structure carefully
• Example: Web page
38
UNDERSTANDING STEGANOGRAPHY IN GRAPHICS FILES
39
UNDERSTANDING STEGANOGRAPHY IN GRAPHICS FILES
40
UNDERSTANDING STEGANOGRAPHY IN GRAPHICS FILES
Substitution
• Replaces bits of the host file with other bits of data
• Usually change the last two LSBs (least significant bit)
• Detected with steganalysis tools (a.k.a - steg tools)
You should inspect all files for evidence of steganography
Clues to look for:
• Duplicate files with different hash values
• Steganography programs installed on suspect’s drive
41
UNDERSTANDING STEGANOGRAPHY IN GRAPHICS FILES
42
USING STEGANALYSIS TOOLS
Use steg tools to detect, decode, and record hidden data
Detect variations of the graphic image
• When applied correctly you cannot detect hidden data in most cases
Check to see whether the file size, image quality, or file
extensions have changed
43
UNDERSTANDING COPYRIGHT ISSUES WITH GRAPHICS
Steganography has been used to protect copyrighted material
• By inserting digital watermarks into a file
Digital investigators need to aware of copyright laws
Copyright laws for Internet are not clear
• There is no international copyright law
Check www.copyright.gov
• U.S. Copyright Office identifies what can and can’t be covered under
copyright law in U.S.
44