8

I am trying to extract the squashfs filesystem of my router. Here is firmware.

First, I unzipped the file. Next, I ran binwalk to get some information about the file.

DECIMAL     HEX         DESCRIPTION
-------------------------------------------------------------------------------------------------------
58          0x3A        TRX firmware header, little endian, header size: 28 bytes,  image size: 6656000 bytes, CRC32: 0x2B1713B2 flags/version: 0x10000
86          0x56        LZMA compressed data, properties: 0x5D, dictionary size: 65536 bytes, uncompressed size: 3614368 bytes
1282426     0x13917A    Squashfs filesystem, little endian, non-standard signature,  version 3.0, size: 5367357 bytes,  853 inodes, blocksize: 65536 bytes, created: Wed Aug  7 05:08:47 2013 

I then ran binwalk -e to extract the contents of the file. I got three files:

.
├── 13917A.squashfs
├── 56
└── 56.7z

Running unsquashfs on 13917A.squashfs failed, saying it was unable to find the magic block. This was because the file was using a non standard magic. Changing the magic to a standard one made unsquashfs and file detect it as a squashfs file system. But unsquashfs did not complete successfully:

caff@UbunutuX2:~/Netgear/test$ unsquashfs 13917A.squashfs 
Reading a different endian SQUASHFS filesystem on 13917A.squashfs
Filesystem on 13917A.squashfs is (768:0), which is a later filesystem version than I support!

I also tried extracting the file system by using Jeremy Collake’s Firmware Mod Kit. This failed also:

caff@UbunutuX2:~/Netgear/test$ /opt/firmware-mod-kit/trunk/unsquashfs_all.sh 13917A.squashfs 
Attempting to extract SquashFS .X file system...


Trying ./src/others/squashfs-3.4-nb4/unsquashfs-lzma... Skipping others/squashfs-hg55x-bin (wrong version)...
File extraction failed!

How do I extract this squashfs file system?

0xcaff
  • 257
  • 1
  • 3
  • 8

1 Answers1

3

After unziping the arhive, run binwalk with

binwalk -eM *.chm

Flag e stands for extract automatically,and M for --matryoshka or recursively scanning and extracting.

After a few recursive unpackings, you'll get a squashfs-root dir with what you want I guess.

For what it's worth, I tried this with binwalk version 1.2.1.

0xcaff
  • 257
  • 1
  • 3
  • 8
0xea
  • 4,904
  • 1
  • 23
  • 30