I'm trying to use binwalk to extract the firmware for the Ubiquiti Networks ER-X. Currently I've downloaded a copy of the firmware and uncompressed it. I opened the folder with the filesystem contents and found compat squashfs.tmp squashfs.tmp.md5 version.tmp vmlinux.tmp vmlinux.tmp.md5
. I checked to see which file was the biggest and found squashfs.tmp
to be the biggest at about 78MB in size. I ran binwalk with the -e flag but that didn't extract the filesystem. Link to the firmware.
1 Answer
I was able to extract the file system just fine. I used Binwalk v2.1.2b and have sasquatch
installed.
Extracted file system:
_squashfs.tmp.extracted/squashfs-root $ ls
bin boot config dev etc home lib media mnt opt proc root root.dev run sbin selinux srv sys tmp usr var
It is indeed for a MIPS device:
$ file bin/bash
bin/bash: ELF 32-bit LSB executable, MIPS, MIPS-II version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=1b20797b11fa0a481a334f911ac5dfa27ce20c75, stripped
Make sure all of your tools are up to date and you have the necessary plugins installed. From the installation page:
Binwalk relies on multiple external utilties in order to automatically extract/decompress files and data:
# Install standard extraction utilities $ sudo apt-get install mtd-utils gzip bzip2 tar arj lhasa p7zip p7zip-full cabextract cramfsprogs cramfsswap squashfs-tools sleuthkit default-jdk lzop srecord # Install sasquatch to extract non-standard SquashFS images $ sudo apt-get install zlib1g-dev liblzma-dev liblzo2-dev $ git clone https://github.com/devttys0/sasquatch $ (cd sasquatch && ./build.sh) # Install jefferson to extract JFFS2 file systems $ sudo pip install cstruct $ git clone https://github.com/sviehb/jefferson $ (cd jefferson && sudo python setup.py install)
-
I am using MacOS but thanks for the response. The Binwalk version I'm running is v2.1.1. I ran "brew upgrade binwalk" and brew said that was the latest version.– kkx07805Oct 3, 2018 at 22:33
-
Do you have a tool that can extract SquashFS file systems? Such as
unsquashfs
orsasquatch
?binwalk
usessasquatch
to extract SquashFS file systems, so unless you have that installed on your Mac you will need to extract it some other way. If you have access to a linux box (such as a VM), installation of everything you need is trivial, as the installation page indicates.– julian ♦Oct 3, 2018 at 22:40 -
I wanted to just use the MacOS environment but I guess I will half to get a Docker container setup for running binwalk. It's a shame because I quite like homebrew.– kkx07805Oct 3, 2018 at 23:10