Ancillary – File Carving Tool

digital-fingerprint.png

  1. Abstract
  2. Basic manual
  3. Screenshots
  4. List of headers and tails
  5. Bibliography
  6. License
  7. Feedback
  8. Downloads

Note: See the new version of Ancillary.

1. Abstract

Ancillary was born as a personal tool used to solve forensic challenges. Eventually it was improving and I realized that people were asking me for the program. Seeing that it was a useful tool, I decided to share it with the community and finally I decided to publish it.

The program only process uncompressed files. If you suspect that the file is compressed or encrypted first solve this trouble and then process with Ancillary.

2. Basic manual

There are two modes for process files, automatic and manual.

In AUTO mode we only have to load the file to process and select «smart recovery» or «I’m hungry». The smart recovery option loses less time processing the file because it associates the headers and tails automatically. The «I’m hungry» option retrieves all the possible files combining all headers with all tails. This latter mode recovers some trash or unreadable files.

In MANUAL mode, the program retrieves all the headers and tails that found in the file and collets the offsets in two lists that we can combine as we like even deleting and adding offsets.

AUTO mode example

Open or drag and drop the file to process.

auto01

Analize the file.

auto02

Select the type of file to recover.

auto03

Select one option.

auto04

Push «Carving current file» button and wait finalize the process.

auto05

Finally show the recovered files at output folder clicking the indicated button.

auto06

MANUAL mode example

Open or drag and drop the file to process and change to manual mode.

manual01

Select the type of file what you want to recover and push «Carving current file».

manual03

Select the header and the tail and push «View selected offsets resultant file». The resultant file should be opened.

manual04

3. Screenshots

filemenu

optionsmenu

helpmenu

automode

manual mode

manualmode_contextmenu

log_preview

4. List of headers and tails

Ancillary at present works with 15 type of files like JPG, PNG, GIF, BMP, RAR, ZIP, DOCX, RTF, PDF, ODS, ODT, ODB, ODG, ODF and ODP.

  • JPEG
    • Header: FFD8
    • Tail: FFD9
  • GIF87a
    • Header: 47 49 46 38 37 61
    • Tail: 00 3B
  • GIF89a
    • Header: 47 49 46 38 39 61
    • Tail: 00 3B
  • BMP
    • Header: 42 4D
    • Tail: Don’t have
  • PNG
    • Header: 89 50 4E 47 0D 0A 1A 0A
    • Footer: 49 45 4E 44 AE 42 60 82
  • DOCX
    • Header 50 4B 03 04 14 00 06 00
    • Tail: 50 4B 05 06 (PK..) followed by 18 additional bytes at the end of the file.
  • PDF
    • Header: 25 50 44 46 PDF
    • Tails: 0A 25 25 45 4F 46 (.%%EOF) or 0A 25 25 45 4F 46 0A (.%%EOF.) or 0D 0A 25 25 45 4F 46 0D 0A (..%%EOF..) or 0D 25 25 45 4F 46 0D (.%%EOF.)
  • ZIP
    • Header: 50 4B 03 04
    • Tail: 50 4B 05 06 (PK..) followed by 18 additional bytes at the end of the file.
  • RAR
    • Header: 52 61 72 21 1A 07 00
    • Tail: C4 3D 7B 00 40 07 00
  • RTF
    • Header: 7B 5C 72 74 66 31
    • Tail: 5C 70 61 72 20 7D
  • ODS
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 73 70 72 65 (spre)
    • Tail: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODT
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 74 65 78 64 (text)
    • Tail: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODB
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 62 61 73 65 (base)
    • Tail: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODG
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 67 72 61 70 (grap)
    • Tail: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODF
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 66 6F 72 6D (form)
    • Tail: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODP
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 70 72 65 73 (pres)
    • Tail: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.

5. Bibliography

[1] http://forensicswiki.org

[2] http://www.garykessler.net/library/file_sigs.html

6. License

At the moment the license is FREEWARE but in the future will be FREE SOFTWARE.

ANCILLARY IS PROVIDED «AS IS», WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

7. Feedback

If you have any question, doubt or suggestion, please mail me to deurus at deurus dot info or deurus82 at gmail dot com.

8. Downloads

This tool is FREE of spyware, viruses, adware and others

virustotal


Intro We require your services once again. An employee from our company had recently been identified as a known criminal
File carving is the process of reassembling computer files from fragments in the absence of filesystem metadata. Wikipedia. "File carving", literalmente tallado
Intro President’s cat was kidnapped by separatists. A suspect carrying a USB key has been arrested. Berthier, once again, up

Reto forense de HackThis!!

Intro

We require your services once again. An employee from our company had recently been identified as a known criminal named Brett Thwaits. He is considered to have stolen missile launch codes from the US navy which unfortunately were handed to us for a brief period of time. As of now, we are accussed of the theft and unless we do something about it, we’re gonna end in some serious trouble. Before Brett left, he formatted the thumbdrive which used to store the launch codes. Fortunately, our system had made a backup image of the drive. See if you can recover the fourth launch code. Good luck!

Requerimos una vez más sus servicios. Un empleado de nuestra empresa había sido identificado recientemente como el conocido criminal Brett Thwaites. Se considera que ha robado los códigos de lanzamiento de misiles de la Armada de Estados Unidos, que por desgracia fueron entregados a nosotros por un breve período de tiempo. A partir de ahora, se nos acusa del robo y a menos que hagamos algo al respecto, vamos a tener serios problemas. Antes de que Brett se fuera formateó el dispositivo que se usa para almacenar los códigos de lanzamiento. Afortunadamente, nuestro sistema había hecho una copia de seguridad de la unidad. Mira a ver si puedes recuperar los cuatro códigos de lanzamiento. ¡Buena suerte!

Análisis del archivo

  • Fichero: forensics1
  • Extensión: img
  • Tamaño: 25 MB (26.214.400 bytes)
  • Hash MD5: 56e4cd5b8f076ba8b7c020c7339caa2b

Echamos un vistazo al archivo con un editor hexadecimal y vemos encabezados de tipos de archivos conocidos, por lo que la unidad no está encriptada. Al no estar encriptada la imagen, usaremos una herramienta de creación propia, Ancillary. En esta ocasión usaremos la versión 2 alpha, que actualmente está en desarrollo, pero podéis usar tranquilamente la versión 1.x.

Ancillary nos muestra lo que ha encontrado en el archivo por lo que pasamos a analizarlo.

2016-03-06_11-20-52

Como siempre os digo en este tipo de retos, es difícil discriminar unos ficheros en favor de otros, ya que no sabemos si lo que buscamos va a estar en una imagen, documento u otro tipo de fichero codificado o no.

2016-03-06_11-33-55

Tras analizar todos los ficheros, rápidamente suscitan nuestro interés los ficheros RAR, y más cuando el fichero que contienen es un fichero de audio y su nombre es tan sugerente como «conversation_dtmf.wav«. Como podéis apreciar en la imagen, el fichero RAR está protegido con clave por lo que necesitamos esquivar ese obstaculo.

2016-03-06_11-35-32

Recuperando una clave de un archivo RAR

En este caso el software que voy a utilizar es cRARk, pero podéis utilizar cualquier otro. Como se muestra en la imagen de abajo, mi procesador es más bien modesto pero la clave no tiene más que tres dígitos por lo que no supone ninguna dificultad recuperarla.

2016-03-06_11-42-40

DTMF (Dual-Tone Multi-Frequency)

Una vez recuperado el archivo WAV, al reproducirlo escuchamos 16 tonos telefónicos que inmediatamente me recuerdan las aventuras del mítico «Capitán Crunch«. Os animo a leer la historia de John Draper y su famosa «Blue Box» ya que no tiene desperdicio y forma parte de la historia del Phreaking.

Por si no conocías la historia, el propio nombre del fichero wav nos da la pista clave de qué buscar al contener las siglas «DTMF«.

Al ser pulsada en el teléfono la tecla correspondiente al dígito que quiere marcar, se envían dos tonos, de distinta frecuencia: uno por columna y otro por fila en la que esté la tecla, que la central decodifica a través de filtros especiales, detectando qué dígito se marcó.

No tenemos más que buscar un decodificador de tonos para obtener los preciados códigos de lanzamiento.

2016-03-06_11-44-24

Links

List of file signatures for file carving

File carving is the process of reassembling computer files from fragments in the absence of filesystem metadata. Wikipedia.

«File carving», literalmente tallado de archivos aunque lo traduciremos como extracción, es el proceso de re-ensamblado de archivos extraídos de un conjunto de mayor tamaño.

Índice

  1. Image files / Archivos de imagen
  2. Microsoft Office >2007
  3. Open Office
  4. Autocad
  5. Others / Otros
  6. Links / Enlaces

List of headers and tails / Lista de cabeceras y pies

Header = Cabecera

Footer or tail = Pie

Image files / Archivos de imagen

  • JPEG
    • Header: FFD8
    • Footer: FFD9
  • GIF87a
    • Header: 47 49 46 38 37 61
    • Footer: 00 3B
  • GIF89a
    • Header: 47 49 46 38 39 61
    • Footer: 00 3B
  • BMP
    • Header: 42 4D
    • Footer: Don’t have footer, but size is in bytes 2,3,4,5 in little-endian order (low byte first).
      • Example: 00 00 C0 38 == 49208 bytes

bmpsize

  • PNG
    • Header: 89 50 4E 47 0D 0A 1A 0A
    • Footer: 49 45 4E 44 AE 42 60 82

Microsoft Office >2007

All this documents have the same header and footer, because of this, we need search the middle bytes. This type uses a ZIP file package.

Los documentos de Microsoft Office >2007 tienen la misma cabecera y pie, por lo que necesitamos bytes intermedios para distinguirlos. Usan encapsulado ZIP.

  • DOCX
    • Header: 50 4B 03 04 14 00 06 00
      • Middle: 77 6F 72 64 (word)
    • Footer: 50 4B 05 06 (PK..) followed by 18 additional bytes at the end of the file.
  • XLSX
    • Header: 50 4B 03 04 14 00 06 00
      • Middle: 77 6F 72 6B 73 68 65 65 74 73 (worksheets)
    • Footer: 50 4B 05 06 (PK..) followed by 18 additional bytes at the end of the file.
  • PPTX
    • Header: 50 4B 03 04 14 00 06 00
      • Middle: 70 72 65 73 65 6E 74 61 74 69 6F 6E (presentation)
    • Footer: 50 4B 05 06 (PK..) followed by 18 additional bytes at the end of the file.
  • MDB / ACCDB
    • Header: 00 01 00 00 53 74 61 6E 64 61 72 64 20 4A 65 74 20 44 42 (….Standard Jet DB)
    • Footer: Don’t have footer.

Open Office

All this documents have the same header and footer, because of this, we need some bytes to differentiate them. In this case we can do this jumping 73 bytes from header. This type uses a ZIP file package.

Los documentos de OpenOffice tienen la misma cabecera y pie, por lo que necesitamos bytes intermedios para distinguirlos. Usan encapsulado ZIP.

  • ODS
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 73 70 72 65 (spre)
    • Footer: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODT
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 74 65 78 64 (text)
    • Footer: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODB
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 62 61 73 65 (base)
    • Footer: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODG
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 67 72 61 70 (grap)
    • Footer: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODF
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 66 6F 72 6D (form)
    • Tail: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.
  • ODP
    • Header: 50 4B 03 04 14 (PK..) jump +73 (0x49) bytes and 70 72 65 73 (pres)
    • Footer: 6D 61 6E 69 66 65 73 74 2E 78 6D 6C 50 4B 05 06 (manifest.xmlPK) followed by 18 additional bytes.

Autocad

  • DWG (R11/R12 versions)
    • Header: 41 43 31 30 30 39
    • Footer: CD 06 B2 F5 1F E6
  • DWG (R14 version)
    • Header: 41 43 31 30 31 34
    • Footer: 62 A8 35 C0 62 BB EF D4
  • DWG (2000 version)
    • Header: 41 43 31 30 31 34
    • Footer: DB BF F6 ED C3 55 FE
  • DWG (>2007 versions)
    • Header: 41 43 31 30 XX XX
    • Footer: Don’t have

Note: >2007 versions have two patterns and the key is the position 0x80. If in this position we get the bytes «68 40 F8 F7 92», we need to search again for this bytes and displace 107 bytes to find the end of the file. If in the position 0x80 we get another different bytes, we need to search again this bytes and displace 1024 bytes to find the end of the file.

Nota: Las versiones >2007 siguen dos patrones y la clave está en la posición 0x80. Si en la posicion 0x80 obtenemos los bytes «68 40 F8 F7 92», los buscamos una segunda vez y ha 107 bytes encontramos el final del archivo. Si en la posición 0x80 obtenemos otros bytes diferentes a los del primer caso, los volvemos a buscar y a 1024 bytes hallaremos el final del archivo.

Others / Otros

  • PDF
    • Header: 25 50 44 46 (%PDF)
    • Footers:
      • 0A 25 25 45 4F 46 (.%%EOF) or
      • 0A 25 25 45 4F 46 0A (.%%EOF.) or
      • 0D 0A 25 25 45 4F 46 0D 0A (..%%EOF..) or
      • 0D 25 25 45 4F 46 0D (.%%EOF.)
  • ZIP
    • Header: 50 4B 03 04
    • Footer: 50 4B 05 06 (PK..) followed by 18 additional bytes at the end of the file.
  • RAR (< 4.x version)
    • Header: 52 61 72 21 1A 07 00
    • Tail: C4 3D 7B 00 40 07 00
  • 7ZIP
    • Header: 37 7A BC AF 27 1C 00 03  (7z¼¯’…)
    • Footer: 01 15 06 01 00 20 followed by 5 additional bytes at the end of the file.
  • RTF
    • Header: 7B 5C 72 74 66 31
    • Footer: 5C 70 61 72 20 7D

Links / Enlaces

Protegido: Reto forense «Find the cat» de Root-Me.org

Este contenido está protegido por contraseña. Para verlo introduce la contraseña.