This is my first attempt at doing some reverse engineering. I'm trying to dump the filesystem off a huawei hg523a TalkTalk router.
The problem is its quite limited in the amount of programs that are on the device. Below are a list of programs i can use.
BusyBox vv1.9.1 (2012-03-05 00:16:52 CST) multi-call binary
Currently defined functions:
[, [[, arp, ash, cat, chmod, chown, cp, date, echo, ftpget,
ftpput, halt, ifconfig, init, kill, killall, linuxrc,
ln, ls, mcast, mkdir, mknod, mount, netstat, nslookup,
ping, poweroff, ps, reboot, rm, route, sh, sleep, test,
top, traceroute, umount, vconfig, wget
So im trying to extract the filesystem to another linux machine so i can go through it more eaisely. I can upload single files with the ftpput command.
cat /proc/mtd
dev: size erasesize name
mtd0: 00010000 00001000 "boot"
mtd1: 00001000 00001000 "flag"
mtd2: 003c0000 00001000 "main"
mtd3: 0002d000 00001000 "config"
What im trying to do is upload mtdblock0-3 and then mount this on my other machine to explore the folder structure etc.. It looks like from /proc/mounts that it is a squashfs file system.
cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / squashfs ro 0 0
none /dev tmpfs rw 0 0
/proc /proc proc rw 0 0
none /var tmpfs rw 0 0
none /tmp tmpfs rw 0 0
none /mnt tmpfs rw 0 0
So basically i upload the mtdblock0.
ftpput -s -v -u james -p password -l /dev/mtdblock0 -r ftpdir/mtdblock0 192.168.1.64
and mount it on the other computer with:
root@kali:~/Desktop/talktalk/blocks# mount -t squashfs mtdblock0 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
Could anyone guide me in the right direction as to what i might be doing wrong? So it not possible to transfer the filesystem in this way?
thank you in advance for your help.