I am working on reversing a router for which I cannot find downloadable firmware anywhere. I managed to get a root shell on the router. I am now confused as I cannot see any persistent writeable mounts. Most are tmpfs filesystems, one is a sysfs which as far as I understand is not an actual filesystem, and /dev/mtdblock7 which is a squashfs filesystem (and is readonly). Where is the persistent storage that keeps my configurations? What am I missing here?
# mount
/dev/mtdblock7 on / type squashfs (ro,relatime)
/proc on /proc type proc (rw,relatime)
tmpfs on /var type tmpfs (rw,relatime,size=15360k)
tmpfs on /mnt type tmpfs (rw,relatime,size=16k)
sysfs on /sys type sysfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,relatime,size=3096k)
none on /proc/bus/usb type usbfs (rw,relatime)
Update:
Board
This is a ZTE router, the board has a printed label that says: ZXHN H367N V1.0
The default update file that uboot looks for when booting over tftp is called H367N_image.bin
Running zcu signature on the config file gives ZXDSL 931VII V3.0
The decryption password used to decrypt and encrypt the file is the same as the one used in ZXHN H208N
according to this.
Also, I remember seeing H368N
somewhere, but I'm not sure where.
Finally I found paths that have the directory H367N_Develop_UGW5.4
in them.
mtdblocks
(This is a summary of what binwalk found)
mtdblock0:
- List item crc
- uImage header "u-boot image"
- lzma
mtdblock1:
- UBI erease count header
mtdblock2:
- nothing found
mtdblock3:
- uImage header "GPHY Firmware"
- lzma compression
- uImage header "GPHY Firmware"
- lzma compression
- zlib compressed data
- PEM RSA private key
- PEM certificate
- uImage header "MIPS LTQCPE Linux-2.6.32.42"
- lzma
- squashfs
- uImage header "MIPS LTQCPE Linux-2.6.32.42"
- lzma
- squashfs
mtdblock4:
- uImage header "GPHY Firmware"
- lzma
- uImage header "GPHY Firmware"
- lzma
mtdblock5:
- zlib compressed data
- PEM RSA private key
- PEM certificate
mtdblock6:
- uImage header "MIPS LTQCPE Linux-2.6.32.42"
- lzma
mtdblock7:
- squashfs
mtdblock8:
- uImage header "MIPS LTQCPE Linux-2.6.32.42"
- lzma
mtdblock9:
- squashfs
mtdblock10:
- nothing
mtdblock11:
- nothing
mtdblock6 and mtdblock8 are identical mtdblock7 and mtdblock9 are identical mtdblock3 contains the same binary as mtdblocks 6,7,8 and 9, and likely others as well.
I tried remounting /dev/mtdblock7 but failed. Maybe I did something wrong but my understanding is that squashfs should not be writable in any case.