逆向分析part1-信息收集
信息收集用于辅助固件的逆向分析
一、strings — 字符串检索
【Linux系统自带命令】strings:在对象文件或二进制文件中查找可打印的字符串!!!
$ strings -h
Usage: strings [option(s)] [file(s)]
Display printable strings in [file(s)] (stdin by default)
The options are:
-a - --all Scan the entire file, not just the data section [default]
-d --data Only scan the data sections in the file
-f --print-file-name Print the name of the file before each string
-n --bytes=[number] Locate & print any NUL-terminated sequence of at
-<number> least [number] characters (default 4).
-t --radix={o,d,x} Print the location of the string in base 8, 10 or 16
-w --include-all-whitespace Include all whitespace as valid string characters
-o An alias for --radix=o
-T --target=<BFDNAME> Specify the binary file format
-e --encoding={s,S,b,l,B,L} Select character size and endianness:
s = 7-bit, S = 8-bit, {b,l} = 16-bit, {B,L} = 32-bit
-s --output-separator=<string> String used to separate strings in output.
@<file> Read options from <file>
-h --help Display this information
-v -V --version Print the program's version number
通过strings查找一些特殊的字符串具有意义的字符串,用于固件分析
$ strings firmware.bin # -a 参数为默认参数
product:LXAMM01&mcu:1&
fotaconfig.xml
(*N"b
3ci?M1
6mYW
+N:
8z] 5
oemapp.ubi
=xkv
=xkv
O0sv8
(+"K#rl%
a2roy
VJXm
SZS:&
.....
.....
*vWT
8:/w
<\\"$-
fotaconfig.xmlPK # 通过如下oemapp.ubi,mdm9607-boot.img,mdm9607-sysfs.ubi,mcu.bin,猜测是升级固件包或者完整的固件,因此使用binwalk
# (PS:binwalk不是万能的)可以进一步识别、分离、提取等操作
oemapp.ubiPK
PlTR5
mdm9607-boot.imgPK
PlT8/
mdm9607-sysfs.ubiPK
PlT%c
mcu.binPK
二、hexdump — 十六进制查看
三、芯片手册检索地址
对于能够看到芯片的实体设备可以尝试检索芯片手册,可以更快的确定架构、IRQ等,方便进一步分析!!!
进行MCU逆向分析时,datasheet对逆向分析有很大的作用
立创商城_电子元器件采购网上商城_领先的现货元器件交易平台-嘉立创电子商城
ALLDATASHEET.COM - Electronic Parts Datasheet Search
icspec-电子元器件查询网-datasheet-芯片查询-芯片规格书-半导体芯片
四、binwalk — 文件头识别
五、特定文件格式
SREC、Hex、Bin的区别是什么
具体参考如下:
程序烧录中SREC、Hex、Bin文件格式有啥区别?一文看懂!-面包板社区
.srec文件
对于.srec结尾的文件是ARM GUN GCC工具链生成的S19文件(摩托罗拉(或现在的飞思卡尔)S-Record)
SREC文件格式详解参考如下:
程序烧录中SREC、Hex、Bin文件格式有啥区别?一文看懂!-面包板社区
对于SREC格式的文件转换成bin文件,可以使用SRecord,ARM buildroot,burner进行转换,这里使用最多的是ARM buildroot,工具的详细使用参考如下:
SRecord转换SREC文件为BIN
burner转换SREC文件为BIN
.s19 文件转换为 .hex 和 .bin文件的方法_hb69222的博客-CSDN博客_.s19
S-Record, Intel Hex and Binary Files
ARM Buildroot转换SREC文件为BIN
Converting S19 Files into Binary Files with GNU objcopy
Cross-compilation toolchains for Linux - armv7-eabihf toolchains
评论
发表评论