liyansong2018 / firmware-analysis-plus

Simulate firmware with one click of firmadyne (使用 firmadyne 一键模拟固件)
MIT License
326 stars 32 forks source link

腾达AX1806固件解压文件系统失败 #62

Open eve2ptp opened 1 month ago

eve2ptp commented 1 month ago

固件: https://www.tenda.com.cn/download/detail-3901.html

环境: Ubuntu 20.04 + 编译好的 binwalk

已知: 单独使用 binwalk -Me US_AX1806V2.0br_v1.0.0.1_cn_2997_ZGDX01.bin 可以解出 _US_AX1806V2.0br_v1.0.0.1_cn_2997_ZGDX01.bin.extracted/ubifs-root/2086951552/rootfs_ubifs 文件系统

复现:

./fap.py -q ./qemu-builds/2.5.0/ ./testcases/US_AX1806V2.0br_v1.0.0.1_cn_2997_ZGDX01.bin
[+] Firmware: US_AX1806V2.0br_v1.0.0.1_cn_2997_ZGDX01.bin
[+] Extracting the firmware...
[!] Image extraction failed

尝试修改 firmadyne/source/extractor/extractor.py 的递归层数但不起作用,以上情况同样发生在 FirmAE 中

eve2ptp commented 1 month ago

ExtractionItem__del__ 函数加睡眠检查解压目录

    def __del__(self):
        if self.database:
            self.database.close()

        if self.temp:
            self.printf(">> Cleaning up %s..." % self.temp)
            import time

            time.sleep(600)
            Extractor.io_rm(self.temp)
Directory: /tmp/tmp0zmyyj0t
>> Cleaning up /tmp/tmp0zmyyj0t...

ls/tmp/tmp0zmyyj0t/_US_AX1806V2.0br_v1.0.0.1_cn_2997_ZGDX01.bin.extracted/ubifs-root/2086951552
METADATA  rootfs_ubifs

会发现解压函数并未再深入到 rootfs_ubifs 目录检查文件系统