binwalk环境搭建
Binwalk 是一种快速、易于使用的工具,用于分析、逆向工程和提取固件映像。到目前为止最新版本是v2.3.3。
系统环境
Ubuntu 20.04 python 3.8.10 |
安装命令
sudo apt install -y python3-dev python3-pip wget https://github.com/ReFirmLabs/binwalk/archive/refs/tags/v2.3.3.tar.gz tar xf v2.3.3.tar.gz cd binwalk-2.3.3 sudo python3 setup.py install |
安装好后输入binwalk能够显示提示信息:

将工具的基本环境装好之后,还需要安装解包固件的依赖库:
# 安装标准提取工具和依赖 sudo apt-get -y install mtd-utils gzip bzip2 tar arj lhasa p7zip p7zip-full cabextract cramfsswap squashfs-tools sleuthkit default-jdk lzop srecord git # 安装 sasquatch 以提取非标准 SquashFS 镜像 sudo apt-get -y install zlib1g-dev liblzma-dev liblzo2-dev git clone https://github.com/devttys0/sasquatch (cd sasquatch && ./build.sh) # 安装 jefferson 以提取 JFFS2 文件系统 sudo pip install cstruct git clone https://github.com/sviehb/jefferson (cd jefferson && sudo python3 setup.py install) # 安装 ubi_reader 以提取 UBIFS 文件系统 sudo apt-get -y install liblzo2-dev python-lzo git clone https://github.com/jrspruitt/ubi_reader (cd ubi_reader && sudo python3 setup.py install) # 安装 yaffshiv 以提取 YAFFS 文件系统 git clone https://github.com/devttys0/yaffshiv (cd yaffshiv && sudo python3 setup.py install) #安装 unstuff 以提取 StuffIt 存档文件 wget -O - http://downloads.tuxfamily.org/sdtraces/stuffit520.611linux-i386.tar.gz | tar -zxv sudo cp bin/unstuff /usr/local/bin/ # 安装测试、加密、图形、反汇编库(可选) sudo pip install nose coverage pycryptodome pyqtgraph capstone sudo apt-get install python3-numpy python3-scipy |
当然你也可以使用binwalk-2.3.3文件夹里面的deps.sh文件进行一键安装
sudo ./deps.sh |
安装好所有的依赖后,就能正常使用了:
binwalk -Me firmware.bin |

unstuff的地址发生了改动:https://downloads.tuxfamily.org/sdtraces/BottinHTML/stuffit520.611linux-i386.tar.gz
感谢更新
ubi_reader的安装方式已被修改:
$ git clone https://github.com/jrspruitt/ubi_reader
$ cd ubi_reader
$ poetry install
安装 yaffshiv与安装 jefferson时出现:
不建议使用已经被弃用的 setup.py install 方法来安装 Python 包
建议使用 pip 替代直接运行 setup.py:
cd jefferson
sudo pip3 install .
cd yaffshiv
sudo pip3 install .