# Manual Filecarving 1

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2F5Rx2598wGNWecaVdTiW3%2Fintro.png?alt=media&#x26;token=a52e1001-c4e9-416e-9de8-39929a658034" alt=""></div>

### 1. Introduction

There are various types of digital files from Microsoft Word’s .docx files to executable programs and images. File extensions help identify a file but they are not always reliable as they can easily be manipulated. Standardized file types have unique signatures used by the operating system to identify, classify and display them to the user. The signatures can be identified in hex or ASCII format either as headers or footers indicating the start and end of a file. File types without footers might have a maximum file size specified. More information about different file signatures can be found in this [table by Gary Kessler.](https://www.garykessler.net/library/file_sigs.html)

**Header-footer or header-“maximum file size” carving—**&#x52;ecover files based on known headers and footers or maximum file size

* JPEG—”**xFFxD8**″ header and “**xFFxD9**” footer
* GIF—”x47x49x46x38x37x61″ header and “x00x3B” footer
* PST—”!BDN” header and no footer
* If the file format has no footer, a maximum file size is used in the carving program

HxD Editor download (Freeware):

{% embed url="<https://mh-nexus.de/de/downloads.php?product=HxD20>" %}
HxD Hexeditor
{% endembed %}

Image for Filecarving:

JPEG: Deleted, no thumbnails, not overwritten, unfragmented in free unallocated space

{% file src="<https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FQZ8cK8h2gB2iWKQupdLl%2FCarve1.bin?alt=media&token=a6393e79-d0b7-4ba7-b44d-03f0aa00febf>" %}

### 2. Analysis

First we open the file carv1.bin with HxD Editor and search for the jpg header `FFD8FF`

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FSl83A88UIgolv3QBmsj6%2Fcarving01.png?alt=media&#x26;token=e80a8369-de2c-4f36-9fa8-4ce0e066a2c3" alt="Start Offset is 1258"></div>

After locating the jpg header we copy the offset and search for the jpg footer that starts with `FFD9`

![End Offset is 2DE4](https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FCHfEczVlPtYh0bZao0F0%2Fcarving02.png?alt=media\&token=6fc726ca-f758-4c24-b894-ae116171d1ca)

We can now mark the whole block, copy the content and paste it in a new file:

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2FDp3TcusF2KH0N47RWZJr%2Fcarving03.png?alt=media&#x26;token=8ce73d86-6d52-42bc-b443-eda59101c85c" alt=""></div>

Save the file as `extracted.jpg` and have a look for the result:

<div align="left"><img src="https://3977837039-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MfT0VPyK6X13Egd9pzy%2Fuploads%2Fs6VaavGpZmSi6r4CuFdW%2Fextracted.jpg?alt=media&#x26;token=89f9b7c8-07f9-4a24-a74b-40d5d32648ef" alt="Extracted JPG Image"></div>
