該項目的目的是分析原始二進制固件並自動確定其某些功能。基本上,該工具與所有體系結構兼容,它只是對其進行簡單的統計信息。
主要功能:
首先,克隆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許可下提供。