objection
objectionis a runtime mobile exploration toolkit, powered by Frida, built to help you assess the security posture of your mobile applications, without needing a jailbreak. 帮助链接: objection-wiki (opens new window)
# objection cli
objection --help: 帮助命令help android hooking watch class_method: 命令中使用, 监听 classobjection -S <device serial> -g <Gadget/Process> explore -P ~/.objection/plugins-P指定了插件的路径。使用 explore 模式会导致应用重启envevaluate <script_path>reconnect- jobs: 任务命令
jobs list: list current jobsjobs kill <Job_ID>
# memory
https://www.anquanke.com/post/id/197657#h3-2 (opens new window)
memory list modulesmemory list exports libssl.so --json /root/libart.json
# android
# hooking
- list
android hooking list classesandroid hooking list class_loadersandroid hooking list class_methodsandroid hooking list activity
- search
android hooking search methodsandroid hooking search classes
android hooking generate simple- watch
android hooking watch classandroid hooking watch class_method: 查看哪些个方法的参数、返回值和调用栈, 参数: --dump-args --dump-return --dump-backtrace
- set
# heap
https://www.anquanke.com/post/id/197657#h3-3 (opens new window)
android heap search instances com.android.settings.DisplaySettingsandroid heap execute 0x2526 getPreferenceScreenResIdandroid heap evaluate 0x2526进入迷你编辑器
# file
# import
Import fridascript from a full path and run it
# plugin
Work with plugins. 下面介绍一些常用的 objection 的 plugin
# Wallbreaker
https://github.com/hluwa/Wallbreaker (opens new window) 入门: 使用 Wallbreaker 快速分析 Java 类/对象结构 (opens new window)
一、使用
- 安装
objection: pip3 install objection - 下载 wallbreaker 到自己的插件目录:
git clone https://github.com/hluwa/Wallbreaker ~/.objection/plugins/Wallbreaker - 启动 frida-server, 使用 -P 参数 带着插件启动 objection:
objection -g com.app.name explore -P ~/.objection/plugins
二、使用
plugin wallbreaker classsearch <pattern>搜索类: 根据给的 pattern 对所有类名进行匹配, 列出匹配到的所有类名plugin wallbreaker objectsearch <classname>搜索对象: 根据类名搜索内存中已经被创建的实例, 列出 handle 和 toString() 的结果plugin wallbreaker classdump <classname> [--fullname]ClassDump: 输出类的结构, 若加了 --fullname 参数, 打印的数据中类名会带着完整的包名plugin wallbreaker objectdump <handle> [--fullname]ObjectDump: 在 ClassDump 的基础上, 输出指定对象中的每个字段的数据
# FRIDA-DEXDump
frida-dexdump is a frida tool to find and dump dex in memory to support security engineers in analyzing malware. 更多内容点击查看: FRIDA-DEXDump (opens new window)
使用命令 frida-dexdump -D <device_id> -f <package> 开始 dump dex
# other
# 本地源码运行 objection 程序
- 从官网 (opens new window)下载 objection 源码。 这里需要注意找到 tag 进行 clone, 可以选择与本地命令一样的版本 tag 进行 clone
这里使用 1.11.0 这个版本:
git clone -b 1.11.0 https://github.com/sensepost/objection.git. forked (opens new window) - cd 到 objection 目录.
- 查看源码的 setup.py 文件, 这是一个打包脚本。相关内容之前有介绍, link
- 安装需要的依赖
pip install -r requirements-dev.txt - 安装 agent 依赖。 这一步参考链接 agent dependencies (opens new window)
- 运行:
python -m objection.console.cli {参数}
结果如上, 证明配置正常了