본문 바로가기
Security/[리얼] IoT

iptime 공유기에서 펌웨어 추출하는 방법

by blackcon 2016. 5. 13.
728x90

1. binwalk명령어를 사용하여 파일시스템 오프셋 확인

  • 명령어 : binwalk [binary]
  • 아래의 사진을 보면 " Squashfs filesystem, little endian, version 4.0, c"라는 파일시스템이 offset 1345582에 위치한 것을 확인할 수 있다.

2. dd 명령어로 파일시스템 추출

  • 명령어 : dd if=binary of=output bs=1 skip=[filesystem offset]
  • file명령어로 output파일을 확인한 결과 Squashfs 파일이 정상적으로 추출된 것을 확인할 수 있다.

3. 파일시스템 mount

  • 명령어 : unsquashfs output
  • squashfs-root디렉토리가 생성되었고 내부에 각 파일들이 존재한다.

# Download 'unsquashfs 
sudo apt-get install lzma-dev 
sudo apt-get install liblzma-dev 
tar -zxvf squashfs4.2.tar.gz 
cd squashfs4.2/squashfs-tools
: Edit Makefile and uncomment this line "LZMA_XZ_SUPPORT = 1" 

make
sudo make install 
sudo unsquashfs <path/lzma_filename_to_unsquash>
728x90

'Security > [리얼] IoT' 카테고리의 다른 글

QEMU 를 이용한 AVR 바이너리 분석하는 방법  (0) 2022.01.23