본문 바로가기

Learning/ └Kali Linux

[Forensics Tools] Foremost


카빙 툴 프로그램(Foremost)

■ Package Description

Foremost는 데이터 구조를 기반으로 손실 된 파일을 복구하기 위한 카빙(Carving) 툴 프로그램 입니다. 

네트워크 패킷 데이터 추출, 악성코드 분석, CTF 포렌식 문제 등에 자주 사용하는 툴 이며,

해킹대회에서 알 수 없는 파일이나 무엇인가 합쳐져 있는 것 같은 파일을 분리해낼때 유용하게 쓰일 수 있습니다.

Foremost는 dd, Safeback, Encase 등으로 생성 된 이미지 파일이나 드라이브에서 직접 작업 할 수 있습니다. 

머리글과 바닥 글은 구성 파일로 지정하거나 명령 줄 스위치를 사용하여 기본 제공 파일 형식을 지정할 수 있습니다. 

이러한 기본 제공 유형은 주어진 파일 형식의 데이터 구조를보고 더 안정적이고 빠른 복구를 가능하게합니다.

 

 

참조 사이트

http://foremost.sourceforge.net/

https://www.youtube.com/watch?v=OGlRKz2PECg

 

■ OPTIONS

# foremost -h

# foremost -h
foremost version 1.5.7 by Jesse Kornblum, Kris Kendall, and Nick Mikus.
$ foremost [-v|-V|-h|-T|-Q|-q|-a|-w-d] [-t <type>] [-s <blocks>] [-k <size>]
    [-b <size>] [-c <file>] [-o <dir>] [-i <file]

-V  - display copyright information and exit
-t  - specify file type.  (-t jpeg,pdf ...)
-d  - turn on indirect block detection (for UNIX file-systems)
-i  - specify input file (default is stdin)
-a  - Write all headers, perform no error detection (corrupted files)
-w  - Only write the audit file, do not write any detected files to the disk
-o  - set output directory (defaults to output)
-c  - set configuration file to use (defaults to foremost.conf)
-q  - enables quick mode. Search are performed on 512 byte boundaries.
-Q  - enables quiet mode. Suppress output messages.
-v  - verbose mode. Logs all messages to screen

 

[EX] 사용 예제

# foremost [추출하고자 하는 파일 이름]

 

test.jpg 파일에서 exe, dll 파일만 추출

# foremost -t exe,dll test.jpg

 

/tmp/test 파일에서 모든 파일을 추출

# foremost -t all -i /tmp/test 

 

/tmp/test/ 파일에서 office 문서와 jpeg 파일을 추출하고 화면에 출력(verbose mode)

# foremost -v -t ole,jpeg -i /tmp/test

 

test.pcap 캡처 파일들을 추출하고 화면에 출력

# foremost -i test.pcap -v

-v 화면에 모든 메세지 출력

-t 뽑아낼 파일 형식 지정 (jpeg, pdf, exe ....)

-i 입력 파일 지정