该项目的目的是分析原始二进制固件并自动确定其某些功能。基本上,该工具与所有体系结构兼容,它只是对其进行简单的统计信息。
主要功能:
首先,克隆git存储库:
git clone https://github.com/quarkslab/binbloom.git
cd binbloom构建最新版本(仅限Linux):
autoreconf -i
./configure
make
sudo make install binbloom firmware.bin此命令应给出这样的输出:
[i] 32-bit architecture selected.
[i] File read (20480 bytes)
[i] Endianness is LE
[i] 6 strings indexed
[i] Found 3 base addresses to test
[i] Base address seems to be 0x60000000 (not sure)
More base addresses to consider (just in case):
0x005b5000 (0)
0x0bcd0000 (0)在此输出中,第三行显示了猜测的Endianness( Le ,Little-endian),第六行给出了猜测地址( 0x60000000 )。已经确定了6个文本字符串和3个可能的基础地址。如果未指定体系结构,则默认情况下考虑32位体系结构。
每个候选地址之后括号中的值是相应的分数。分数越高,地址的可能性就越大。
binbloom -a 64 firmware.bin [i] 64-bit architecture selected.
[i] File read (327680 bytes)
[i] Endianness is LE
[i] 717 strings indexed
[i] Found 7535 base addresses to test
[i] Base address found: 0x0000000000010000.
More base addresses to consider (just in case):
0x000000000000e000 (276)
0x000000000000f000 (242)
0x0000000000011000 (175)
0x000000000000d000 (167)
0x000000000000b000 (121)
0x0000000000013000 (107)
0x0000000000012000 (100)
[...] -a选项告诉Binbloom考虑一个64位固件,以上输出显示了0x10000的猜测基地地址。
在处理小型公司时(尺寸<10 kbytes)时,双胞胎检测可能并不可靠,并给出错误的结果,从而导致意外的基础地址。在这种情况下,您可以使用-e选项来指定endianness:
binbloom -e be firmware.bin然后,它产生以下输出:
[i] Selected big-endian architecture.
[i] File read (1048576 bytes)
[i] Endianness is BE
[i] 764 strings indexed
[i] Found 18615 base addresses to test
[i] Base address seems to be 0x00000000 (not sure).
More base addresses to consider (just in case):
0x3f740000 (121043)
0x7ff48000 (61345)
0x41140000 (59552)
[...]然后,强迫endianness(在这种情况下为大端),并依靠这种配置来猜测基础地址。
binbloom -a 32 -e be -b 0x0 firmware.bin [i] 32-bit architecture selected.
[i] Selected big-endian architecture.
[i] Base address 0x0000000000000000 provided.
[i] 764 strings indexed
Most probable UDS DB is located at @000ee8c8, found 7 different UDS RID
Identified structure:
struct {
code *p_field_0;
code *p_field_1;
uint32_t dw_2;
}该分析基于启发式方法,因此可以给出误报。您必须阅读Binbloom找到的潜在UDS数据库列表,并检查哪个数据库是正确的(如果有)。 Binbloom在其输出中提供了确定的结构,从而使某些拆卸器可以按照结构声明来解析内存。
您可以通过使用-t选项启用多线程来加快基础地址查找过程。默认情况下,使用一个线程。
binbloom -t 8 firmware.bin还实现了具有-d选项的深度搜索模式,但仍是实验性的。在极少数情况下,此模式可能会很有用,因为当其他行之有效时,它可能会找到一个有效的基础地址,但这是一种较慢的模式,可能需要一些时间才能完成。
如果您希望该工具显示更多信息,请使用一个或多个-v选项。
Binbloom在Apache 2.0许可下提供。