adb,frida,objection常用命令
1.adb
# 查看當前連接設備
adb devices
# 多個設備時指定設備
adb -s 設備號 其他指令
# adb -s 127.0.0.1:21503 shell
# adb -s FA6AE0309067 shell
# 查看Android處理器架構
adb shell getprop ro.product.cpu.abi
# 安裝APP
adb install xxx.apk
# 安裝APP,已經存在,覆蓋安裝
adb install -r xxx.apk
# 卸載APP
adb uninstall app包名
# 卸載APP,保留數據
adb uninstall -k app包名
# 往手機傳遞文件
adb push 文件名 手機路徑
# 從手機端獲取文件
adb pull 手機路徑/文件名
# 移動文件
mv /sdcard/Download/frida-server /data/local/tmp/
# 修改文件權限
chmod 777 /data/local/tmp/frida-server
# 查看日志
adb logcat
# 清日志
adb logcat -c
# 手機端安裝的所有app包名
adb shell pm list packages
# 查看當前包名和主Activity
adb shell dumpsys window | findstr mCurrentFocus
# 啟動APP
adb shell am start 包名/主Activity
# adb shell am start com.ss.android.auto.activity
# 關閉App
adb shell am force-stop 包名
# adb shell am force-stop com.ss.android.auto
# 殺進程
ps | grep "package name"查看其pid,通過 kill pid殺死進程
# 通過wifi鏈接
adb tcpip 5555
adb connect 192.168.1.5:5555
#connected to 192.168.1.5:5555
2.frida
# 啟動frida-server
./data/local/tmp/frida-server &
# 轉發端口
adb forward tcp:27042 tcp:27042
adb forward tcp:27043 tcp:27043
# 列舉出來所有連接到電腦上的設備
frida-ls-devices
# 連接到指定設備
frida-ps -D tcp
# 列舉出來設備上的所有進程
frida-ps -U
# 列舉出來設備上的所有應用程序
frida-ps -Ua
# 列舉出來設備上的所有已安裝應用程序和對應的名字
frida-ps -Uai
# 跟蹤某個函數
frida-trace -U -f Name -i "函數名"
# frida-trace -U -f com.ss.android.auto -i "getRequestParams"
# 跟蹤某個方法
frida-trace -U -f Name -m "方法名"
# frida-trace -U -f com.ss.android.auto -m "MapLoader"
# 網絡監控啟動frida
./frida-server -l 0.0.0.0:8888 &
3.objection
# 將objection注入應用
objection -g com.ss.android.auto explore
# 通過ip端口鏈接注入,先要用網絡監控啟動frida
objection -N -h 192.168.1.5 -p 8888 -g com.ss.android.auto explore
# 查看內存中加載的庫
memory list modules
# 查看庫的導出函數
memory list exports libssl.so
# 將庫的導出函數保存到json文件中
memory list exports libart.so --json libart.json
# 內存堆搜索類的實例
android heap search instances com.ss.android.auto.ae.gmap.maploader.MapLoader
# 調用實例的方法
android heap execute 0x2526 getRequestParams
# 啟動activity
android intent launch_activity com.ss.android.auto.activity.MapActivity
# 查看當前可用的activity
android hooking list activities
# 列出內存中所有的類
android hooking list classes
# 內存中搜索所有的類
android hooking search classes MapLoader
# 內存中搜索所有的方法
android hooking search methods getRequestParams
# 列出類的所有方法
android hooking list class_methods com.ss.android.auto.ae.gmap.maploader.MapLoader
# 直接生成hook代碼
android hooking generate simple com.ss.android.auto.ae.gmap.maploader.MapLoader
# hook類的所有方法
android hooking watch class com.ss.android.auto.ae.gmap.maploader.MapLoader
# objection當前的Hook數
jobs list
# 查看方法的參數、返回值和調用棧
android hooking watch class_method com.ss.android.auto.ae.gmap.maploader.MapLoader.getRequestParams --dump-args --dump-return --dump-backtrace
# hook類的所有重載
android hooking watch class_method com.ss.android.auto.ae.gmap.maploader.MapLoader.$init --dump-args