It appears that the firmware-mod-kit installation instructions are incomplete. After doing a git clone and setting the binwalk path using unsquashfs_all.sh on the Dlink firmware from the Offsensive IoT course fails. After investigation it appears that the binaries for each version of squshfs filesystem need to be compiled. Running a ./configure and make in the src directory results in:
make[2]: Entering directory '/root/tools/firmware-analysis-toolkit/firmware-mod-kit/src/others/squashfs-2.2-r2-7z'
g++ mksquashfs.o read_fs.o sort.o -L. -llzma -lpthread -o mksquashfs
mksquashfs.o: In function `linux_opendir':
/root/tools/firmware-analysis-toolkit/firmware-mod-kit/src/others/squashfs-2.2-r2-7z/mksquashfs.c:1384: undefined reference to `add_dir_entry'
mksquashfs.o: In function `encomp_opendir':
/root/tools/firmware-analysis-toolkit/firmware-mod-kit/src/others/squashfs-2.2-r2-7z/mksquashfs.c:1399: undefined reference to `add_dir_entry'
/root/tools/firmware-analysis-toolkit/firmware-mod-kit/src/others/squashfs-2.2-r2-7z/mksquashfs.c:1416: undefined reference to `add_dir_entry'
mksquashfs.o: In function `single_opendir':
/root/tools/firmware-analysis-toolkit/firmware-mod-kit/src/others/squashfs-2.2-r2-7z/mksquashfs.c:1431: undefined reference to `add_dir_entry'
/root/tools/firmware-analysis-toolkit/firmware-mod-kit/src/others/squashfs-2.2-r2-7z/mksquashfs.c:1451: undefined reference to `add_dir_entry'
collect2: error: ld returned 1 exit status
Makefile:18: recipe for target 'mksquashfs' failed
make[2]: *** [mksquashfs] Error 1
make[2]: Leaving directory '/root/tools/firmware-analysis-toolkit/firmware-mod-kit/src/others/squashfs-2.2-r2-7z'
Makefile:2: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/root/tools/firmware-analysis-toolkit/firmware-mod-kit/src/others'
Makefile:7: recipe for target 'all' failed
make: *** [all] Error 2
I have been able to compile src/others/squashfs-3.2-r2-lzma individually to be able to follow along with the video but this doesn't appear to work out of the box the way the instructions describe.
It appears that the firmware-mod-kit installation instructions are incomplete. After doing a git clone and setting the binwalk path using unsquashfs_all.sh on the Dlink firmware from the Offsensive IoT course fails. After investigation it appears that the binaries for each version of squshfs filesystem need to be compiled. Running a ./configure and make in the src directory results in:
I have been able to compile src/others/squashfs-3.2-r2-lzma individually to be able to follow along with the video but this doesn't appear to work out of the box the way the instructions describe.