Objection的安裝和簡單使用


Objection

 

Objection的安裝

  • 安裝前置條件
python版本 > 3.4
pip版本 > 9.0
  • 安裝命令
pip3 install objection 

Objection的使用

使用objection注入“設置”應用。

objection -g 包名 explore

可以使用該env命令枚舉與所討論的應用程序相關的其他有趣目錄: env

 

  • Memory 指令

memory list modules  // 查看內存中加載的庫
memory list exports libssl.so  // 查看庫的導出函數
memory list exports libart.so --json /root/libart.json //將結果保存到json文件中
memory search --string --offsets-only //搜索內存
memory search "64 65 78 0a 30 35 00"

 

  • android heap

android heap search instances com.android.settings.DisplaySettings //堆內存中搜索指定類的實例, 可以獲取該類的實例id
android heap execute 0x2526 getPreferenceScreenResId //直接調用指定實例下的方法
android heap evaluate 0x2526 //自定義frida腳本, 執行實例的方法
  • root

//嘗試關閉app的root檢測
android root disable

//嘗試模擬root環境
android root simulate
  • activities

可以列出app具有的所有avtivity: android hooking list activities
啟動指定avtivity: android intent launch_activity [class_activity]
查看類的全部廣法:android hooking list class_methods com.android.settings.DisplaySettings
  • ui

//截圖
android ui screenshot [image.png]

//設置FLAG_SECURE權限
android ui FLAG_SECURE false
  • 內存漫游

//列出內存中所有的類
android hooking list classes

//在內存中所有已加載的類中搜索包含特定關鍵詞的類
android hooking search classes [search_name] 

//在內存中所有已加載的方法中搜索包含特定關鍵詞的方法
android hooking search methods [search_name] 

//直接生成hook代碼
android hooking generate simple [class_name]
  • hook 方式

/*
  hook指定方法, 如果有重載會hook所有重載,如果有疑問可以看
  --dump-args : 打印參數
  --dump-backtrace : 打印調用棧
  --dump-return : 打印返回值
  */
android hooking watch class_method com.xxx.xxx.methodName --dump-args --dump-backtrace --dump-return
android hooking watch class_method java.lang.StringBuilder.toString --dump-return //獲取全部tostring的返回來值
android hooking watch class_method android.app.Dialog.show --dump-args --dump-backtrace --dump-return //彈窗
//hook指定類, 會打印該類下的所以調用 
android hooking watch class com.xxx.xxx 
//設置返回值(只支持bool類型) 
android hooking set return_value com.xxx.xxx.methodName false
  • Spawn方式Hook

objection -g packageName explore --startup-command '[obejection_command]'
  • activity和service操作

//枚舉activity
android hooking list activities

//啟動activity
android intent launch_activity [activity_class]

//枚舉services
android hooking list services

//啟動services
android intent launch_service [services_class]
  • 任務管理器

//查看任務列表
jobs list

//關閉任務
jobs kill [task_id]
  • 關閉app的ssl校驗

android sslpinning disable
  • 監控系統剪貼板

//獲取Android剪貼板服務上的句柄並每5秒輪詢一次用於數據。 如果發現新數據,與之前的調查不同,則該數據將被轉儲到屏幕上。
help android  clipboard
  • 執行命令行

help android shell_exec [command]

 

  •  Spawn方式Hook

從Objection的使用操作中我們可以發現,Obejction采用Attach附加模式進行Hook,這可能會讓我們錯過較早的Hook時機,可以通過如下的代碼啟動Objection,引號中的objection命令會在啟動時就注入App。

objection -g packageName explore --startup-command 'android hooking watch xxx' 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM