binwalk安装

新版的binwalk使用Rust语言重写,提高了运行效率和速度。

从源码编译
第 1 步
安装 Rust 编译器:

sudo apt install curl
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. $HOME/.cargo/envz

这一步很多人都被卡住了,因为Rust源在国外,下载速度很慢,可能好几天也下不下来。

这里提供阿里云官方提供的Rust安装方法。

先换源(必须)

临时换源方法:

# 临时设置环境变量以替换默认更新源和分发服务器
export RUSTUP_UPDATE_ROOT=https://mirrors.aliyun.com/rustup/rustup
export RUSTUP_DIST_SERVER=https://mirrors.aliyun.com/rustup

永久换源:

# 在 ~/.bash_profile 文件中添加以下内容
echo 'export RUSTUP_UPDATE_ROOT=https://mirrors.aliyun.com/rustup/rustup' >> ~/.bash_profile
echo 'export RUSTUP_DIST_SERVER=https://mirrors.aliyun.com/rustup' >> ~/.bash_profile
# 更新当前终端会话的环境变量
source ~/.bash_profile

然后使用阿里云官方安装脚本。

curl --proto '=https' --tlsv1.2 -sSf https://mirrors.aliyun.com/repo/rust/rustup-init.sh | sh

步骤 2
下载 binwalk:

sudo apt install git
git clone https://github.com/ReFirmLabs/binwalk

步骤 3
安装依赖项(重要):

sudo ./binwalk/dependencies/ubuntu.sh

步骤 4
编译 Binwalk:

cd binwalk
cargo build --release

编译后的二进制文件将位于 :
binwalk/target/release/binwalk
您可以将其复制到您喜欢的任何目录,并从中运行它。

个人推荐使用以下命令

sudo cp target/release/binwalk /usr/local/bin/

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注