adb,frida,objection常用命令

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

posted @ 2022-04-10 20:19  Maple_feng  阅读(976)  评论(0编辑  收藏  举报