카테고리

asm (27) bootloader_x86_grub (1) C (92) compile (11) config (76) CPP (13) CSS (1) debugging (7) gimp (1) Go (1) html (1) Java (1) JavaScript (1) kernel (19) LibreOffice (3) Linux system progamming (21) MFC (1) opencv (4) OpenGL (1) PHP (1) Python (4) qemu (29) shell (3) socket (7) troubleshooting (2) ubuntu18.04 (2) windows (1)

2018/12/22

파일 복구


1. 파일 조각.

이미지 파일, 파티션 또는 하드 드라이브에서 메타 데이터가 아닌 헤더(머리 글) 정보와, 끝(바닥 글) 기반으로 파일을 검색.

NTFS 파티션
부트섹터

메타
데이터
파일 1


파일 2

파일 3

MFT





마스트 파일 표(MFT).
MFT는 모든 파일과 폴더에 대한 정보를 NTFS 볼륨에 저장.

메타 데이터
메타 데이터에는 일반적으로 파일 이름, 만든 날짜, 마지막으로 수정 한 날짜, 사용 권한, 디스크에 있는 파일 위치 등이 포함됨.

2. 리눅스 용 파일 조각 모음 및 복구 유틸
  • Foremost
  • Scalpel
  • Magic Rescue
  • Photorec
  • Recoverjpeg
  • Extundelete
  • Ntfsundelete
  • Scrounge-ntfs
3. 확장자 지정 이미지 파일 복구.
shell> sudo apt-get install foremost
shell> man foremost
-t : 형식
-i : 입력
-o : 출력
복구 가능한 파일 확장자 나열.

파티션 이미지 복사
shell> sudo dc3dd if=/dev/sdc1 of=/home/username/Desktop/flashdriver.img

shell>foremost -t jpg, png, gif -o flashoutput -i flashdrive.img
flashoutput 디렉토리 생성.

gif, png, gif 지정 확장자 파일 복구 확인.

3.1. 하드디스크 파일 복구
shell> sudo fdisk -l
shell> sudo foremost -t zip,doc,pdf -o ntfsoutput -i /dev/sdx1
ntfoutput 디렉토리 생성

shell> chmod 777 ntfoutput

4. scalpel을 이용한 파일 복구
shell> sudo apt-get install scalpel
shell> man scalpel

-c : 구성파일 호출
-o : 출력 디력토리 이름

shell> sudo cp /etc/scalpel/scalpel.conf ./

shell> vi scalpel.conf
복구 하고 싶은 파일 확장자 주석 제거.

파티션 이미지 복사
shell> sudo dc3dd if=/dev/sdc1 of=/home/username/Desktop/flashdriver.img

파일 복구
shell> scalpel -c scalpel.conf -o fileshoutput flashdrive.img

shell> sudo fdisk -l
파티션 정보 확인

NTFS 하드디스크 파일 복구
shell> sudo scalpel -c scalpel.conf -o ntfsoutput /dev/sdx1
shell> sudo chmod 777 ntfsoutput

환경설정 설정한 복구 파일 복원.

5. magicrescue 사용 파일 복구.
shell> sudo apt-get install magicrescue
shell> man magicrescue

-d : 출력 디렉토리
-r : 레시피
-M : 원하는 출력물 생성

기본적으로 지원하는 파일 형식.
shell> ls /usr/share/magicrescue/recipes
avi elf gpl jpeg-exif mbox mbox-mozilla-sent mp3-id3v2 nikon-raw png sqlite
canon-cr2 flac gzip jpeg-jfif mbox-mozilla-inbox mp3-id3v1 msoffice perl ppm zip

shell> mkdir output
shell> magicrescue -f jpeg-exif -r jpeg-jfif -r png -d output/ -M io flashdrive.img > log

shell> mkdir output2
shell> sudo fdisk -l
파티션 정보 확인 NTFS

shell> sudo magicrescue -r jpeg-exif -d output2 -M io /dev/sdx1 > log2
shell> sudo chmod -R 777 output2

6. 외장 디스크(sd, m-sd, usb) 사진 jpg 복구
shell> sudo apt-get install recoverjpeg

shell> mkdir output
shell> cd output
shell> sudo fdisk -l
윈도우 NTFS 확인

shell> sudo recoverjpeg /dev/sdx1
shell> sudo chmod 777 ./output

댓글 없음:

댓글 쓰기