Ubuntu安装binwalk完整步骤

Ubuntu安装binwalk完整步骤

1. 安装python3.9

apt-get update
apt-get upgrade

apt-get install zlib1g-dev libbz2-dev libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev xz-utils libexpat1-dev liblzma-dev libffi-dev libc6-dev

cd /opt/software
wget https://www.python.org/ftp/python/3.9.0/Python-3.9.0b4.tgz
tar -zxvf Python-3.9.0b4.tgz
##编译安装
#后面加上 --enable-optimizations 会自动安装pip3及优化配置
./configure --prefix=/usr/local/python3  --enable-optimizations
make
make install

ll /usr/bin | grep python
ll /usr/bin | grep pip
rm -rf /usr/bin/python3
rm -rf /usr/bin/pip3

#添加python3的软链接
ln -s /usr/local/python3/bin/python3.9 /usr/bin/python3
#添加 pip3 的软链接
ln -s /usr/local/python3/bin/pip3.9 /usr/bin/pip3

python3 -V
pip3 -V

# 执行pip3 list后报错,与lsb_release -a相关
vim /usr/bin/lsb_release
# 将第一行python3改为原来python3的版本,例如python3.5

切换pip3源为国内源

mkdir -p ~/.pip

vim ~/.pip/pip.conf

[global]
timeout = 6000
index-url = https://mirrors.aliyun.com/pypi/simple/
trusted-host = mirrors.aliyun.com

2. 安装binwalk

pip3 install git+https://github.com/ReFirmLabs/binwalk.git

#如果下载太慢,采用下面方式
cd /opt/software
git clone https://hub.fastgit.org/ReFirmLabs/binwalk.git
cd binwalk
python3 setup.py install
cp /usr/local/python3/bin/binwalk /usr/local/bin
# 测试
binwalk

3. 安装crypto

# pycrypto 已停止更新, 使用 pycryptodome
pip3 install pycryptodome

4. 图片生成以及可视化

需要依赖 pyqtgraph 和 matplotlib

pip3 install matplotlib PyQt5 pyqtgraph

如果运行报错

qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.

这是因为 libqxcb.so 找不到 libxkbcommon-x11.so.0, libxkbcommon-x11.so.0, 在 pyqt5 的更新日志中有提及,直接 apt 安装即可

apt install libxkbcommon-x11-0

5. 反汇编

pip3 install capstone

6. 安装提取工具

binwalk 运行时会依赖一些命令行工具用于提取固件

apt install mtd-utils gzip bzip2 tar arj lhasa p7zip p7zip-full cabextract cramfsswap squashfs-tools sleuthkit default-jdk lzop srecord

软件包 cramfsprogs 包含命令 cramfsck, 在新版 ubuntu 和 debian 中已被移除, 直接下载了旧版的包然后使用 dpkg 安装

wget http://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/c/cramfs/cramfsprogs_1.1-6_amd64.deb
sudo dpkg -i cramfsprogs_1.1-6_amd64.deb
rm cramfsprogs_1.1-6_amd64.deb

7. 安装 sasquatch

推荐:

apt install build-essential liblzma-dev liblzo2-dev zlib1g-dev
git clone https://github.com/devttys0/sasquatch
cd sasquatch
./build.sh

8. 安装 jefferson

# jefferson 用于提取 JFFS2 文件系统
apt install python-pip
apt install liblzma-dev
pip2 install pyliblzma cstruct
pip2 install git+https://github.com/sviehb/jefferson.git

9. 安装 ubi_reader

# ubi_reader 用于提取 UBIFS 文件系统
apt install liblzo2-dev
pip3 install python-lzo
pip3 install git+https://github.com/jrspruitt/ubi_reader.git

10. 安装 yaffshiv

# 安装 yaffshiv 用于提取 YAFFS 文件系统
pip2 install git+https://github.com/devttys0/yaffshiv

你可能感兴趣的:(Linux,ubuntu,linux,服务器,渗透测试)