关于binwalk->sasquatch插件安装错误的缓解方案

23 篇文章 0 订阅
3 篇文章 0 订阅

一些相关报错:

  1. WARNING: Extractor.execute failed to run external extractor ‘sasquatch -p 1 -le -d ‘squashfs-root’ ‘%e’’: [Errno 2] No such file or directory: ‘sasquatch’, ‘sasquatch -p 1 -le -d ‘squashfs-root’ ‘%e’’ might not be installed correctly
  2. unsquashfs.c:1835:5: error: this ‘if’ clause does not guard… [-Werror=misleading-indentation] 1835 | if(swap)
  3. Filesystem uses lzma compression, this is unsupported by this version Decompressors available: gzip
  4. -bash: sasquashfs: command not found

缓解方案:

取消自动安装,改为手动安装squashfs-tools代替sasquashfs。

  1. 注释binwalk仓库里deps.sh的install_sasquatch后运行deps.sh
install_pip_package "setuptools matplotlib capstone pycryptodome gnupg tk"
#install_sasquatch
install_yaffshiv
install_jefferson
install_ubireader

if [ $distro_version = "18" ]
then
install_cramfstools
fi
  1. 获取4.5版本及以上的squashfs-tools,链接:https://github.com/plougher/squashfs-tools.git或https://sourceforge.net/projects/squashfs/files/squashfs/
git clone https://github.com/plougher/squashfs-tools.git
cd squashfs-tools
cd squashfs-tools
make # 可能需要再安装manpages和help2man,均包安装即可
sudo make install

此时,binwalk可正常使用squashfs-tools进行解压(-e).
若解压squashfs依旧error,请使用firmware-mod-kit的unsquashfs脚本

解释与补充

此时,虽然我们使用binwalk所报错的“sasquatch”命令会提示报错,但对于正常使用mksquashfs工具打包的squashfs系统已能正常解包。

题中这个问题的主要原因是,binwalk使用的sasquatch仓库所使用的squashfs工具并非是最新版。甚至是这个作者自己写了个patch folder给低版本的squashfs源码打补丁(但就算打了补丁,在高版本的kali和ubuntu20+的版本依旧很难编译)

并且,不仅是sasquatch这个仓库,binwalk自己对插件这类的支持也很怪。首先就是我们的报错1,相信那是大家搜到这个问题的直接原因。这个报错虽然指出了sasquatch,并且网上的博客都叫我们去安装就好了。但是,实际上:

  1. 这个sasquatch应该是squashfs-tools的过去时。我个人测试了4.2和4.5、4.6均不会使用sasquatch这个二进制文件。
  2. sasquatch实际上是binwalk的一个替代解压方案,当binwalk搜不到unsquashfs(squashfs-tools),才会使用sasquatch。请看源码:
    在这里插入图片描述
    这是binwalk的解压配置文件,可以在最底下发现unsquashfs是优先被调用的。但因为不知道什么原因,就算有squashfs-tools,但要是squashfs-tools解压失败会导致binwalk使用sasquatch相关的报错信息。(这里注释sasquatch后重新编译也可测试出unsquashfs实际上是会被识别的)

那么这个问题的产生原因就如上所言,是binwalk和sasquatch的版本脱节所致。

而版本问题显然也有其它解决法,比如把sasquatch的build.sh的版本号改高,等等等等。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Ubuntu上下载binwalk可以通过两种方法进行。第一种方法是直接通过终端安装binwalk,你可以使用以下命令进行安装:$ sudo apt-get install binwalk。这将从Ubuntu的软件源中下载并安装binwalk软件包。 另一种方法是手动下载binwalk压缩包,并进行解压安装。首先,你可以下载旧版的cramfsprogs软件包,因为新版Ubuntu和Debian已经移除了cramfsck命令。你可以使用以下命令下载并安装cramfsprogs软件包: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。接下来,你可以安装sasquatch工具,该工具是binwalk的一个依赖项。具体安装步骤可以参考相关文档。 需要注意的是,一些方法在安装过程中可能会出现错误,因此你可以尝试不同的方法以找到适合你的安装方式。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [在Ubuntu系统下安装杂项必备工具binwalk](https://blog.csdn.net/qq_62999000/article/details/122010423)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [Ubuntu安装binwalk完整步骤](https://blog.csdn.net/u013071014/article/details/122426769)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值